Proxmox ошибка соединения 401 no ticket

  • #1

Tried to create a 3 node cluster with a fresh proxmox ve 6.0-4 install.
Cluster creation works and adding a second node works aswell, but after i added the 3rd node i get «permission denied — invalid PVE ticket (401)» (only for the third the other 2 are still working).

In the webinterface i can access Node 1 and 2, but 3 aborts with this message. Node 3 can’t access any node.

Dominic


  • #2

Did you try clearing your browser cache or using a different browser?

  • #3

Did you try clearing your browser cache or using a different browser?

yes to both

What i tried until now:
-use another browser/workstation to access
-separate the 3rd node and use delnode on the other clients then readd
-tried the above and before readd i cleared all reverences i could find on the 2 working nodes
-checked timedatectl and synced the time and timezone between all nodes
-reinstalled node 3 & synced the time and added it to the cluster again (before i cleared all references from the other nodes)

Nothing of this worked. After «pvecm add ip-of-the-first-node» it says successful and the webpanel shows the node in the cluster with it’s local and local lvm. When i expand it i get «permission denied — invalid PVE ticket (401)»…

No idea what i should try next.

  • #4

crazy, reinstalled all 3 nodes and now it worked

  • #5

Same thing is happening to me too. Fourth cluster I’ve built, but first time using the GUI and separate corosync network to do so (now with 6.0.4)

Hosts can all ping one-another on corosync network, and all went fine until joining node #2 and #3 via GUI.

Is the corosync cluster network supposed to be able to reach the NTP server directly from that separate network?

EDIT: more detail:

2/3 nodes seem to be ok. The 3rd node has joined the cluster and is visible in the other 2 nodes management windows via web UI.

Node 3 asks for login each time it is visited. Nothing works from this node’s web UI, but it does believe it is joined to the cluster (node 1 and 2 are visible, but clicking anything throws errors…401: no ticket in shell, and «NaN» repeatedly in other fields within the cluster management).

  • #6

Same thing is happening to me too. Fourth cluster I’ve built, but first time using the GUI and separate corosync network to do so (now with 6.0.4)

Hosts can all ping one-another on corosync network, and all went fine until joining node #2 and #3 via GUI.

Is the corosync cluster network supposed to be able to reach the NTP server directly from that separate network?

EDIT: more detail:

2/3 nodes seem to be ok. The 3rd node has joined the cluster and is visible in the other 2 nodes management windows via web UI.

Node 3 asks for login each time it is visited. Nothing works from this node’s web UI, but it does believe it is joined to the cluster (node 1 and 2 are visible, but clicking anything throws errors…401: no ticket in shell, and «NaN» repeatedly in other fields within the cluster management).

For anyone else knocking about with this…
Seem to have solved it for now. Still not sure why the error happened during cluster creation!

1.)

Code:

pvecm updatecerts
systemctl restart pvedaemon pveproxy

2.) restarted nodes.
3.) cleared browser cookies for all three nodes.

..still had the errors, until the web browser itself was purged of cache, closed and restarted.

  • #7

Browser doesn’t seem to be the issue. I am still trying to fix this. It reoccurs for us every 10 days or so.

  • #8

Browser doesn’t seem to be the issue. I am still trying to fix this. It reoccurs for us every 10 days or so.

OMG, i am not the only one ! Got a cluster with 3 nodes and the error came randomly, sometimes 2/3 days sometimes more.

  • #9

Helllo i was haveing the same problem the way i fixed it is :
1. Deleting this files:
<node> is your node name

  • /etc/pve/pve-root-ca.pem
  • /etc/pve/priv/pve-root-ca.key
  • /etc/pve/nodes/<node>/pve-ssl.pem
  • /etc/pve/nodes/<node>/pve-ssl.key
  • /etc/pve/authkey.pub
  • /etc/pve/priv/authkey.key
  • /etc/pve/priv/authorized_keys

2. pvecm updatecerts -f
3 systemctl restart pvedaemon pveproxy

Hope it works for others too

  • #10

