datalens-tech/datalens

Won't start after update

Opened this issue · 4 comments

Hi, I've just updated Datalens and it won't correctly start after update. GUI opens but w/o projects with:
An unexpected error has occurred. Try to refresh the page in a few moments.
ECONNREFUSED
{
"title": "Error",
"description": "An unexpected error has occurred. Try to refresh the page in a few moments."
}

Also found in startup logs:
datalens-pg-us |
datalens-pg-us | PostgreSQL Database directory appears to contain a database; Skipping initialization
datalens-pg-us |
datalens-pg-us | 2024-12-11 09:14:26.300 UTC [1] FATAL: database files are incompatible with server
datalens-pg-us | 2024-12-11 09:14:26.300 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version 13, which is not compatible with this version 16.6.
datalens-pg-demo-connection |
datalens-pg-demo-connection | PostgreSQL Database directory appears to contain a database; Skipping initialization
datalens-pg-demo-connection |
datalens-pg-demo-connection | 2024-12-11 09:14:26.441 UTC [1] FATAL: database files are incompatible with server
datalens-pg-demo-connection | 2024-12-11 09:14:26.441 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version 13, which is not compatible with this version 16.6.
datalens-pg-us exited with code 1
datalens-pg-demo-connection exited with code 1

Seems could be problem because of new PostgreSQL?
Pls. find startup log attached.
Many thanks in advance.
dl-startup-log-11dec24-1.txt

@sgialexa, hi! Could you provide us more details about version of release https://github.com/datalens-tech/datalens/releases ?

It's the latest - I've updated today with
docker compose down
git pull
docker compose up

Hi @sgialexa, you can downgrade your postgres version in compose file to version 13 for pg-us container or make upgrade

// stop compose deployment
docker compose stop

// run old postgres server
docker run -d --name pg-us-old -v ./metadata:/var/lib/postgresql/data postgres:13-alpine

// make dump
docker exec pg-us-old pg_dump -d us-db-ci_purgeable -U us > dump.sql

// stop and remove old postgres server
docker stop pg-us-old && docker rm pg-us-old

// mv current postgres metadata to different folder
mv ./metadata ./metadata-old

// up compose deployment
docker compose up -d

// restore backup to new version from dump
docker compose exec pg-us pg_restore -U us -v -d us-db-ci_purgeable < ./dump.sql

// up all compose services
docker compose up -d

Please do not remove ./metadata-old folder before you check the entire system after recovery

Hi @goshander, unfortunately this doesnot work. I've got only OpensourceDemo in Workbooks and Collections.
I had to remove containers and images because of
Error response from daemon: Conflict. The container name "/datalens-pg-us" is already in use by container "7629ea1973f4adad3d0786c5767f03a242aecde74d538625524a698728eec6b9". You have to remove (or rename) that container to be able to reuse that name.
So basically I started old postgress server, created a dump, git pull, docker compose up (got error), removed all containers and images, docker compose up, restore db backup, docker compose up...