# How to Fix a Broken Project
Do you get an error message when trying to open a project or a form in Mergin Maps mobile app? There can be multiple reasons for what went wrong. Here we will try to guide you through some cases you may encounter.
Note that these issues may be related to an older version of the mobile app or QGIS (opens new window) so the content on this page may display outdated versions of Mergin Maps products.
Need more help with your issue?
The Troubleshoot page has general troubleshooting tips and describes support options that include commercial support, support for subscribed clients or community support.
# Saving of feature failed (vector layer)
since Mobile app 2.5.0The error is caused by a change of behaviour in QGIS versions 3.34.0 and higher as well as Mergin Maps mobile app 2.5.0 and higher.
DETAILS
You can see the detailed upstream issue report on this link (opens new window).
The error can be identified by notification Failed to save changes in the Mergin Maps mobile app when a feature is added or modified.
In the diagnostic log, you may find errors such as Failed to commit changes, or ... wrong data type for attribute ....
2023-12-05 09:04:25.058221+0100 Input[2593:32260] "2023-12-05T08:04:25.058Z CommitChanges: Failed to commit changes:\nERROR: 1 feature(s) not added.\n\n Provider errors:\n wrong data type for attribute 12 of feature -2: 10\n"
To fix the project:
- Open your Mergin Maps project in QGIS.
- Open problematic vector layer's properties in the project.
- Find boolean fields that use Default values
'false'
or'true'
.
- Replace string representation
'false'
or'true'
by literalfalse
ortrue
(remove single quotation marks). - Save and sync the project.
# Failed to read project issue (vector tiles)
The error is caused by a bug, which should be fixed in QGIS versions 3.20, 3.18.3 and 3.16.7 and higher, so only projects created in older versions of QGIS are affected. Unfortunately, saving the project in a newer QGIS version is not enough to fix it.
DETAILS
From a technical point of view, the issue is caused by a bug in parsing Mapbox GL style for vector tile layers that caused issues when loading Qt5-based QGIS projects from older QGIS versions in Qt6-based QGIS. This bug was fixed and should not appear in QGIS versions 3.20, 3.18.3 and 3.16.7 and higher.
Qt6 has been used in Mergin Maps mobile app since version 2.0.0. Thus, if you use a QGIS project that was created in older QGIS versions, you may encounter this error.
When trying to identify what to fix in your project, look for these:
- a vector tile layer with JSON style
- when a rule has
text-size
with "stops" - data-defined text size gets badly stored expression (as 0x01 character instead of the proper expression)
There is a high chance that these settings are the culprit behind the error!
To fix the project:
Open your Mergin Maps project in QGIS.
Remove problematic vector tile layers from the project.
If you use online vector tiles, navigate to Vector Tiles in the Browser panel and create a new vector tiles connection to the data source.
DETAILS
You may also inspect the Style URL in the Vector Tiles Connection.
For instance, if the Style URL looks like this (Qwant Maps settings used here):
styleUrl=https://raw.githubusercontent.com/QwantResearch/qwant-basic-gl-style/master/style.json&type=xyz&url=https://www.qwant.com/maps/tiles/ozbasemap/%7Bz%7D/%7Bx%7D/%7By%7D.pbf&zmax=14&zmin=0
try removing the part of the link afterstyle.json
to get:
styleUrl=https://raw.githubusercontent.com/QwantResearch/qwant-basic-gl-style/master/style.json
Add the layers back to the project.
Offline vector tiles should be located in the project folder on your computer. Online vector tiles connections can be managed in Vector Tiles in the Browser.
Save and sync the project.
WARNING
Copying styles from problematic layers and pasting them to other layers can cause the error to occur again. Unless you know what exactly causes the issues and are able to fix that, you might need to recreate the styles.