Please also verify that your host clocks are synced

  • #11

We have a 3 node setup. The lesser 3rd node, only used only as a replication target for backup puporses, still has the issue.

We have since purchased the license subscription and are currently running Virtual Environment 6.1-8. Since the affected node can be rebooted, I have added this as a daily cron job and the problem is worked around this way. I have disabled the reboot last week and today, the node is not reachable from the others with error «permission denied — invalid PVE ticket (401)».

Proxmox, fix this.

  • #12

My clocks are in sync… when I observed them.

This could be a good clue still. My 2 main nodes are bare-metal, but my 3rd node is a VM (bhyve). Maybe the host’s network timesync is messing with the date periodically? Anyone can put some weight on this?

  • #13

My clocks are in sync… when I observed them.

This could be a good clue still. My 2 main nodes are bare-metal, but my 3rd node is a VM (bhyve). Maybe the host’s network timesync is messing with the date periodically? Anyone can put some weight on this?

A late reply perhaps, but I think you might be on to something, as I’ve come across this before. In many cases the default value for a VM is to get its
time synced with the parent partition, eg. from the host it’s running on. Make sure this is not the case for you 3rd node and that all of your hosts are
using the same time source.

  • #14

I solved this by setting up the same NTP server on all servers.

  • #15

Helllo i was haveing the same problem the way i fixed it is :
1. Deleting this files:
<node> is your node name

  • /etc/pve/pve-root-ca.pem
  • /etc/pve/priv/pve-root-ca.key
  • /etc/pve/nodes/<node>/pve-ssl.pem
  • /etc/pve/nodes/<node>/pve-ssl.key
  • /etc/pve/authkey.pub
  • /etc/pve/priv/authkey.key
  • /etc/pve/priv/authorized_keys

2. pvecm updatecerts -f
3 systemctl restart pvedaemon pveproxy

Hope it works for others too

Can confirm this works. My cluster had this 401 issue on all nodes (not just one), I had tried ntp and pvecm updatecerts and reboot the whole cluster but all failed. I ended up fixing this using this method, and replace pve-ssl cert on all nodes. Thanks skywyw.

  • #16

Helllo i was haveing the same problem the way i fixed it is :
1. Deleting this files:
<node> is your node name

  • /etc/pve/pve-root-ca.pem
  • /etc/pve/priv/pve-root-ca.key
  • /etc/pve/nodes/<node>/pve-ssl.pem
  • /etc/pve/nodes/<node>/pve-ssl.key
  • /etc/pve/authkey.pub
  • /etc/pve/priv/authkey.key
  • /etc/pve/priv/authorized_keys

2. pvecm updatecerts -f
3 systemctl restart pvedaemon pveproxy

Hope it works for others too

@skywyw which node(s) should i run these commands on?

i have a 4 node cluster and 1 is giving me the «permission denied — invalid PVE ticket (401)» error.

and do i remove pve-ssl.pem & pve-ssl.key for just the one that’s having trouble or all nodes?

Last edited:

  • #17

I had the same problem and it turned out the new node had a faulty DNS server entry. Fixing that resolved the issue.

  • #18

@skywyw which node(s) should i run these commands on?

i have a 4 node cluster and 1 is giving me the «permission denied — invalid PVE ticket (401)» error.

and do i remove pve-ssl.pem & pve-ssl.key for just the one that’s having trouble or all nodes?

I have similar problem. 5 nodes and only one is giving me the «permission denied — invalid PVE ticket (401)» error.
Have you any solution? I tried set up same ntp server on all the nodes — did not help.

It’s production servers, so I cant reboot them as it would suit me.

  • #19

I solved this by setting up the same NTP server on all servers.

thanks.its working

  • #20

Hi

I know this is a rather old thread but it might help people come across … I encountered the same error as mentioned on a fresh installed 3 node Proxmox VE cluster.

When switching from one node to the other in webgui the 401 error came up — as it is a testing cluster which is hibernated from time to time I realized following points:

