Gramps web sync - insufficient permissions

I have just installed the gramps web sync addon on Win10, trying to connecting to my gramps web instance I get the following error message:

Server authorization error: insufficient permissions.

I have tried this with an owner account and an admin account. I also get the same error if the password is either right or wrong.

I think my versions of Gramps and Gramps Web compatable, what am I doing wrong?

Windows10: Gramps Web:
GRAMPS: AIO64-5.2.2-r1-f905d14 Gramps 5.2.3
Python: 3.11.8 Gramps Web API 2.5.2
BSDDB: 6.2.9 (6, 0, 30) Gramps Web Frontend 24.10.0
sqlite: 3.45.2 (2.6.0) Gramps QL 0.3.0
LANG: en_GB.UTF-8 Sifts 1.0.0
OS: Windows locale: en
multi-tree: false
task queue: true
OCR: true
chat: false

Hi, please share the Gramps Web logs (docker compose logs grampsweb) for the relevant time period.

Log file can be found here

I attempted to connect with gramps web sync just before collecting this log file, there appears to be no mention of the connection in the logs however.

This stands out in the log but I can’t say for sure because I work only with SQLite. As a test you could use different Gramps Family Tree which is stored using SQLite as opposed to BSDDB.

grampsweb | ValueError: Database backend 'bsddb' of tree 'Gramps Web' not supported.

Indeed this error means that something is very wrong with your set up.

Is Gramps Web actually working at all?

This is a file I got from a gramps backup, is there a sample tree I could use that we know to be void of any errors?

Gramps Web is up and appears functional. I can go to the various tree types, look at different people and I have added a test person.

Where should I start to diagnose the error? One of the first things I want to do is use a sample tree, if one exists, to see if it’s a import file issue.

Is there a way to convert my database from BSDDB to SQLite?

BSDDB seems to be from before Gramps 5.1 and has it’s own flaws, one glaring one is that it can easily corrupt.

https://www.gramps-project.org/wiki/index.php/Database_Backends

Suprised that while not supported I can see everyone, but I have recently noticed some issues with it that was going to be my next port of call. But this could be one and the same issue with unsupported DB type. I have one person who married, had kids, divorced and remarried. I see this person twice in the “Relationship Graph”. Not sure if this is intended.

Gramps Web does not work with BSDDB. So if Gramps Web is up and functional, you must have a SQLite database.

Right, so I’m still a bit stuck here.

I removed all Gramps volumes on Docker to start fresh. Once passed the first time run screen I added a single person through Gramps Web to an empty database, I did not import anything. On Desktop I loaded in the example.gramps file provided with Gramps and attempted to use the gramps web sync.

I am still faced with the same error:

Server authorization error: insufficient permissions.

The gramps web logs are better this time, having not used my own, seemingly broken, database. Still not indication there was a connection attempt or anything that I can use to trace my error.

My nginx-proxy logs also show nothing for the attempted connection using gramps web sync, they do log when I connect to gramps web via a browser. Is there any other means of debugging this?

You can add the following to the grampsweb docker compose service to enable debug logging:

command: "python3 -O -m gunicorn -w 2 -b 0.0.0.0:5000 --timeout 120 --limit-request-line 0 --preload --log-level debug gramps_webapi.wsgi:app"

You should see a request to /api/token. The error you’re getting is only shown when the request returns status 403.

Thank you for the command for the dockerfile.

I’m not seeing anything come up in docker compose logs grampsweb or docker compose logs nginx-proxy. Could something else be blocking the access before it reaches the server?

I also tried docker compose up (without -d) and still not showing anything in logs when i try to connect via gramps web sync.

Would having the url help?

A typo in the URL might also explain it. It should start with https://.

I have https://gramps.malakan.co.uk as the Server URL

I’m still getting the same issue and I’m not observing any logs relevant to the connection.

I could give you access my gramps instance if you think that could help?

You might want to use private messaging for that.

No, not needed, because the issue is most likely on the desktop side. I am not using Windows, which makes it difficult. Which version of the addon are you running?

The addon version is 1.1.2

In an attempt to see if it would help I am also now running the latest Gramps version on Windows 10:

GRAMPS: AIO64-5.2.3-r1-aa03f5a 
Python: 3.11.9 
BSDDB: 6.2.9 (6, 0, 30) 
sqlite: 3.46.0 (2.6.0)
LANG: en_GB.UTF-8
OS: Windows

Do you still get Server authorization error: insufficient permissions. or a different error? As you can see here this error can only happen if the server responds with 403, and if it does respond, it means you reached it and something must show up in the logs if you enabled debug logging.

Please also look at the nginx-proxy logs, if you’re using that.

Yes, I see the same error still.

I have looked at the proxy logs and don’t see anything, I have looking into enabling more logging on nginx but still don’t see the connection attempts. I’m also not versed in nginx so am still looking into the logging.

I do see a response from a test container and from grampsweb itself, just not the 403 error.

helloworld | [::ffff:172.19.0.4]:44146: response:200
grampsweb | [2024-12-05 09:29:25 +0000] [14] [DEBUG] GET /
grampsweb | [2024-12-05 09:29:25 +0000] [13] [DEBUG] GET /lang/en.json
grampsweb | [2024-12-05 09:29:25 +0000] [14] [DEBUG] GET /api/metadata/
grampsweb | [2024-12-05 09:29:25 +0000] [13] [DEBUG] GET /manifest.json
grampsweb | [2024-12-05 09:29:25 +0000] [13] [DEBUG] POST /api/translations/en
grampsweb | [2024-12-05 09:29:25 +0000] [14] [DEBUG] GET /api/users/-/
grampsweb | [2024-12-05 09:29:25 +0000] [14] [DEBUG] GET /api/search/
grampsweb | [2024-12-05 09:29:25 +0000] [13] [DEBUG] GET /api/events/
grampsweb | [2024-12-05 09:29:25 +0000] [14] [DEBUG] GET /api/sources/
grampsweb | [2024-12-05 09:29:27 +0000] [14] [DEBUG] GET /sw.js

What URL did you enter in the host field in the sync addon and under what URL do you access Gramps Web in the browser?