Onpremise: Upgrade from 9.1.2 to 10: Organization avatar errors

Created on 5 Jun 2020  路  2Comments  路  Source: getsentry/onpremise

Hello,

We upgraded from Sentry 9.1.2 to 10 and now we started receiving internal Sentry errors regarding organization avatars not being found, but only for some organizations.

IOError /organization-avatar/{avatar_id}/

[Errno 2] No such file or directory: u'/data/files/57/f4c4/55e26440d2b73ad62ff29fb925'
sentry/models/file.py in getfile at line 299

The file exists at /data/57/f4c4/55e26440d2b73ad62ff29fb925, not at /data/files/57/f4c4/55e26440d2b73ad62ff29fb925.

root@sentry:~# docker exec -it sentry_onpremise_web_1 bash
root@c3c8217b56fc:/# cd /data/
root@c3c8217b56fc:/data# ls -l
total 412
[...truncated...]
drwxr-xr-x 4 sentry root 4096 Sep  6  2019 f3
drwxr-xr-x 3 sentry root 4096 Aug  1  2019 f4
drwxr-xr-x 3 sentry root 4096 Sep  6  2019 f7
drwxr-xr-x 3 sentry root 4096 Aug  1  2019 f9
drwxr-xr-x 3 sentry root 4096 Sep  5  2019 fa
drwxr-xr-x 3 sentry root 4096 Sep  6  2019 fd
drwxr-xr-x 2 sentry root 4096 Jun  5 07:04 files

How can we fix this ? Should we copy all the other folders inside files ? Or maybe run some migration script ?

Most helpful comment

Fixed it by running the migration manually:

root@sentry:~# docker exec -it sentry_onpremise_web_1 bash
root@c3c8217b56fc:/# mkdir -p /tmp/files; mv /data/* /tmp/files/; mv /tmp/files /data/files; chown -R sentry:sentry /data
root@c3c8217b56fc:/# cd /data/
root@c3c8217b56fc:/data# ls -l
total 4
drwxr-xr-x 105 sentry sentry 4096 Jun  5 10:00 files

All 2 comments

Looking through the upgrade logs, It seems that the file migration did not run for some reason.

This log is missing:
https://github.com/getsentry/onpremise/blob/master/install.sh#L225

Fixed it by running the migration manually:

root@sentry:~# docker exec -it sentry_onpremise_web_1 bash
root@c3c8217b56fc:/# mkdir -p /tmp/files; mv /data/* /tmp/files/; mv /tmp/files /data/files; chown -R sentry:sentry /data
root@c3c8217b56fc:/# cd /data/
root@c3c8217b56fc:/data# ls -l
total 4
drwxr-xr-x 105 sentry sentry 4096 Jun  5 10:00 files
Was this page helpful?
0 / 5 - 0 ratings