— after suspending and waking up the machines there may be a time difference and according logfiles some actions do not tolerate a difference of more than one second
— the browser must know about all certificates and have them accepted if using self signed certs (login with all addresses of all nodes)
— browser cache should be cleared
— and storing username / pw may help (but for a production cluster I would not recommend this)

Regards, Dietmar

Hi

i have proble with ticket and cookie system


<?php

/*
For the first you need:
1. Create User group "VNC" –> Datacenter / Permissions / Group
2. Create new user -> Datacenter / Permissions / Users - select Group: "VNC", Realm: pve
3. Create new Role -> Datacenter / Permissions / Roles - select Name: "VNC", Privilegies: VM.Console (only)
3. Add permision to access VM -> Datacenter / Node / VM / Permissions / Add Group Permissions - select Group: "VNC", Role: "VNC"
*/

require_once 'vendor/autoload.php';
use ProxmoxVE\Proxmox;



$host = 'X.x.x.x';
$node = 'node';
$vmid = '102';

$credentials = [
    'hostname'  => $host,
    'username'  => 'root',
    'password'  => 'XXXX'
];

$proxmox = new Proxmox($credentials);

if($login = $proxmox->login()) {
    // Get and save ticket
    $ticket = $login->getTicket();
    $config = $proxmox->create('/nodes/'.$node.'/qemu/'.$vmid.'/vncproxy', [
        'websocket' => 1 // Start websocket
    ]);
    $websock = $proxmox->get('/nodes/'.$node.'/qemu/'.$vmid.'/vncwebsocket', [
        'vncticket' => $ticket,
        'port'      => $config['data']['port'],

    ]);
    // Set Cookies (domain must be in same space that pve. Example: pve – pve1.your.com, host – auth.your.com, Set cookies to your.com)
    setcookie('PVEAuthCookie', $ticket , 0, '/', 'localhost:4000', false);

    $src_href = 'https://'.$host.':8006/?console=kvm&novnc=1&node='.$node.'&resize=1&vmid='.$vmid.'&path=api2/json/nodes/'.$node.'/qemu/'.$vmid.'/vncwebsocket/port/'.$config['data']['port'].'/vncticket/'.$ticket;
    echo '<iframe src="'.$src_href.'" frameborder="0" scrolling="no" width="800px" height="600px"></iframe>';
}

?>

i got 401 error i think this happend because i used spicial port 4000 but i dont know how fix it

Эта проблема

Ровно через два часа после перезапуска HA интеграция Proxmox больше не работает с ошибкой: 401 Unauthorized: в разрешении отказано — недействительный билет PVE

Среда

  • Выпуск Home Assistant Core с ошибкой: 0.111.3
  • Последний рабочий выпуск Home Assistant Core (если известен): 0.110.x
  • Операционная среда (Домашний помощник / Под наблюдением / Докер / Venv): Домашний помощник
  • Интеграция, вызывающая эту проблему: Proxmox VE
  • Ссылка на документацию по интеграции на нашем сайте: https://www.home-assistant.io/integrations/proxmoxve/

Актуальные для проблемы configuration.yaml

proxmoxve:
  - host: <ip address>
    username: <user>
    password: <pwd>
    verify_ssl: false
    realm: pam
    nodes:
      - node: pve
        vms:
          - 100
          - 102
          - 103
        containers:
          - 101

Журналы трассировки / ошибок

Logger: homeassistant.helpers.entity
Source: components/proxmoxve/binary_sensor.py:96
First occurred: 17:40:58 (1026 occurrences)
Last logged: 19:53:10

Update for binary_sensor.pve_hassio_running fails
Update for binary_sensor.pve_omv_running fails
Update for binary_sensor.pve_hassio_test_running fails
Update for binary_sensor.pve_lamp_running fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 472, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/proxmoxve/binary_sensor.py", line 83, in update
    item = self.poll_item()
  File "/usr/src/homeassistant/homeassistant/components/proxmoxve/binary_sensor.py", line 96, in poll_item
    .get(self._item_type.name)
  File "/usr/local/lib/python3.7/site-packages/proxmoxer/core.py", line 105, in get
    return self(args)._request("GET", params=params)
  File "/usr/local/lib/python3.7/site-packages/proxmoxer/core.py", line 94, in _request
    resp.reason, resp.content))
