mathesar-foundation / mathesar

Web application providing an intuitive user experience to databases.
https://mathesar.org/
GNU General Public License v3.0
2.29k stars 317 forks source link

Constant timeouts - unable to access my Mathesar (Docker) site #3464

Open amca01 opened 4 months ago

amca01 commented 4 months ago

Thanks to the help of the developers, I've got Mathesar running as a Docker container, using SWAG as a reverse proxy (this is basically nginx plus a few other nice things). However, although the site is live (I can ping it) and I have been able to access it once or twice, most of the time it just hangs until I get a timeout error.

The Docker logs contain lots of:

[2024-02-28 21:05:33 +0000] [53] [INFO] Booting worker with pid: 53
[2024-02-28 21:06:05 +0000] [8] [CRITICAL] WORKER TIMEOUT (pid:53)
[2024-02-28 21:06:05 +0000] [53] [INFO] Worker exiting (pid: 53)
[2024-02-28 21:06:06 +0000] [71] [INFO] Booting worker with pid: 71
[2024-02-28 21:06:38 +0000] [8] [CRITICAL] WORKER TIMEOUT (pid:71)
[2024-02-28 21:06:38 +0000] [71] [INFO] Worker exiting (pid: 71)
[2024-02-28 21:06:38 +0000] [89] [INFO] Booting worker with pid: 89
[2024-02-28 21:07:10 +0000] [8] [CRITICAL] WORKER TIMEOUT (pid:89)
[2024-02-28 21:07:10 +0000] [89] [INFO] Worker exiting (pid: 89)

which might be due to gunicorn. But I don't know what is causing this behaviour, or how to stop it. I was able to access the superuser creation dialog, but having entered a username and password, everything just stopped. Sometime later I tried the site again and this time was greeted with a login page. However, once entering my details, again the site hanged until I got a timeout error. I've restarted the container several times, which I shouldn't have to do.

Anyway, I'd be happy to know what's causing this behaviour, and how it can be overcome!

--

Note also I've sent this as an email to the developers, and to the Mathesar and selfhosted subreddits. I'm not sure what's the best place to ask for help. I appreciate that this is a relatively new project, with a small development team and probably not a lot of users as yet. But everything about it promises well, and I'd at least like to have it up and running so that I can take it for a good solid test-run!

Many thanks indeed, Alasdair

seancolsen commented 4 months ago

Thanks for reporting this, @amca01. We'll have one of our maintainers look into it and see how we can help.

mathemancer commented 4 months ago

Good to see you here, @amca01 ! This is actually the most visible place to ask for help, and hopefully any solutions we discover can help other users.

amca01 commented 4 months ago

Thank you all for your consideration. In fact I got to the stage where I was able to login and attempt to create a database schema, and then upload a CSV file into it. However, the upload (about 2.3 Mb, with all fields as text) got to 98% then stopped. And this morning it seems I can't access the site again. Usually restarting the mathesar Docker container fixes the timeout issue - but only temporarily, until it happens again!

As another issue, I notice that the docker compose file doesn't make use of bind mounts. These provide a nice connection between the container and the host filesystem, and I've always liked to see what files the container is operating on. Should I add some bind mounds to either the mathesar or mathesar_db containers?

Thanks everybody again, Alasdair

kgodey commented 4 months ago

@amca01 I think at this point it might be fastest to set up a call to debug, I sent you an email with some availability.

amca01 commented 4 months ago

(I'll respond to your email in a minute!) I was probably wrong about the bind mounts, but what I tried was to create bind mounts with full directory address, as in:

volumes:
      - /home/amca/Docker/mathesar/mathesar_static:/code/static
      - /home/amca/Docker/mathesar/mathesar_media:/code/media

and similarly for the mathesar_db container. This means there are writable directories for mathesar to use, and indeed the mathesar-static directory has had a lot of stuff written in to it. However, the timeout error persists.

kgodey commented 2 months ago

@amca01 This issue has been resolved for you, right?