MrKampf / proxmoxVE

The is a PHP 8 ProxmoxVe API client. With it you can easily and quickly retrieve information from your Proxmox server or cluster.
GNU General Public License v3.0
51 stars 26 forks source link

"Can't login" error on multiple connections to same or different servers #5

Closed Shade634 closed 2 years ago

Shade634 commented 4 years ago

Describe the bug Once the pve is set once, it returns a "can't login" on every new connection. It seems to keep a session somehow but i dont seem to be able to find an option to unset this. Unsetting the connection var also does not seem to work.

To Reproduce

$credentials = [
            'hostname' => $proxmoxConfig->getDomain(),
            'username' => $proxmoxConfig->getUser(),
            'password' => $proxmoxConfig->getPassword(true),
            'authType' => 'pam',
            'port' => $proxmoxConfig->getPort(),
        ];

$api = new pve($credentials);
//some other code
// api works fine
// Even an unset ($api) does not work

$credentials = [
            'hostname' => $proxmoxConfig->getDomain(),
            'username' => $proxmoxConfig->getUser(),
            'password' => $proxmoxConfig->getPassword(true),
            'authType' => 'pam',
            'port' => $proxmoxConfig->getPort(),
        ];
$api = new pve($credentials);
// cant login

it happens to me with a different node that i try to connect to, or when i try to connect to the same node twice, on different levels in my code.

Expected behavior A new fresh connection, anything else than a "Can't login" message

Even a disconnect function would work.

MrKampf commented 4 years ago

Have you the newst version? and have you debugged whether he gets the right login data?

Shade634 commented 4 years ago

its in this case the same server, so the credentials dont change between the frist and 2nd call. The first time it authenticates, the 2nd it does not. Current version in composer: "mrkampf/proxmox-ve": "^0.2.6"

$credentials = [
            'hostname' => $proxmoxConfig->getDomain(),
            'username' => $proxmoxConfig->getUser(),
            'password' => $proxmoxConfig->getPassword(true),
            'authType' => 'pam',
            'port' => $proxmoxConfig->getPort(),
        ];
$api = new pve($credentials);
//works
$api2 = new pve($credentials);
//errors "cant login"
MrKampf commented 3 years ago

Multi Login planed for next big update, this come middle of February

MrKampf commented 2 years ago

Now it's fixied with the new update