Datasource failed

Greetings, everyone.

I want to ask about a development I’m working on, and I find each of my logs very curious.

My idea is to connect Qfield to my Postgres database so that when I make changes, they are reflected directly in the database after the push.

Things to keep in mind: using SDK, I create an empty project, then I go to Qfield Cloud, add the secret that I previously added to my QGS successfully as an environment variable, and then I upload files to the created project. This connects the whole idea to enter Qfield, which I achieve successfully, but when I want to download my project, which appears as valid, it fails.

In short, after many attempts, such as uploading the file using CLI with upload-file, uploading it via SDK, or connecting via QField Sync from QGIS and uploading the project from there, the same thing always happens… my data source breaks.

What is happening? My QGS has six layers, and when I check each layer, it looks like this:

postgresql://J001?service=‘geonode_data’&sslmode=prefer&table="public"."PC_OE1UPM10106001AGECLocalidad"&key="tid"&geometry_column="the_geom"

which, in my opinion, is perfect for generating the qgs.

But the important thing is that no matter what upload I do or what method I use, my qgs gets corrupted. And how? Because when I checked that my QGS cannot be opened in QGIS, I found that

my layer datasource looks like this:

&sslmode=‘prefer&table=\“public\”.\“PC_OE1UPM10106001AGECReferencias\”&key=\“tid\”&geometry_column=\“the_geom\”’ postgresql://J001?service=‘geonode_data’

I don’t understand what’s happening, but I understand that you’re looking for layers in a broken data source and that’s why you can’t find them.

The secrets were added as environment variables using this syntax:

postgresql://geonode_data:PASSWORD@HOST:PORT/geonode_data

And as you can see, I’m keeping the same name… let it be J001.