proxmoxer.core.ResourceException: 401 Unauthorized: permission denied - invalid PVE ticket - b''

Дополнительная информация

HassOS — виртуальная машина proxmox

Привет, @ k4ds3 , могли бы вы взглянуть на эту проблему, поскольку она помечена как интеграция ( proxmoxve ), для которой вы указаны как владелец кода ? Спасибо!
(сообщение CodeOwnersMention)

Я пробовал тестовую установку с версией 0.110, и интеграция работает правильно, обновляя билет через 2 часа.
Таким образом, предполагается, что версия 0.111 испортила интеграцию.
@ K4ds3 , @jhollowe есть идеи?

То же самое и здесь. Перезагрузил установку HomeAssistant вчера в 14:11, в 16:11. Я получаю те же ошибки в журналах, что и @maxalbani, но с разными именами binary_sensor.name:

последняя строка каждой записи та же 401:
proxmoxer.core.ResourceException: 401 Unauthorized: в разрешении отказано — недействительный билет PVE — b »

Я использую HomeAssistant 0.111.3

Интересно. Как часто HA опрашивает ваш PVE? библиотека proxmoxer должна обновлять билет, если он опрашивается не реже одного раза в два часа.

Интересно. Как часто HA опрашивает ваш PVE? библиотека proxmoxer должна обновлять билет, если он опрашивается не реже одного раза в два часа.

Поскольку билет действителен в течение первых двух часов, HA обновляет датчики примерно каждые 30 секунд, так что проблема не в этом.
Что-то изменилось с версией HA 0.111.x, потому что до 0.110 все работало правильно.

Посмотрю сегодня после работы.
Я планирую добавить аутентификацию токена API для этой интеграции, чтобы попытаться решить эту проблему.

Обновление аутентификации было удалено из интеграции, поскольку теперь оно обрабатывается библиотекой подключений. Я запускаю hass с отладочной сборкой библиотеки, чтобы узнать, в чем проблема.

На данный момент я бы рекомендовал вернуться к 0,110, если вам это нужно в настоящее время. Вы также можете вручную повторно добавить старый код обновления интеграции, если хотите использовать 0.111.

На данный момент я бы рекомендовал вернуться к 0,110, если вам это нужно в настоящее время. Вы также можете вручную повторно добавить старый код обновления интеграции, если хотите использовать 0.111.

Как я могу вручную повторно добавить старый код продления на Hassio?
Спасибо за работу!

@maxalbani Я не уверен. С хассио (Домашний помощник) это может быть сложно.

@maxalbani Я не уверен. С хассио (Домашний помощник) это может быть сложно.

Я тоже так думал …
Есть ли у вас прогноз решения проблемы?

Похоже, что-то странное происходит с библиотекой, обновляющей билет. Я думаю, что это проблема с библиотекой, работающей в асинхронных рабочих потоках, поэтому каждый поток пытается обновиться, а PVE это не нравится. Сейчас у меня запущен тест, в котором опрашивается только один контейнер. Если это не поможет, я буду знать, в чем проблема. Мне просто нужно ждать 2 часа каждый раз, когда я что-то меняю.
Я могу просто вернуться к коду обновления интеграции, но я хотел бы попытаться заставить его работать со встроенным обновлением библиотеки.

нашли и исправили проблему. Библиотека обновляла билет аутентификации, но отправляла только исходный билет (сеанс не извлекал cookie из аутентификации).

Я получу новую версию библиотеки, а затем обновлю интеграцию, чтобы использовать фиксированную версию (и провести на ней надлежащее тестирование).

Есть какие-либо Новости?
Спасибо

Все еще ждем объединения PR.
Вы также можете просто вручную обновить зависимость proxmoxer до версии 1.1.1.

