# Datasource failed

**URL:** <https://community.qfield.org/t/datasource-failed/1218>\
**Category:** Ask the Community\
**Tags:** gh-import\
**Created:** [3 September 2025 20:49 UTC](https://community.qfield.org/t/datasource-failed/1218 "2025-09-03T20:49:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JuaniMunozOv](https://dub1.discourse-cdn.com/flex018/user_avatar/community.qfield.org/juanimunozov/32/785_2.png) [@JuaniMunozOv](https://community.qfield.org/u/JuaniMunozOv)\
**Post date:** [3 September 2025 20:49 UTC](https://community.qfield.org/t/datasource-failed/1218/1 "2025-09-03T20:49:58Z")

</div>

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.
