作业¶
作业在QField云端对QGIS中的工程文件和图层执行大量的运算。作业是响应某些用户动作而创建的。
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
.
运行时,作业写入日志消息,这些消息可在工程的作业页面上找到,用于已达到最终状态 FINISHED
或 FAILED
的作业。
作业可以访问 工程机密消息 。
笔记
可以使用QField云API触发所有作业。
警告
- 本页中描述的任何触发条件可能会更改,恕不另行通知。
- 所有作业必须在10分钟内完成,否则将导致超时错误并终止。
Info
If you are looking for technical details how Jobs work, check the Job Queue documentation.
作业类型¶
处理工程文件 (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.
触发器¶
每次将文件上传到QField云时都会触发此作业,除非以下条件中至少有一项有效:
- 尚未上传任何QGIS工程文件 (
.qgs
/.qgz
) 。 - The uploaded file is within the
DCIM
directory. Those files are assumed to be irrelevant to project validity. - 已存在处于
PENDING
状态的process_projectfile
作业。
解决问题¶
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.
打包 (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.
触发器¶
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:
- 该工程从未运行过导致
SUCCESS
状态的process_projectfile
作业。 - 已存在处于
PENDING
状态的package
作业。 - 该工程不包含在线矢量图层 (PostGIS、WFS等),最新的
package
作业结果是SUCCESS
,没有文件上传,也没有更改上传。
解决问题¶
A package
job might result in FAILED
status.
Check the non-exhaustive list of causes below:
- 该工程从未运行过导致
SUCCESS
状态的process_projectfile
作业。 - 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.
Delta 应用 (delta_apply
) 作业¶
Delta应用作业负责将所有推送QField的更改永久化。
触发器¶
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:
- 该工程从未运行导致
SUCCESS
状态的process_projectfile
作业。 - 已存在处于
PENDING
状态的delta_apply
作业。
解决问题¶
A delta_apply
job might result in FAILED
status.
Check the non-exhaustive list of causes below:
- QGIS工程中使用的至少一个在线数据库 (PostGIS/WFS) 重置了连接。
- 工程太大,作业无法运行。
- 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.
- Navigate to the "Changes" section.
- Filter the changes with the "CONFLICT" status.
- For each conflicted change, select it and set the status to "Re-apply" from the "Action" dropdown menu, alternatively if all the new changes are in conflict you can choose in the last conflicted change and select "Re-apply this and newer changes".
- Check the details of changes in the conflict and click "Save All" at the end of the page.
在QFieldCloud中重新应用更改¶
- 单击 我的工程 中的工程名称。
- 转到 更改 部分 (更改按从最新到最旧排序)。
- 查找要重新应用的特定更改。
- 在右侧的 动作 列中,单击下拉列表。
-
选择所需的动作以重新应用更改。
- 重新应用特定更改:如果需要重新应用特定的更改,请选择要重新应用的每个更改,然后单击 重新应用 。
- 重新应用最近的更改:如果希望重新应用对工程所做的最新修改,请确定要恢复的初始更改,然后选择 重新应用此更改和更新的更改 。
最后,单击 全部保存 按钮。
作业日志疑难解答¶
运行作业时,通常可以在日志中找到一个名为 "检查工程图层" 的步骤,该步骤将输出一个表,其中包含所有工程图层及其所处的状态。
可能的状态为:
- ok - 该图层在QField云正确加载。
- invalid_dataprovider - 图层的数据提供程序无效。通常,附加信息显示在 "提供程序摘要" 中。
- invalid_layer - 这种错误应该很少发生。数据加载正确,但由于某些原因,QGIS报告该图层无效。
无法连接到服务 "{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.
无法连接到主机 "{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.
无法连接到主机 "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.
文件 "{FILENAME}
" 丢失。¶
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.