Problem with Gramps Web Sync Addon

Hello,

I have some sync problems since a few weeks and I don’t get the cause. Maybe someone knows what I have to do. I think that the error is on the remote side (GrampsWeb on a private server). How can I debug the origin of the error?

Local:
GRAMPS: 5.2.3
Python: 3.12.3
BSDDB: 6.2.9 (5, 3, 28)
sqlite: 3.45.1 (2.6.0)
LANG: de_DE.UTF-8

GrampsWeb:
Gramps 5.2.4
Gramps Web API 2.8.2
Gramps Web Frontend 25.3.1
Gramps QL 0.3.0
Sifts 1.0.0
locale: de
multi-tree: false
task queue: true
OCR: true
chat: false

Local:
gramps --debug grampswebsync
Fehlersuche einrichten grampswebsync
2025-03-18 18:09:01.409: DEBUG: grampswebsync.py: line 103: Initializing Gramps Web Sync addon.
2025-03-18 18:09:02.827: DEBUG: grampswebsync.py: line 79: Retrieving password for user bjoern
2025-03-18 18:09:02.828: WARNING: grampswebsync.py: line 83: Keyring is not installed, cannot retrieve password.
2025-03-18 18:09:04.880: DEBUG: grampswebsync.py: line 222: Moving to next page from page 0.
2025-03-18 18:09:04.883: DEBUG: grampswebsync.py: line 222: Moving to next page from page 1.
2025-03-18 18:09:09.047: DEBUG: grampswebsync.py: line 222: Moving to next page from page 1.
2025-03-18 18:09:09.885: DEBUG: grampswebsync.py: line 222: Moving to next page from page 1.
2025-03-18 18:09:09.886: DEBUG: webapihandler.py: line 162: Fetching an access token from the server
2025-03-18 18:09:10.008: DEBUG: webapihandler.py: line 162: Fetching an access token from the server
2025-03-18 18:09:10.374: DEBUG: grampswebsync.py: line 222: Moving to next page from page 2.
2025-03-18 18:09:10.380: INFO: grampswebsync.py: line 444: Downloading Gramps XML file.
2025-03-18 18:09:11.076: DEBUG: grampswebsync.py: line 448: Importing Gramps XML file.
100%2025-03-18 18:09:12.152: DEBUG: grampswebsync.py: line 454: Successfully imported Gramps XML file.
2025-03-18 18:09:12.159: INFO: grampswebsync.py: line 458: Comparing local and remote data…
2025-03-18 18:09:12.877: DEBUG: grampswebsync.py: line 222: Moving to next page from page 2.
2025-03-18 18:09:12.878: DEBUG: grampswebsync.py: line 222: Moving to next page from page 2.
2025-03-18 18:09:26.454: DEBUG: grampswebsync.py: line 222: Moving to next page from page 3.
2025-03-18 18:09:26.454: DEBUG: grampswebsync.py: line 222: Moving to next page from page 4.
2025-03-18 18:09:26.455: INFO: grampswebsync.py: line 562: Committing all changes to the databases.
2025-03-18 18:09:26.455: DEBUG: grampswebsync.py: line 567: Committing changes to local database.
2025-03-18 18:09:27.196: DEBUG: webapihandler.py: line 152: Fetching metadata from the server
2025-03-18 18:09:35.569: DEBUG: grampswebsync.py: line 222: Moving to next page from page 4.
2025-03-18 18:09:35.617: DEBUG: grampswebsync.py: line 589: Committing changes to remote database.
2025-03-18 18:09:49.057: ERROR: webapihandler.py: line 273: Server task failed: {‘info’: ‘??? Unknown Error: None’, ‘result’: ‘??? Unknown Error: None’, ‘result_object’: ‘??? Unknown Error: None’, ‘state’: ‘FAILURE’}

