Lavori¶
I lavori su QFieldCloud eseguono operazioni pesanti con i file di progetto e i layer all'interno di QGIS. I lavori vengono creati in risposta a determinate azioni dell'utente.
Once a job is created, it is added to the project's job queue and waits for available QFieldCloud resources to run. At any given moment only one job can run per project. The rest of the queued jobs will perform in the same order as in they entered the queue.
Each job consists of one or more steps and each step is responsible for one self contained task on the project.
QFieldCloud supports three predefined job workflows: process_projectfile
, package
and delta_apply
.
Durante l'esecuzione, i lavori scrivono messaggi di log che sono disponibili nella pagina dei lavori del progetto per i lavori che hanno raggiunto lo stato finale FINISHED
o FAILED
.
I lavori hanno accesso ai segreti del progetto.
Note
Tutti i lavori possono essere lanciati utilizzando l'API di QFieldCloud.
Attenzione
- Le condizioni di attivazione descritte in questa pagina possono cambiare senza preavviso.
- Tutti i lavori devono terminare entro 10 minuti, altrimenti si verificherà un errore di timeout e verranno interrotti.
Info
If you are looking for technical details how Jobs work, check the Job Queue documentation.
Tipi di lavoro¶
Elaborazione del file di progetto (process_projectfile
)¶
The process project file job is used to extract details about the project configuration and project layers including QGIS version used, project CRS, layer CRS, layer names, layer validity etc.
QFieldCloud validates the uploaded QGIS project file (.qgs
/.qgz
), as well as the supporting GeoPackages, TIFFs and other data source files.
It also validates remote connections to PostGIS, WFS, WMS and other online data sources.
QFieldCloud will open the project file in a QGIS instance on the server to extract all the necessary information.
Trigger¶
Questo lavoro viene lanciato ogni volta che un file viene caricato su QFieldCloud, a meno che non sia valida almeno una delle seguenti condizioni:
- Non è stato ancora caricato alcun file di progetto QGIS (
.qgs
/.qgz
). - The uploaded file is within the
DCIM
directory. Those files are assumed to be irrelevant to project validity. - C'è già un lavoro
process_projectfile
in statoPENDING
.
Risoluzione dei problemi¶
A process_projectfile
job might result in FAILED
status.
Check the non-exhaustive list of causes below:
- The uploaded QGIS project file (
.qgs
/.qgz
) is unreadable, incomplete, broken or wrong. Try to reupload the QGIS project file. - QGIS is crashing after opening the project file.
- Try to identify the layer that is causing the crash by removing one layer at a time from the project and reuploading the QGIS project file.
Note
Even if a process_projectfile
job results in a SUCCESS
status, it does not mean the project is properly configured.
The SUCCESS
status just states the project has been successfully opened and all the needed information has been extracted.
Creazione pacchetto (package
)¶
The package
job converts a QGIS project to a QField project, the same way it is done on QGIS via QFieldSync.
The package
job will prepare all layers marked as "Offline editing" to a single GeoPackage.
Trigger¶
This job is triggered every time the Download or Synchronize buttons are pressed on QField. Unless at least one of the following condition are valid:
- Il progetto non ha mai eseguito un lavoro
process_projectfile
che abbia avuto come risultato lo statoSUCCESS
. - Esiste già un lavoro
package
in statoPENDING
. - Il progetto non contiene layer vettoriali online (PostGIS, WFS ecc.), l'ultimo risultato del lavoro
package
è statoSUCCESS
e non sono stati caricati file o modifiche.
Risoluzione dei problemi¶
A package
job might result in FAILED
status.
Check the non-exhaustive list of causes below:
- Il progetto non ha mai eseguito un lavoro
process_projectfile
che abbia avuto come risultato lo statoSUCCESS
. - Some of the project layers are inaccessible from QFieldCloud.
- Make sure all files are uploaded and all credentials to online layers (PostGIS, WFS etc) are stored within the QGIS project file.
Applicazione delta (delta_apply
)¶
Delta apply è responsabile di rendere permanenti tutte le modifiche apportate a QField.
Trigger¶
This job is triggered every time a Synchronize or Push changes button is pressed on QField, or Apply pending changes button is pressed on the Changes project page. If any of the following condition are valid:
- Il progetto non ha mai eseguito un lavoro
process_projectfile
che ha dato come risultato lo statoSUCCESS
. - C'è già un lavoro
delta_apply
in statoPENDING
.
Risoluzione dei problemi¶
A delta_apply
job might result in FAILED
status.
Check the non-exhaustive list of causes below:
- Almeno uno dei database online (PostGIS/WFS) utilizzati nel progetto QGIS ha resettato la connessione.
- Il progetto è troppo grande e il lavoro non ha funzionato.
- There are hidden files and directories within the project that are preventing the normal work of QFieldCloud.
- Hidden files and directories are those starting with a leading dot (
.
).
Understanding conflicts delta_apply
jobs¶
Conflicts can occur under the following conditions:
- Two or more users modify the geometry or a specific attribute of the same feature, starting from the same initial value but saving different values.
- A primary key is used more than once.
To minimize the risk of conflicts, follow these best practices:
- Plan updates collaboratively - When updating features based on specific field conditions, assign each user a distinct set of features to edit.
- Clear planning reduces overlap and potential conflicts.
- Avoid modifying primary keys - Primary keys should be treated as immutable and configured to be read-only.
- This ensures consistent identification of features and prevents accidental modifications.
- Ensure unique primary keys - Use a truly unique primary key, such as a UUID (
uuid()
), to prevent conflicts and ensure data integrity.
By implementing these practices, you can significantly reduce the likelihood of conflicts and maintain consistent data.
How to resolve conflicts?¶
By default, QFieldCloud overwrites conflicts using a last wins policy (the latest patch of changes to the attribute(s) involved in the conflict replaces all earlier patches of changes to these attributes). Alternatively, admins can set a project's conflict resolution policy to manual. Doing so will require the project manager to manually resolve conflicts, picking those to be applied to the project.
- Passa alla sezione "Modifiche".
- Filter the changes with the "CONFLICT" status.
- Per ogni modifica in conflitto, selezionarla e impostare lo stato su "Riapplica" dal menu a discesa "Azione", altrimenti se tutte le nuove modifiche sono in conflitto puoi scegliere nell'ultima modifica in conflitto e selezionare "Riapplica questa e le modifiche più recenti".
- Controlla i dettagli delle modifiche nel conflitto e fare clic su "Salva tutto" alla fine della pagina.
Riapplicare le modifiche in QFieldCloud¶
- Clicca sul nome del progetto sotto I miei progetti.
- Vai alla sezione Modifiche (Le modifiche sono ordinate dalla più recente alla più vecchia)
- Trova le modifiche specifiche che desideri riapplicare.
- Nella colonna Azione sulla destra, clicca sulla lista a discesa.
-
Scegli l'azione desiderata per riapplicare le modifiche.
- Riapplicare modifiche specifiche: se è necessario riapplicare modifiche specifiche, selezionare ogni modifica che si desidera applicare nuovamente e fare clic su Riapplica.
- Riapplica le modifiche recenti: Se si preferisce riapplicare le modifiche più recenti apportate al progetto, identificare la modifica iniziale che si desidera ripristinare, quindi selezionare Riapplica questa e le modifiche più recenti.
Infine, clicca sul bottone Salva tutto.
Risoluzione dei problemi con log dei lavori¶
Quando si esegue un lavoro, di solito nei log si trova un passaggio chiamato "Check project layers" che stampa una tabella con tutti i layer del progetto e lo stato accanto ad essi.
Gli stati possibili sono:
- ok - Il layer viene caricato correttamente su QFieldCloud.
- invalid_dataprovider - Il provider di dati del layer non è valido. Di solito le informazioni aggiuntive sono mostrate nel "Riepilogo provider".
- invalid_layer - Questo errore dovrebbe accadere molto raramente. I dati vengono caricati correttamente, ma per qualche motivo QGIS riporta il layer come non valido.
Impossibile connettersi al servizio "{SERVICE}
".¶
QFieldCloud tries to connect to a PostgreSQL service that is not available. You should need to create a new pgservice secrets so QFieldCloud can connect to the PostgreSQL service.
Impossibile connettersi all'host "{HOST}
".¶
QFieldCloud cannot establish a connection to the given {HOST}
. Your service is not accessible from the QFieldCloud server.
You might been to ask your IT department to whitelist the QFieldCloud IP.
Impossibile connettersi all'host "localhost".¶
You have uploaded a layer that connects to a database/service on your local machine. Either remove that layer or replace it with a layer source accessible by QFieldCloud.
File "{FILENAME}
" mancante.¶
The file {FILENAME}
(e.g. /tmp/rndstr/files/data.gpkg
) is not found on the QFieldCloud server and cannot be opened.
There are two things that should be checked:
- Whether the file has been uploaded to the cloud. You can check this in Project Settings -> Files page on QFieldCloud or QFieldSync.
- Making sure the file is uploaded with the same relative path as on your PC.
Please note that all project files should be within the same project directory or subdirectory as the
.qgs
/.qgz
QGIS project file. Please also note the directory names should be preserved too, for example if a file is stored indata/data.gpkg
, make sure thedata
directory exists on QFieldCloud too.