[SOLVED] PBS 4 having problems with API tokens?

meyergru

Active Member
Jan 28, 2023
153
60
33
www.congenio.de
I am using the PBS integration of Homepage (https://gethomepage.dev) to show a widget with an overview of PBS status.

This uses an API Token for authentication.

I have it running on PBS 3 with no problem and now have set up a new PBS 4 instance. I created a user apiuser@pbs, gave it Audit permissions on / (with propagation = yes) and set up an API token apiuser@pbs!homepage with the same permissions.

In homepage, I get the dreaded JSON parse error ("JSON.parse: unexpected character at line 1 column 1 of the JSON data") and when I look at homepage's logs, I see:

Code:
[2025-08-08T06:58:26.130Z] error: <credentialedProxyHandler> HTTP Error 401 calling https://aaa.bbb:8007/api2/json/nodes/localhost/status

So I am quite sure it is an authentication problem. I tested with elevated privileges (essentially Admin for both user and token) to no avail.

Then, I set up a new user testuser@pbs and token testuser@pbs!homepage on my trusty PBS 3.0 and changed URL, username and password on the homepage side and hey, presto - everything works. That is to say: I know how to set this up and it works for a PBS 3 instance. The only difference I can think of is that the new PBS 4 instance is in a different VLAN, but I verified that port 8007 can be accessed from homepage.

So, did PBS 4.0 (most current updates applied, i.e. 4.0.12-1) introduce an API authentication problem?

When I tried calling:

Code:
curl -k -H 'Authorization: PBSAPIToken=apiuser@pbs!homepage:65554979-e675-4d56-xxxx-41699b0f0b81' https://aaa.bbb:8007/api2/json/nodes/localhost/status

it worked, though.
 
Last edited:
Hi,

thanks for reporting this!
This uses an API Token for authentication.
That's curious, especially given your curl command works just fine. Not sure what homepage is doing here specifically, but I'll try to reproduce this. Can you maybe also post some logs from homepage itself if you have those? If you opened an issue with homepage itself, it would also be helpful, if you posted it here.

Thanks!
 
Hi!

Not too familiar with Homepage, but could you maybe also share config file that you're using to configure the proxmoxbackupserver widget?
 
The services.yaml file looks like this:

YAML:
---
# For configuration options and examples, please see:
# https://gethomepage.dev/latest/configs/services

- (Virtual) Machines:
    - AAA:
        icon: /images/mdi-proxmox.png # icons found here https://github.com/walkxcode/dashboard-icons
        href: https://aaa.bbb:8007
        description: Proxmox Backup Server (VM Backups)
        ping: aaa.bbb
        widget:
            type: proxmoxbackupserver
            url: https://aaa.bbb:8007
            username: apiuser@pbs!homepage
            password: 65554979-e675-4d56-xxxx-41699b0f0b81
 
Hm this seems to work just fine for me. Can you open the developer console of your browser (typically accessible via F12) and navigate to the “Network” tab and see check what the result for the /proxy request for that widget are?

It seems even if you tell homepage to provide debug logging it isn't logging proxy requests making this a bit tricky. I could not reproduce this with an up-to-date PBS4 and a current homepage here.

Also the only way for me to trigger a 401 specifically was by providing an invalid token value.
 
Last edited:
Frankly, I do not understand this. Now it suddenly works with the same settings? Probably, it was because I started with 4.0.11 and then updated. The Javascript may have been cached.

Sorry for the noise and thank you for looking into it-
 
Last edited:
No problem, but happy to hear this works again!