How to add PBS as Backup Storage in PVE with a API Key

Feb 1, 2024
18
0
1
Hello,
im trying to get a hang of the API-Keys and the PBS. I currently try to add a PBS as Backupstorage with the API-Keys of the PBS.
I created them and gave them Permissions (DatastorePowerUser) for my Datastore. But if i try to add them in PVE with:
root@pam!<token-name>

But in the syslog of the PBS i get the following error:

proxmox-backup-api[1215]: POST /api2/json/access/ticket: 400 Bad Request: [client [<IP of the PVE>] parameter verification failed - 'username': value does not match the regex pattern

Am i entering a wrong Username?

Im Running PBS with:
3.1-2
and PVE with:
8.1.3
 
that is the correct syntax.. but with an API token, there shouldn't be a need to get a ticket at all? could you post the storage.cfg entry for that storage and "pveversion -v"?
 
Did you really create the API key for root or for an additional user? Can you take a screenshot of how you want to or have filled out the mask in Proxmox VE?
For security reasons, I would also advise you not to use root here. It is better to create a new user and only assign them the most necessary rights.
 
that is the correct syntax.. but with an API token, there shouldn't be a need to get a ticket at all? could you post the storage.cfg entry for that storage and "pveversion -v"?
How would i add the storage.cfg, when i cant even add the PBS through the GUI? Should i add a manual entry to storage.cfg?

The Output from pveversion from the PVE:
proxmox-ve: 8.1.0 (running kernel: 6.5.11-7-pve)
pve-manager: 8.1.4 (running version: 8.1.4/ec5affc9e41f1d79)
proxmox-kernel-helper: 8.1.0
proxmox-kernel-6.5: 6.5.11-7
proxmox-kernel-6.5.11-7-pve-signed: 6.5.11-7
proxmox-kernel-6.2.16-20-pve: 6.2.16-20
proxmox-kernel-6.2: 6.2.16-20
ceph-fuse: 16.2.11+ds-2
corosync: 3.1.7-pve3
criu: 3.17.1-2
glusterfs-client: 10.3-5
ifupdown: residual config
ifupdown2: 3.2.0-1+pmx8
libjs-extjs: 7.0.0-4
libknet1: 1.28-pve1
libproxmox-acme-perl: 1.5.0
libproxmox-backup-qemu0: 1.4.1
libproxmox-rs-perl: 0.3.3
libpve-access-control: 8.0.7
libpve-apiclient-perl: 3.3.1
libpve-common-perl: 8.1.0
libpve-guest-common-perl: 5.0.6
libpve-http-server-perl: 5.0.5
libpve-network-perl: 0.9.5
libpve-rs-perl: 0.8.7
libpve-storage-perl: 8.0.5
libspice-server1: 0.15.1-1
lvm2: 2.03.16-2
lxc-pve: 5.0.2-4
lxcfs: 5.0.3-pve4
novnc-pve: 1.4.0-3
proxmox-backup-client: 3.1.2-1
proxmox-backup-file-restore: 3.1.2-1
proxmox-kernel-helper: 8.1.0
proxmox-mail-forward: 0.2.2
proxmox-mini-journalreader: 1.4.0
proxmox-offline-mirror-helper: 0.6.4
proxmox-widget-toolkit: 4.1.3
pve-cluster: 8.0.5
pve-container: 5.0.8
pve-docs: 8.1.3
pve-edk2-firmware: 4.2023.08-3
pve-firewall: 5.0.3
pve-firmware: 3.9-1
pve-ha-manager: 4.0.3
pve-i18n: 3.1.5
pve-qemu-kvm: 8.1.2-6
pve-xtermjs: 5.3.0-3
qemu-server: 8.0.10
smartmontools: 7.3-pve1
spiceterm: 3.3.0
swtpm: 0.8.0+pve1
vncterm: 1.8.0
zfsutils-linux: 2.2.2-pve1
 
Since you've hidden all relevant information, it's hard to help you here.

What message do you get on the GUI when you send it like that?
 
Since you've hidden all relevant information, it's hard to help you here.

What message do you get on the GUI when you send it like that?
Okay, i found the error, or more a bug. The Regex failed, when the Token-Name contains a "-". Here is a better screenshot:

When i remove the "-a" Part it works without a Problem. I dont know why im allowed to add the Token as such or why its been regexed as wrong...
1706787397944.png
1706787427327.png