Hi

i have proble with ticket and cookie system


<?php

/*
For the first you need:
1. Create User group "VNC" –> Datacenter / Permissions / Group
2. Create new user -> Datacenter / Permissions / Users - select Group: "VNC", Realm: pve
3. Create new Role -> Datacenter / Permissions / Roles - select Name: "VNC", Privilegies: VM.Console (only)
3. Add permision to access VM -> Datacenter / Node / VM / Permissions / Add Group Permissions - select Group: "VNC", Role: "VNC"
*/

require_once 'vendor/autoload.php';
use ProxmoxVE\Proxmox;



$host = 'X.x.x.x';
$node = 'node';
$vmid = '102';

$credentials = [
    'hostname'  => $host,
    'username'  => 'root',
    'password'  => 'XXXX'
];

$proxmox = new Proxmox($credentials);

if($login = $proxmox->login()) {
    // Get and save ticket
    $ticket = $login->getTicket();
    $config = $proxmox->create('/nodes/'.$node.'/qemu/'.$vmid.'/vncproxy', [
        'websocket' => 1 // Start websocket
    ]);
    $websock = $proxmox->get('/nodes/'.$node.'/qemu/'.$vmid.'/vncwebsocket', [
        'vncticket' => $ticket,
        'port'      => $config['data']['port'],

    ]);
    // Set Cookies (domain must be in same space that pve. Example: pve – pve1.your.com, host – auth.your.com, Set cookies to your.com)
    setcookie('PVEAuthCookie', $ticket , 0, '/', 'localhost:4000', false);

    $src_href = 'https://'.$host.':8006/?console=kvm&novnc=1&node='.$node.'&resize=1&vmid='.$vmid.'&path=api2/json/nodes/'.$node.'/qemu/'.$vmid.'/vncwebsocket/port/'.$config['data']['port'].'/vncticket/'.$ticket;
    echo '<iframe src="'.$src_href.'" frameborder="0" scrolling="no" width="800px" height="600px"></iframe>';
}

?>

i got 401 error i think this happend because i used spicial port 4000 but i dont know how fix it

Эта проблема

Ровно через два часа после перезапуска HA интеграция Proxmox больше не работает с ошибкой: 401 Unauthorized: в разрешении отказано — недействительный билет PVE

Среда

  • Выпуск Home Assistant Core с ошибкой: 0.111.3
  • Последний рабочий выпуск Home Assistant Core (если известен): 0.110.x
  • Операционная среда (Домашний помощник / Под наблюдением / Докер / Venv): Домашний помощник
  • Интеграция, вызывающая эту проблему: Proxmox VE
  • Ссылка на документацию по интеграции на нашем сайте: https://www.home-assistant.io/integrations/proxmoxve/

Актуальные для проблемы configuration.yaml

proxmoxve:
  - host: <ip address>
    username: <user>
    password: <pwd>
    verify_ssl: false
    realm: pam
    nodes:
      - node: pve
        vms:
          - 100
          - 102
          - 103
        containers:
          - 101

Журналы трассировки / ошибок

Logger: homeassistant.helpers.entity
Source: components/proxmoxve/binary_sensor.py:96
First occurred: 17:40:58 (1026 occurrences)
Last logged: 19:53:10

Update for binary_sensor.pve_hassio_running fails
Update for binary_sensor.pve_omv_running fails
Update for binary_sensor.pve_hassio_test_running fails
Update for binary_sensor.pve_lamp_running fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 472, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/proxmoxve/binary_sensor.py", line 83, in update
    item = self.poll_item()
  File "/usr/src/homeassistant/homeassistant/components/proxmoxve/binary_sensor.py", line 96, in poll_item
    .get(self._item_type.name)
  File "/usr/local/lib/python3.7/site-packages/proxmoxer/core.py", line 105, in get
    return self(args)._request("GET", params=params)
  File "/usr/local/lib/python3.7/site-packages/proxmoxer/core.py", line 94, in _request
    resp.reason, resp.content))
