docker-compose - postgres health check - user does not exist error

10 views
Skip to first unread message

Richard Marshall

unread,
Dec 9, 2025, 4:46:23 AM (5 days ago) Dec 9
to Numbas Users
Hi All.

I've just been installing a second Numbas Installation, and have encountered postgres container errors along the lines of user 'postgres' does not exist.

I believe the postgres healthcheck user should be changed from postgres to numbas_lti:

Here is a snippet from the  docker-compose.yml from the numbas git repo.:

<code>
postgres:
......
    healthcheck:
      test: "pg_isready -U postgres"
......
</code>

I believe this should be changed to this?

<code>
healthcheck:
      test: ["CMD-SHELL", "pg_isready -U numbas_lti -d numbas_lti"] 
</code>

Richard Marshall

unread,
Dec 9, 2025, 5:00:36 AM (5 days ago) Dec 9
to Numbas Users
The following is in my humble opinion, given learning Docker only recently, and with the benefit of asking around......


In addition:

<code>
numbas-setup:
 ......
    depends_on:
      - postgres
      - redis
.....
  Daphne:
.....
    depends_on:
      - postgres
      - redis
 .....
  huey:
  .....
    depends_on:
      - postgres
      - redis
   </code>

I believe this is slightly better?

<code>
numbas-setup:
.....
    depends_on:
      postgres:                          
        condition: service_healthy       
      redis:                             
        condition: service_started       
   .....
  daphne:
 .....
    depends_on:
      postgres:                          
        condition: service_healthy       
      redis:                             
        condition: service_started       
.....
  huey:
.....
      postgres:
        condition: service_healthy
      redis:
        condition: service_started
.....
</code>

Richard Marshall

unread,
Dec 9, 2025, 10:14:15 AM (4 days ago) Dec 9
to Numbas Users
further info - the above was after a fresh install - postgres user not existing in postgres container, just numbas_lti, hence health check failing with that user.   2 hours later, and  after further work and a rebuild of the container I now find postgres user now exists, and numbas_lti doesn't.  So I am thoroughly confused.

Richard Marshall

unread,
Dec 9, 2025, 10:22:45 AM (4 days ago) Dec 9
to Numbas Users
I believe I now understand.  postgres is the only linux user in the postgres container, and numbas_lti is the only role within the postgres application.  Hence the healthcheck needs to connect to the postgres app. as numbas_lti as I originally believed.
Reply all
Reply to author
Forward
0 new messages