Describe the problem/error/question
Hello, I recently encountered an issue after unintentionally updating my n8n instance from an older version that supported MySQL to a newer version that has dropped support for MySQL. Realizing the issue, I manually downgraded back to the older version and created backups for credentials and workflows.
I then decided to upgrade again, but this time I switched to using Postgres as my database. However, after making this switch and updating, I’m now facing some error messages that I’m unable to resolve.
I have shared my Docker Compose file below for reference. I have commented out the MariaDB settings and updated the settings to use Postgres. However, I’m unsure if I’ve made the correct changes or if there’s something I’ve missed that’s causing these errors.
I would appreciate any guidance or suggestions on how to resolve these errors and successfully run n8n with Postgres. Thank you in advance for your help.
What is the error message (if any)?
2023-07-04T11:37:37.722Z | warn | License manager not initialized “{ file: ‘License.js’, function: ‘isFeatureEnabled’ }”
2023-07-04T11:37:37.727Z | error | Last session crashed “{ file: ‘CrashJournal.js’, function: ‘init’ }”
2023-07-04T11:37:47.940Z | debug | Lazy Loading credentials and nodes from n8n-nodes-base “{\n credentials: 317,\n nodes: 422,\n file: ‘DirectoryLoader.js’,\n function: ‘loadAll’\n}”
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Share the output returned by the last node
Information on your n8n setup
- **n8n version: 0.234.0- Database (default: mariaDB => Postgres):
- **n8n EXECUTIONS_PROCESS setting (default: own, main):default
- **Running n8n via (Docker, npm, n8n cloud, desktop app):docker
- **Operating system: docker
Docker Compose:
version: ‘3.8’
volumes:
db_storage:
n8n_storage:
redis_storage:
shared-files:
x-shared:
&shared
restart: unless-stopped
environment:
- QUEUE_BULL_REDIS_HOST=redis
- QUEUE_HEALTH_CHECK_ACTIVE=true
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=postgres
- DB_POSTGRESDB_USER=n8n
- DB_POSTGRESDB_PASSWORD=n8npassword
#- DB_TYPE=mariadb
#- DB_MYSQLDB_HOST=db
#- DB_MYSQLDB_PORT=3306
#- DB_MYSQLDB_DATABASE=${MARIADB_DATABASE}
#- DB_MYSQLDB_USER=${MARIADB_USER}
#- DB_MYSQLDB_PASSWORD=${MARIADB_PASSWORD}
- N8N_HOST=crm.tribus-business.at
- N8N_EMAIL_MODE=smtp
- N8N_SMTP_HOST=192.168.1.220
- N8N_SMTP_PORT=25
- [email protected]
- N8N_SMTP_PASS=.connect2023
- N8N_SMTP_SSL=false
- WEBHOOK_URL=http://crm.tribus-business.at/
- NODE_OPTIONS=–max-old-space-size=8192
- N8N_DEFAULT_BINARY_DATA_MODE=filesystem
- EXECUTIONS_MODE=queue
- N8N_LOG_LEVEL=debug
- DB_LOGGING_ENABLED=true
- DB_LOGGING_OPTIONS=all
links:
- db
- redis
volumes:
- n8n_storage:/home/node/.n8n
- shared-files:/home/tribus/n8n/files
depends_on:
redis:
condition: service_healthy
db:
condition: service_healthy
services:
#db:
#image: mariadb:10.7
#restart: unless-stopped
#environment:
#- MARIADB_ROOT_PASSWORD
#- MARIADB_DATABASE
#- MARIADB_USER
#- MARIADB_PASSWORD
#- MARIADB_MYSQL_LOCALHOST_USER=true
#volumes:
#- db_storage:/var/lib/mysql
#healthcheck:
#test: “/usr/bin/mysql --user=${MARIADB_USER} --password=${MARIADB_PASSWORD} --execute ‘SELECT 1;’”
#interval: 10s
#timeout: 5s
#retries: 10
db:
image: postgres:11
restart: unless-stopped
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
- POSTGRES_NON_ROOT_USER
- POSTGRES_NON_ROOT_PASSWORD
volumes:
- db_storage:/var/lib/postgresql/data
- ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
healthcheck:
test:
[
‘CMD-SHELL’,
‘pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}’
]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:6-alpine
restart: always
volumes:
- redis_storage:/data
healthcheck:
test: [ ‘CMD’, ‘redis-cli’, ‘ping’ ]
interval: 5s
timeout: 5s
retries: 10
n8n:
<<: *shared
image: n8nio/n8n:latest
command: /bin/sh -c “n8n start --tunnel”
ports:
- 5678:5678
n8n-worker:
<<: *shared
image: n8nio/n8n:latest
command: /bin/sh -c “sleep 5; n8n worker”
depends_on:
- n8n
filebrowser:
image: filebrowser/filebrowser
restart: unless-stopped
volumes:
- shared-files:/srv
- /home/tribus/filebrowser/filebrowser.db:/database.db
ports:
- 10000:80