geonode
geonode copied to clipboard
db healthcheck fails with 'FATAL: role "root" does not exist'
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
- clone geonode at 4.x
- docker-compose build
- docker-compose up
- 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'.
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.
@gannebamm I can confirm this with geonode project. @Inogeo removing volumes is no option. Think of all the people who need to migrate.
@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 ...
@gannebamm after you've fixed the health check, please try the following:
- log in with your admin account
- Visit the splash page that should load now.
- upload test data
- log out
- visit the splash page as anonymous
It should load now. Can you confirm? (If so, this behavior is really strange and should be fixed)
@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
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 I used your more generic healthcheck: #9855