Some frequently asked questions and answers. Now as part of the Community so they can easily be updated.
Database Related
Coallation Error
DETAIL: The database was created using collation version X.YZ, but the operating system provides version X.YZ
HINT: Rebuild all objects in this database that use the default collation and run ALTER DATABASE recipes REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
The postgres coallation changed trough postgres updates over time. Run the command as suggested in the error and it should be fixed. (GitHub Issue).
Major Version Error
When upgrading Postgresql major versions (e.g. from 17 to 18) you cannot just update the container. You will need to dump and reimport the data. There are plenty tutorials online (1, 2, 3) for this but the basic steps are:
-
use
pg_dumpallto dump your database into SQL (for Dockerdocker-compose exec -T <postgres_container_name> pg_dumpall -U <postgres_user_name> -f /path/to/dump.sql) -
stop the DB / down the container
-
move your postgres directory in order to keep it as a backup (e.g.
mv postgres postgres_old) -
update postgres to the new major version (for Docker just change the version number and pull)
-
start the db / up the container (do not start tandoor as it will automatically perform the database migrations which will conflict with loading the dump)
-
if not using docker, you might need to create the same postgres user you had in the old database
-
load the postgres dump (for Docker
'/usr/local/bin/docker-compose exec -T <postgres_container_name> psql -U <postgres_user_name> <postgres_database_name> < /path/to/dump.sql)
General Errors
usersession_usersession
null value in column “ip” of relation “usersessions_usersession” violates not-null constraint
Tandoor has the ability to log the different sessions your user creates. For this it needs to have certain request headers to work. Most commonly the following header is missing. (GitHub Issue)
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;