[bug] OTP update fails when other files exist #479

Open
opened 2023-02-20 18:25:11 +00:00 by mwadmin · 0 comments

Your setup

OTP

Extra details

No response

Version

2023.02

PostgreSQL version

No response

What were you trying to do?

I have database backups in /opt/akkoma/backup
They are owned by postgres

When running the updater it tries to remove the backups, fails and then quits.
It did however remove everything else, so re-running the command isn't possible.

Workaround to recover would be manually copy the software or recover from backup.

What did you expect to happen?

It should skip files not part of the install.

What actually happened?

It removed the software

Logs

akkoma@forum:~$ ./bin/pleroma_ctl update --branch stable
Downloading the artifact from https://akkoma-updates.s3-website.fr-par.scw.cloud/stable/akkoma-amd64-ubuntu-jammy.zip to /tmp/pleroma.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 19.4M  100 19.4M    0     0  10.5M      0  0:00:01  0:00:01 --:--:-- 10.5M
Unpacking /tmp/pleroma.zip to /tmp
Backing up erlang cookie
Cookie: KQL6T6IHHPXOIOSPNPUYTKIS52KXPCQKJZ3CLWJ2OLY4MDCQTLTA====
Copying files over to /opt/akkoma
Removing files from the previous release
rm: descend into write-protected directory '/opt/akkoma/backup'? y
rm: remove write-protected regular file '/opt/akkoma/backup/akkoma_db_20230220.dump.gz'? y
rm: cannot remove '/opt/akkoma/backup/akkoma_db_20230220.dump.gz': Permission denied
rm: remove write-protected regular file '/opt/akkoma/backup/akkoma_db_20230217.dump.gz'? y
rm: cannot remove '/opt/akkoma/backup/akkoma_db_20230217.dump.gz': Permission denied
rm: remove write-protected regular file '/opt/akkoma/backup/akkoma_db_20230219.dump.gz'? y
rm: cannot remove '/opt/akkoma/backup/akkoma_db_20230219.dump.gz': Permission denied
rm: remove write-protected regular file '/opt/akkoma/backup/akkoma_db_20230218.dump.gz'? y
rm: cannot remove '/opt/akkoma/backup/akkoma_db_20230218.dump.gz': Permission denied
akkoma@forum:~$ ls -la
total 12
drwxr-xr-x 3 akkoma   root 4096 Feb 20 18:11 .
drwxr-xr-x 6 root     root 4096 Feb 20 18:11 ..
drwxr-xr-x 2 postgres root 4096 Feb 20 01:45 backup

Severity

I cannot use it as easily as I'd like

Have you searched for this issue?

  • I have double-checked and have not found this issue mentioned anywhere.
### Your setup OTP ### Extra details _No response_ ### Version 2023.02 ### PostgreSQL version _No response_ ### What were you trying to do? I have database backups in /opt/akkoma/backup They are owned by `postgres` When running the updater it tries to remove the backups, fails and then quits. It did however remove everything else, so re-running the command isn't possible. Workaround to recover would be manually copy the software or recover from backup. ### What did you expect to happen? It should skip files not part of the install. ### What actually happened? It removed the software ### Logs ```shell akkoma@forum:~$ ./bin/pleroma_ctl update --branch stable Downloading the artifact from https://akkoma-updates.s3-website.fr-par.scw.cloud/stable/akkoma-amd64-ubuntu-jammy.zip to /tmp/pleroma.zip % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 19.4M 100 19.4M 0 0 10.5M 0 0:00:01 0:00:01 --:--:-- 10.5M Unpacking /tmp/pleroma.zip to /tmp Backing up erlang cookie Cookie: KQL6T6IHHPXOIOSPNPUYTKIS52KXPCQKJZ3CLWJ2OLY4MDCQTLTA==== Copying files over to /opt/akkoma Removing files from the previous release rm: descend into write-protected directory '/opt/akkoma/backup'? y rm: remove write-protected regular file '/opt/akkoma/backup/akkoma_db_20230220.dump.gz'? y rm: cannot remove '/opt/akkoma/backup/akkoma_db_20230220.dump.gz': Permission denied rm: remove write-protected regular file '/opt/akkoma/backup/akkoma_db_20230217.dump.gz'? y rm: cannot remove '/opt/akkoma/backup/akkoma_db_20230217.dump.gz': Permission denied rm: remove write-protected regular file '/opt/akkoma/backup/akkoma_db_20230219.dump.gz'? y rm: cannot remove '/opt/akkoma/backup/akkoma_db_20230219.dump.gz': Permission denied rm: remove write-protected regular file '/opt/akkoma/backup/akkoma_db_20230218.dump.gz'? y rm: cannot remove '/opt/akkoma/backup/akkoma_db_20230218.dump.gz': Permission denied akkoma@forum:~$ ls -la total 12 drwxr-xr-x 3 akkoma root 4096 Feb 20 18:11 . drwxr-xr-x 6 root root 4096 Feb 20 18:11 .. drwxr-xr-x 2 postgres root 4096 Feb 20 01:45 backup ``` ### Severity I cannot use it as easily as I'd like ### Have you searched for this issue? - [x] I have double-checked and have not found this issue mentioned anywhere.
mwadmin added the
bug
label 2023-02-20 18:25:11 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: AkkomaGang/akkoma#479
No description provided.