proxmoxer.core.ResourceException: 401 Unauthorized: permission denied - invalid PVE ticket - b''

Дополнительная информация

HassOS — виртуальная машина proxmox

Привет, @ k4ds3 , могли бы вы взглянуть на эту проблему, поскольку она помечена как интеграция ( proxmoxve ), для которой вы указаны как владелец кода ? Спасибо!
(сообщение CodeOwnersMention)

Я пробовал тестовую установку с версией 0.110, и интеграция работает правильно, обновляя билет через 2 часа.
Таким образом, предполагается, что версия 0.111 испортила интеграцию.
@ K4ds3 , @jhollowe есть идеи?

То же самое и здесь. Перезагрузил установку HomeAssistant вчера в 14:11, в 16:11. Я получаю те же ошибки в журналах, что и @maxalbani, но с разными именами binary_sensor.name:

последняя строка каждой записи та же 401:
proxmoxer.core.ResourceException: 401 Unauthorized: в разрешении отказано — недействительный билет PVE — b »

Я использую HomeAssistant 0.111.3

Интересно. Как часто HA опрашивает ваш PVE? библиотека proxmoxer должна обновлять билет, если он опрашивается не реже одного раза в два часа.

Интересно. Как часто HA опрашивает ваш PVE? библиотека proxmoxer должна обновлять билет, если он опрашивается не реже одного раза в два часа.

Поскольку билет действителен в течение первых двух часов, HA обновляет датчики примерно каждые 30 секунд, так что проблема не в этом.
Что-то изменилось с версией HA 0.111.x, потому что до 0.110 все работало правильно.

Посмотрю сегодня после работы.
Я планирую добавить аутентификацию токена API для этой интеграции, чтобы попытаться решить эту проблему.

Обновление аутентификации было удалено из интеграции, поскольку теперь оно обрабатывается библиотекой подключений. Я запускаю hass с отладочной сборкой библиотеки, чтобы узнать, в чем проблема.

На данный момент я бы рекомендовал вернуться к 0,110, если вам это нужно в настоящее время. Вы также можете вручную повторно добавить старый код обновления интеграции, если хотите использовать 0.111.

На данный момент я бы рекомендовал вернуться к 0,110, если вам это нужно в настоящее время. Вы также можете вручную повторно добавить старый код обновления интеграции, если хотите использовать 0.111.

Как я могу вручную повторно добавить старый код продления на Hassio?
Спасибо за работу!

@maxalbani Я не уверен. С хассио (Домашний помощник) это может быть сложно.

@maxalbani Я не уверен. С хассио (Домашний помощник) это может быть сложно.

Я тоже так думал …
Есть ли у вас прогноз решения проблемы?

Похоже, что-то странное происходит с библиотекой, обновляющей билет. Я думаю, что это проблема с библиотекой, работающей в асинхронных рабочих потоках, поэтому каждый поток пытается обновиться, а PVE это не нравится. Сейчас у меня запущен тест, в котором опрашивается только один контейнер. Если это не поможет, я буду знать, в чем проблема. Мне просто нужно ждать 2 часа каждый раз, когда я что-то меняю.
Я могу просто вернуться к коду обновления интеграции, но я хотел бы попытаться заставить его работать со встроенным обновлением библиотеки.

нашли и исправили проблему. Библиотека обновляла билет аутентификации, но отправляла только исходный билет (сеанс не извлекал cookie из аутентификации).

Я получу новую версию библиотеки, а затем обновлю интеграцию, чтобы использовать фиксированную версию (и провести на ней надлежащее тестирование).

Есть какие-либо Новости?
Спасибо

Все еще ждем объединения PR.
Вы также можете просто вручную обновить зависимость proxmoxer до версии 1.1.1.

Понравилась статья? Поделить с друзьями:
  • Ps3 ошибка 80710723 что делать
  • Ps0312 ошибка чпу
  • Proxmox ошибка входа попробуйте еще раз
  • Ps3 ошибка 8071053d как исправить
  • Proxmox ошибка 500