[Bug]: role "affine" does not exist
Error Message and Logs
Seeing this in the logs of the postgres container for affine:
FATAL: role "affine" does not exist
I'm not sure if it's new or it's always been doing that.
The app seems to be working ok.
My compose file is the same as this one.
Maybe the same as this problem?
@LeoMartinDev ?
Coolify Version
v4.0.0-beta.389
Are you using Coolify Cloud?
No (self-hosted)
Operating System and Version (self-hosted)
Ubuntu 24
Same issue, I edited the compose file to use the canary release and it's still happening.
Same, used also the compose file from the official repository, no luck deploying, but locally it worked like a charm
Also happening for me. Notably the app seems to work, but I get those messages on the logs of the postgres container.
Same here, but the app is not working but it responds with "no available server" 🤷♂️
Same here, but the app is not working but it responds with "no available server" 🤷♂️
Since I'm also a total noob maybe you edited the domain name and removed the port; you need to keep the port. (e.g., https://your-domain.com:3000 - I think it was port 3000.) If that's not it, check logs.
Same here, but the app is not working but it responds with "no available server" 🤷♂️
Since I'm also a total noob maybe you edited the domain name and removed the port; you need to keep the port. (e.g.,
https://your-domain.com:3000- I think it was port 3000.) If that's not it, check logs.
Nobe, that did not help.
Hey, I finally got this working on my Coolify instance. I decided not to use Coolify's compose for Affine and opted for the one from their website. Create a new resource in Coolify and choose "Empty Docker Compose". With this configuration I can just go to https://my-domain.com and access Affine.
Here's my docker-compose and example env vars:
compose.yml
name: affine
services:
affine:
image: 'ghcr.io/toeverything/affine-graphql:${AFFINE_REVISION:-stable}'
container_name: affine_server
ports:
- '${PORT:-3010}:3010'
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
affine_migration:
condition: service_completed_successfully
volumes:
- '~/.affine/self-host/storage:/root/.affine/storage'
- '~/.affine/self-host/config:/root/.affine/config'
env_file:
- .env
environment:
- REDIS_SERVER_HOST=redis
- 'DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_DATABASE:-affine}'
restart: unless-stopped
affine_migration:
image: 'ghcr.io/toeverything/affine-graphql:${AFFINE_REVISION:-stable}'
container_name: affine_migration_job
volumes:
- '${UPLOAD_LOCATION}:/root/.affine/storage'
- '${CONFIG_LOCATION}:/root/.affine/config'
command:
- sh
- '-c'
- 'node ./scripts/self-host-predeploy.js'
env_file:
- .env
environment:
- REDIS_SERVER_HOST=redis
- 'DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_DATABASE:-affine}'
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
redis:
image: redis
container_name: redis
healthcheck:
test:
- CMD
- redis-cli
- '--raw'
- incr
- ping
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
postgres:
image: 'postgres:16'
container_name: postgres
volumes:
- '~/.affine/self-host/postgres/pgdata:/var/lib/postgresql/data'
environment:
POSTGRES_USER: '${DB_USERNAME}'
POSTGRES_PASSWORD: '${DB_PASSWORD}'
POSTGRES_DB: '${DB_DATABASE:-affine}'
POSTGRES_INITDB_ARGS: '--data-checksums'
POSTGRES_HOST_AUTH_METHOD: trust
healthcheck:
test:
- CMD
- pg_isready
- '-U'
- '${DB_USERNAME}'
- '-d'
- '${DB_DATABASE:-affine}'
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
.env
AFFINE_SERVER_EXTERNAL_URL=https://my-domain.com
AFFINE_SERVER_HOST=https://my-domain.com
AFFINE_SERVER_HTTPS=true
DB_DATABASE=affine
DB_PASSWORD=my_db_password
DB_USERNAME=my_db_username
I had the same issue. But fixed it by:
- Enabling the checkbox
Build Variable?on every environment variable
Health check in original template point to role that does not exist:
pg_isready -U affine
Should be:
pg_isready -U ${SERVICE_USER_POSTGRES}