Remote:
grampsweb_celery | [2025-03-18 17:01:48,000: INFO/MainProcess] Task gramps_webapi.api.tasks.process_transactions[1dcc83dd-e83e-404f-aa62-76c3aed824a5] received
grampsweb_celery | [2025-03-18 17:02:11,246: ERROR/ForkPoolWorker-1] Task gramps_webapi.api.tasks.process_transactions[1dcc83dd-e83e-404f-aa62-76c3aed824a5] raised unexpected: <HTTPException ‘409: Conflict’>
grampsweb_celery | Traceback (most recent call last):
grampsweb_celery | File “/usr/local/lib/python3.11/dist-packages/celery/app/trace.py”, line 453, in trace_task
grampsweb_celery | R = retval = fun(*args, **kwargs)
grampsweb_celery | ^^^^^^^^^^^^^^^^^^^^
grampsweb_celery | File “/usr/local/lib/python3.11/dist-packages/gramps_webapi/util/celery.py”, line 20, in call
grampsweb_celery | return self.run(*args, **kwargs)
grampsweb_celery | ^^^^^^^^^^^^^^^^^^^^^^^^^
grampsweb_celery | File “/usr/local/lib/python3.11/dist-packages/gramps_webapi/api/tasks.py”, line 454, in process_transactions
grampsweb_celery | abort_with_message(409, “Object has changed”)
grampsweb_celery | File “/usr/local/lib/python3.11/dist-packages/gramps_webapi/api/util.py”, line 716, in abort_with_message
grampsweb_celery | raise exc
grampsweb_celery | werkzeug.exceptions.HTTPException: 409 Conflict: Object has changed
grampsweb_celery | [2025-03-18 17:09:37,125: INFO/MainProcess] Task gramps_webapi.api.tasks.process_transactions[1719df97-095e-4d47-a40b-ec97a249d4e8] received
grampsweb_celery | [2025-03-18 17:09:48,390: ERROR/ForkPoolWorker-1] Task gramps_webapi.api.tasks.process_transactions[1719df97-095e-4d47-a40b-ec97a249d4e8] raised unexpected: <HTTPException ‘409: Conflict’>
grampsweb_celery | Traceback (most recent call last):
grampsweb_celery | File “/usr/local/lib/python3.11/dist-packages/celery/app/trace.py”, line 453, in trace_task
grampsweb_celery | R = retval = fun(*args, **kwargs)
grampsweb_celery | ^^^^^^^^^^^^^^^^^^^^
grampsweb_celery | File “/usr/local/lib/python3.11/dist-packages/gramps_webapi/util/celery.py”, line 20, in call
grampsweb_celery | return self.run(*args, **kwargs)
grampsweb_celery | ^^^^^^^^^^^^^^^^^^^^^^^^^
grampsweb_celery | File “/usr/local/lib/python3.11/dist-packages/gramps_webapi/api/tasks.py”, line 454, in process_transactions
grampsweb_celery | abort_with_message(409, “Object has changed”)
grampsweb_celery | File “/usr/local/lib/python3.11/dist-packages/gramps_webapi/api/util.py”, line 716, in abort_with_message
grampsweb_celery | raise exc
grampsweb_celery | werkzeug.exceptions.HTTPException: 409 Conflict: Object has changed

Not sure whether a problem I had with Web Sync is related to your case, but I experienced strange remote updates.
I couldn’t find the reason, but after running rebuild indexes as well as secondary indexes the Web Sync suddenly worked. Further I also ran ‘docker compose pull’ to update all containers (run with --dry-run first to see what will be updated).
After all this my problems with Web Sync disappeared - unfortunately I cannot pin point exactly what solved the problem.

409 Conflict means that either the object actually changed (somebody edited while you were syncing) or it is a false positive that can be caused by database inconsistencies, which a check & repair might able to fix. This would be the first thing to try.

Check and repair was of course the first thing I tried, on both sides. Unfortunately, this was unsuccessful.

Something can also be moved into the media folder from other places. Could this be the cause?

No, this cannot be the cause.

If your local side is up to date, you can choose “reset remote to local” - in this case the 409 conflicts are ignored.

I think I have an idea how I can fix the data. Therefore, I need to roll back on grampsweb. Is it possible to go back to a revision?

Not right now unfortunately.

Does not right mean, that there will be an option in close future?

You should not rely on specific dates for features. There is a roadmap which includes issue #511.

I haven’t found #511 yet because I only searched in the gramps-web repo. Thanks for pointing me to the issue.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.