Proxmox Integration Not Working

I have the Proxmox integration installed using the following in my configuration.yaml:

proxmoxve:
  - host: 192.168.1.9
    verify_ssl: false
    username: !secret proxmox_user
    password: !secret proxmox_password
    realm: pve
    nodes:
      - node: pve
        vms:
          - 100
          - 101

After a restart the binary sensors for the 2 VMs go to an ‘on’ state but then about 4 mins later they change to ‘unavailable’ and remain that way.

I can see from the proxmox server logs that the authentication by the HA account is successful and I guess that’s confirmed by the fact that they report correctly for a few minutes.

This is what is in my HA logs:

Logger: homeassistant.components.proxmoxve
Source: components/proxmoxve/__init__.py:205
Integration: Proxmox VE (documentation, issues)
First occurred: 10:10:51 (6 occurrences)
Last logged: 10:13:09

Vm/Container 100 unable to be found in node pve
Vm/Container 101 unable to be found in node pve

Does anyone have any ideas what’s going on?

Thanks

When I have that error, the vm or lxc eith that number (id) is not there and thus gives me an error.

I currently have exactly the same problem. It goes unavailable every 5minutes and 3 seconds.
Do you also have the issue that you are logged out of the ProxMox WebUI every few minutes?

I get these errors:

 File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 191, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 150, in _async_update_data
    return await self.update_method()
  File "/usr/src/homeassistant/homeassistant/components/proxmoxve/__init__.py", line 202, in async_update_data
    vm_status = await hass.async_add_executor_job(poll_api)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/proxmoxve/__init__.py", line 199, in poll_api
    vm_status = call_api_container_vm(proxmox, node_name, vm_id, vm_type)
  File "/usr/src/homeassistant/homeassistant/components/proxmoxve/__init__.py", line 237, in call_api_container_vm
    status = proxmox.nodes(node_name).qemu(vm_id).status.current.get()
  File "/usr/local/lib/python3.9/site-packages/proxmoxer/core.py", line 105, in get
    return self(args)._request("GET", params=params)
  File "/usr/local/lib/python3.9/site-packages/proxmoxer/core.py", line 85, in _request
    resp = self._store["session"].request(method, url, data=data or None, params=params)
  File "/usr/local/lib/python3.9/site-packages/proxmoxer/backends/https.py", line 178, in request
    return super(ProxmoxHttpSession, self).request(method, url, params, data, headers, cookies, files, auth,
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 515, in request
    prep = self.prepare_request(req)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 443, in prepare_request
    p.prepare(
  File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 322, in prepare
    self.prepare_auth(auth, url)
  File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 558, in prepare_auth
    r = auth(self)
  File "/usr/local/lib/python3.9/site-packages/proxmoxer/backends/https.py", line 95, in __call__
    self._getNewTokens()
  File "/usr/local/lib/python3.9/site-packages/proxmoxer/backends/https.py", line 79, in _getNewTokens
    raise AuthenticationError("Couldn't authenticate user: {0} to {1}".format(self.username, self.base_url + "/access/ticket"))
proxmoxer.backends.https.AuthenticationError: Couldn't authenticate user: ha@pve to https://192.168.1.10:8006/api2/json/access/ticket

Seems like it cannot refresh the token…

I have just taken another look at my logs and I have exactly this problem. The Proxmox webUI is also timing out with the same frequency and I can see this from the Proxmox logs. Any ideas how to fix it? :slight_smile:

So far my post on the ProxMox Forum doesnt get a lot of support. Have been trying out lots of different things, but so far the issue remains. Seems like a reinstall and restore of all the VMs/LXCs is needed.

That’s not great, fortunately I only have 2 VMs on there and neither are my HA instance. I guess that’s
another job to add to the list…

This has now been solved with the help of @AlmostSerious and the Proxmox support forum.

Both of our systems had problems with time sync that had resulted in our authkey.pub files having a timestamp in the future causing all tokens signed with those keys to be invalid. The details of the solution can be found here.