Error when launching prune command with proxmox-backup-client but work with dry-run option

Dark26

Renowned Member
Nov 27, 2017
284
30
68
48
Hello

i try tu run the prune command with the proxmox-backup-client like this :

/usr/bin/proxmox-backup-client prune vm/test-test-rrrrrrrrrrrrrrrrrrrrrrrrrr --keep-last 2 --keep-daily 5 --keep-weekly 2 --keep-monthly 1 --keep-yearly 1 --ns test/testttt --dry-run
┌─────────────────────────────────────────────────────────────────────────────────────────┬──────────────────────────┬────────┐
│ snapshot │ date │ action │
╞═════════════════════════════════════════════════════════════════════════════════════════╪══════════════════════════╪════════╡
│ vm/test-test-rrrrrrrrrrrrrrrrrrrrrrrrrr/2025-04-02T13:35:59Z │ Wed Apr 2 15:35:59 2025 │ remove │
├─────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────┼────────┤
│ vm/test-test-rrrrrrrrrrrrrrrrrrrrrrrrrr/2025-04-02T14:32:44Z │ Wed Apr 2 16:32:44 2025 │ keep │
├─────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────┼────────┤
│ vm/test-test-rrrrrrrrrrrrrrrrrrrrrrrrrr/2025-04-03T01:23:02Z │ Thu Apr 3 03:23:02 2025 │ keep │
├─────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────┼────────┤
│ vm/test-test-rrrrrrrrrrrrrrrrrrrrrrrrrr2025-04-03T09:04:27Z │ Thu Apr 3 11:04:27 2025 │ keep │
└─────────────────────────────────────────────────────────────────────────────────────────┴──────────────────────────┴────────┘


with the same command without the option -dry-run :
/usr/bin/proxmox-backup-client prune vm/test-test-rrrrrrrrrrrrrrrrrrrrrrrrrr --keep-last 2 --keep-daily 5 --keep-weekly 2 --keep-monthly 1 --keep-yearly 1 --ns test/testttt

Error: mkstemp "/var/log/proxmox-backup/tasks/09/UPID:xxxxxxxxxx:0000009A:67EE5660:prune:xx\\x3xffcue\\x2dfffre\\x2dfffsis\\x2dff726c5e35\\x2d1c2e\\x2d4c40\\x2da4d9\\x2d2cd3628\\x3avdff\\x2dre\\x2doafffs\\x2fff9\\x2d726c5e35\\x2d1c2e\\x2d4c40\\x2da4d9\\x2d2cd3628afc9c:backup_pbs@pbs!baxxxxx:.tmp_XXXXXX" failed: ENAMETOOLONG: File name too long

It'a like it stuck for creating the tempfile for the backup, and the command don't work because of it

Any idea ?
 
seems like the temporary upid file here is too long for this to work, you could try to run the prune command with the user directly instead of the token, that would shorten the file name. this is just a workaround though, we'll need to look into creating a proper solution here.

ist there a reason for the rahter odd name "test-test-rrrrrrrrrrrrrrrrrrrrrrrrrr", though?
 
I ll try with a login/password.
But the goal is to launcher the command in a script so the token seems more the way to go.

For the file/ namespace name, i just quickly remplace the real name for posting here.

Thanks for the reply
 
For the file/ namespace name, i just quickly remplace the real name for posting here.
ok well iirc correctly the name of the snapshot is encoded in the upid name, so a) there error message leaks the name unless you also altered it and b) it seems you are using something fairly long here, could you change that to something shorter?

alternatively, you can use a shorter user or token name for now as a work around.
 
I also altered the response.

For the long name, they are generated automaticly via a backup script ( we use volume id), that's why there are long.

I try with a short token

I try with a login/pass, it's the same.

there is a lot of "-" in the name of the namespace / group ( like 15 occurence ) ( volume id is like : 726c5e35-1c2e-4c40-a4d9-2cd3628ffc9c ), and there are replace with "\\x2d" in the name for the temp file , so maybe the name is more than 256 character.

maybe we can directly with the API?
 
Last edited:
maybe we can directly with the API?
no, that shouldn't make a difference. upid files are created when a task spawns, the api will still spawn a prune task. you can really only try to shorten that file name. and yes `-` seems to get encoded, if you manage to remove those it might help.
 
I can create a prune job directly on the web interface on pbs, and after, i can launch the prune job when i click run now. it's work

My idea was to create the prune job automatically ( with a prune Schedule) via the Api. And after that it's the pbs server who's launch the prune task ( prune Schedule )

The seems to be a problem when it's launch with the proxmax-backup-client on the client.