Sentry v10 DB upgrade issue


Our upgrade didn’t seem to work so i dove into the scripts.
The old docker-compose looked like:

restart: unless-stopped
image: postgres:9.5
  - /data/postgres:/var/lib/postgresql/data

So i tried rewriting this part from the

docker run --rm \
-v /data/postgres:/var/lib/postgresql/9.5/data \
-v sentry-postgres-new:/var/lib/postgresql/9.6/data \

But when i open a shell on this container (ran the command without --rm),
the /var/lib/postgresql/9.5/data folder doesn’t contain the /data/postgres data it’s empty.

So i think no data is being converted to postresql 9.6

Anyone have an idea how to solve this issue?

Found the mistake, how stupid it was…

After the upgrade failed i rolled back the server and tried to manually upgrade the database using the modified path.

But since i rolled back the server, 9.1.2 was up and running again so the database was locked.

@Scale - so you’re good now? I checked the code and your setup seems to be quite old. That said the command you shared makes sense to me, except you can probably just do sentry-postgres instead of sentry-postgres-new as you don’t have sentry-postgres already.

Yep, We are up and running.
Only issue so far (which is not important) is that Avaters seem broken.

Do you mean the avatars don’t work at all or they are not migrated from the old installation?

Both, old ones seem broken.
Trying to upload another doesn’t work.

Ah, looks like you have some permission issues. Can you share your logs from the upgrade? Also running docker run --rm -v sentry-data:/data alpine ash -c \ "chown -R sentry:sentry /data" should fix it.

Are the upgrade logs stored somewhere? I don’t have the putty session open anymore.

The command didn’t work:
docker run --rm -v sentry-data:/data alpine ash -c \ "chown -R sentry:sentry /data"
It doesn’t know the sentry account.

But made it work by running a shell on the web container
docker exec -it CONTAINER_ID /bin/bash
followed by chown -R sentry:sentry /data

1 Like

My bad, I should have used numerical ids. I’ll fix this, thanks a lot for reporting @Scale.