geonode icon indicating copy to clipboard operation
geonode copied to clipboard

db healthcheck fails with 'FATAL: role "root" does not exist'

Open gannebamm opened this issue 2 years ago • 6 comments

Expected Behavior

The db healthcheck (https://github.com/GeoNode/geonode/blob/master/docker-compose.yml#L138) will return meaningful insights.

Actual Behavior

The healthcheck fails with FATAL: role "root" does not exist

Steps to Reproduce the Problem

  1. clone geonode at 4.x
  2. docker-compose build
  3. docker-compose up
  4. take a look at the db log

Specifications

  • GeoNode version: 4.x ()
  • Installation method (manual, GeoNode Docker, SPCGeoNode Docker): GeoNode Docker
  • Platform: Ubuntu
  • Additional details:

test: "pg_isready -U postgres -d geonode" could do the trick since it will use the postgres user and pings the database 'geonode'.

gannebamm avatar Aug 09 '22 16:08 gannebamm

I am not sure it is a proper fix, but did you try removing all docker volumes before installing geonode ? It looks to be working on my side. I have test: "pg_isready -d geonode" working.

Inogeo avatar Aug 10 '22 14:08 Inogeo

@gannebamm I can confirm this with geonode project. @Inogeo removing volumes is no option. Think of all the people who need to migrate.

t-book avatar Aug 12 '22 14:08 t-book

@gannebamm this fixes the healthcheck in my tests:

    healthcheck:
      test: "pg_isready -d postgres -U postgres"

but still the startpage is only showing a spinning wheel ...

t-book avatar Aug 12 '22 14:08 t-book

@gannebamm after you've fixed the health check, please try the following:

  1. log in with your admin account
  2. Visit the splash page that should load now.
  3. upload test data
  4. log out
  5. visit the splash page as anonymous

It should load now. Can you confirm? (If so, this behavior is really strange and should be fixed)

t-book avatar Aug 12 '22 15:08 t-book

@gannebamm this fixes the healthcheck in my tests:

    healthcheck:
      test: "pg_isready -d postgres -U postgres"

but still the startpage is only showing a spinning wheel ...

Which will do the trick but in production we should check the geonode dbs, shouldn't we?

The start page issue is not related with this issue. @mattiagiupponi has already provided a fix in his pr #9841

gannebamm avatar Aug 12 '22 15:08 gannebamm

Well I would say the reason for the healthcheck is to see if the database is up not if the geonode database exists, as postgres always has the db postgres it is IMHO more generic. But sure if there is a nice way to set the geonode db, this would work as well

https://github.com/GeoNode/geonode/pull/9841 cool!

t-book avatar Aug 12 '22 15:08 t-book

@t-book I used your more generic healthcheck: #9855

gannebamm avatar Aug 15 '22 14:08 gannebamm