permission error importing existing datastore

hamishm

New Member
Dec 8, 2024
6
0
1
I am installing PBS on a new server and moving the datastore from the old PBS server to the new. The new server is on Debian installed from the PBS repository.

In the PBS GUI, I added the datastore and ticked "reuse existing datastore", but every time I get the error

2024-12-08T16:07:16+11:00: TASK ERROR: unable to open existing chunk store path "/path/to/pbs_backup" - permissions or owner not correct

The files are owned by backup:backup, and the permissions look the same as a new test datastore I created.

Code:
root@goanna:/path/to/pbs_backup# ls -la
total 8312
drwxr-s---     5 backup backup     7 Dec  8 15:57 .
drwxr-xr-x     6 root   root       6 Aug  5 21:42 ..
drwxr-s--- 65538 backup backup 65538 Aug  6 22:20 .chunks
-rwxr-x---     1 backup backup   315 Dec  8 15:57 .gc-status
-rwxr-x---     1 backup backup     0 Aug  6 20:44 .lock
drwxr-s---     7 backup backup     7 Aug 12 18:51 ct
drwxr-s---     4 backup backup     4 Nov 11 19:14 vm

How can I fix this, or get more information about which permissions are wrong?

I tried adding it to datastore.cfg directly but then the GUI wouldn't show the content.

I also couldn't work out how to add the existing datastore from the CLI with proxmox-backup-manager.

Thanks for any assistance.
 
The other/world group/executable permissions seemed to be important. i don't know why. I also stripped off all the setgid permissions, though that didn't seem to help.

The other problem was that the actual snapshot directories in ct/ and vm/ had encoding issues in the filenames as the datastore was previously accessed over CIFS, so I had to rename those directories by hand. But eventually PBS connected to the existing datastore.
 
I am installing PBS on a new server and moving the datastore from the old PBS server to the new. The new server is on Debian installed from the PBS repository.
What do you mean with "moving"? If the disk is NOT the same, I think it's better to run a sync job and pulling all the data.

Regardless any other things, I'd advice to take your time and stick on the sync option. Once everything's synced, think what you want to do with the existing "old" pbs.
 
I previously had PBS running in a CT, accessing the data store over CIFS. Now I have PBS running on bare metal Debian instead with local disks. It's the same disks, just no longer over the CIFS. However CIFS had messed with the encoding of the colons in the filenames - I found another post on the forum about that. I also had to fix a few directory permissions.

The backups weren't critical anyway so if I lost them it wouldn't have mattered. Or I could have started a new datastore and re-established the old PBS over the CIFS share if required.
 
If anyone else stumbles upon this post with similar issues:

I had the same error when importing a datastore that was restored from a restic backup.
I made the mistake thinking the following would grant enough access on the datastore:
chown -R backup:backup ./TESTRESTORE/
chmod -R 777 ./TESTRESTORE/

additionally you need to reduce the access on .chunks and .lock
chmod -R 750 ./.chunks/
chmod 644 ./.lock

As mentioned in the link posted by @Hannes Laimer the check seems to be done on exact permissions not these permissions or more.

https://git.proxmox.com/?p=proxmox-...c312d5848879be9f3a49dc031ada49ac03654526#l599
 
If anyone else stumbles upon this post with similar issues:

I had the same error when importing a datastore that was restored from a restic backup.
I made the mistake thinking the following would grant enough access on the datastore:
chown -R backup:backup ./TESTRESTORE/
chmod -R 777 ./TESTRESTORE/

additionally you need to reduce the access on .chunks and .lock
chmod -R 750 ./.chunks/
chmod 644 ./.lock

As mentioned in the link posted by @Hannes Laimer the check seems to be done on exact permissions not these permissions or more.

https://git.proxmox.com/?p=proxmox-...c312d5848879be9f3a49dc031ada49ac03654526#l599
This is EXACTLY what my problem was. Ran 'chmod 755' on the root path of the datastore and everything popped into place perfectly.