Localized data / offline basemap producing invalid_dataprovider warning

Hi everyone,

has anyone else noticed atypical behavior from localized data with the rollout of QGIS 4.0x? I’m wondering if I’m experiencing a bug or if there’s something else I’m missing.

The workflow is as follows: I create a qgis project, populate it, make sure that I’ve set a path for local datasets and all project data paths are relative, add a basemap from that local datasets path to the project and package the whole thing for the cloud using default options. I then move the basemap to the appropriate folder on my phone, check project settings on the qfield cloud website and synchronize the project to my phone.

Expected behavior: The website warns me that there is a local dataset and informs me of the option of using its shared data option. The qfield app resolves the localized data path to the appropriate folder on my phone and loads the basemap.

Actual behavior: The website warns me that my QGIS project may not work as expected on QField based on the following error: Layer “basemap” has an error with code “invalid_dataprovider”: Cannot open MBTiles database Check the latest “process_projectfile” job logs for more info and reupload the project files with the required changes.

The job log says: Layer Name basemap layer Id …7e33b5 Type Raster Is Valid False Status invalid_dataprovider Error Summary Cannot open MBTiles database Provider Summary Cannot open MBTiles database. and: Layer ‘basemap’ (basemap_99cae0d4_3477_4a27_b2f0_d111e47e33b5) is invalid.

The qfield app throws a similar warning when opening the project.

Crucially it does open and display the basemap correctly though.

This behavior is persistent across the following combinations of devices:

QGIS 4.01 on windows 11 and the newest official qfield android app

QGIS 4.02 on endeavouros and the newest official qfield android app

using version 4.01 of QGIS and an older version of qfield (unfortunately did not check which one before updating) produces the same warning but actually fails to display the basemap

using QGIS 3.44 on windows 11 or 3.42 on endeavouros fails to replicate this behavior, it instead shows the expected, normal localized basemap behavior as long as the project was never opened and saved by QGIS 4.0x. Doing so immediately leads to the above unexpected behavior.

It is not limited to mbtiles either; I was able to replicate this behavior with localized tif and gpkg files.

Did anything change in the way QGIS handles localized data/basemaps that breaks how qfield handles localized data? or am I missing something?

Hello, QFieldCloud lead dev here.

Thanks for the report!

What you described looks very much like a QGIS 4 change in the behaviour how localized datasets source are described within the QGIS project file.

I think it will no longer be an issue once we move the QGIS workers in QFieldCloud to QGIS 4. You can follow the progress here: Bump QGIS version from `3.44.10` to `4.0.2` by suricactus · Pull Request #1542 · opengisch/QFieldCloud · GitHub .

ETA is mid June latest.

Were you able to fix this issue? We’ve been having the same problem.

Thank you suricactus! I’ll just sit tight and keep an eye out for that then :slight_smile: (and also thank you for all the work that goes into keeping the beast fed everything running!)

@ch3325 we’ve just made sure that everyone updated their qfield app and will be ignoring the warning for the time being! It does work despite the warning if we use the newest version of the app so we’ve just briefed everyone to expect and dismiss that warning for now

Was it just the warning that was an issue for you? Our apps are up to date but have stopped showing the basemap in our project