Postgres15 Unsupported? permission denied for schema public

My version of HedgeDoc is: 1.9.6

What I expected to happen:

PostgreSQL15 is supported and works like other Postgres versions.

What actually happened:

After upgrading my database to Postgres15, it seems Hedgedoc cannot connect to the database properly.
During start I’m getting following error :

2022-11-18T21:38:00.375Z warn: 	Session secret not set. Using random generated one. Please set `sessionSecret` in your config.json file. All users will be logged out.
2022-11-18T21:38:02.264Z error: 	permission denied for schema public
2022-11-18T21:38:02.264Z error: 	Database migration failed.
This can be the result of upgrading from quite old versions and requires manual database intervention.
See https://docs.hedgedoc.org/guides/migration-troubleshooting/ for help.
Exiting…

My database connection URL:

postgresql://hedgedoc:<PASSWORD>@postgres.postgres.svc.cluster.local:5432/hedgedoc

I already tried:

Several postgres commands after googling this error, like:

GRANT USAGE ON SCHEMA public TO hededoc;

I just tried spinning up a fresh HedgeDoc instance using the postgres:15-alpine Docker image and everything worked. So I don’t think HedgeDoc has any problem running with Postgres 15.

To fix your error message, I would also have used GRANT USAGE, so please double-check you didn’t mistype anything (your command above has hededoc instead of hedgedoc).

1 Like

At least a good message: Technically it should work.

I will try out some more commands and configs. (the typo was only in the post)

Alright, after investigating a lot: Hedgedoc supports Postgres 15 like @davidmehren mentioned.

The issues occurs due to Postgres15 changes and the solution described here works: sql - Postgres 15. permission denied for schema public - Stack Overflow