Hi,
I have a development version of Aleph running, now trying to setup a production release. However, after setting things up, I’m seeing a ERROR: relation "role" does not exist at character 33
with further explanation:
postgres_1 | 2024-06-17 10:49:04.433 UTC [29] STATEMENT: SELECT role.id AS role_id
postgres_1 | FROM role
postgres_1 | WHERE role.deleted_at IS NULL AND role.foreign_id = 'guest' ORDER BY role.id ASC
postgres_1 | LIMIT 1
This is at the very beginning of the Aleph startup, i.e. first time Postgres start and right after LOG: database system is ready to accept connections
As the development version runs PG15, I also tried that - but nope, the image isn’t compatible so that’s not the problem. So why is role
missing and how can I add it?
Hi Valentyn
Are you able to access the PG and view the Aleph DB, can you confirm whether the role table has been created?
Nope, the DB exists, but it is empty.
Follow-up: /docker-entrypoint-initdb.d/ is an empty folder.
When I’ve had issues like this in the past it’s usually been related to permissions or connection issues when running the setup. A few things I’d try:
- Remove the empty DB and rerun setup
- Verify that the credentials for PG are working as intended
- Try removing the docker images and starting from scratch
Where would the docker-entrypoint-initdb.d come from? Because that seems to be the culprit (i.e. if that’s empty - no surprise that there’s an empty DB, right?)
Did you run the DB migration scripts (make upgrade
, see Installing Aleph – Aleph)?
No I didn’t - because I tried to setup a production deployment: Installing Aleph – Aleph
In that case did you run this:
Before Aleph can process any requests or data, you need to make sure it sets up the database and search index correctly by executing an upgrade:
docker-compose run --rm shell aleph upgrade
?
1 Like
Oops, I didn’t
My bad. Thanks, it works now. Should have RTFM. I have proposed a change to the docs to reflect the right order of commands (i.e. docker-compose up; docker-compose run --rm shell aleph upgrade
and afterwards the possible curl and/or docker-compose down commands).
1 Like
I’m glad you sorted it out and thanks for the proposal to update our docs, that’s always great!
1 Like