Api

Hello, I have the same problem


curl -k https://163.172.87.55:8006/api2/json/nodes -H 'Authorization: PVEAPIToken=root@pam!user=key'

curl: (56) OpenSSL SSL_read: error:0A000126:SSL routines::unexpected eof while reading, errno 0

I did that because I'm trying to create VM with Ansible


ansible-playbook -i inventory/inventory.ini playbooks/create_and_setup_ssh_vm.yml --ask-vault-pass -e "next_vmid=334"
Vault password:
PLAY [Deploy Ubuntu VM from template] ****************************************************************************************************************************************************************
TASK [Clone the VM from template] ********************************************************************************************************************************************************************
[DEPRECATION WARNING]: The proxmox_default_behavior option will change its default value from "compatibility" to "no_defaults" in community.general 4.0.0. To remove this warning, please specify an
explicit value for it now. This feature will be removed from community.general in version 4.0.0. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
fatal: [localhost]: FAILED! => {"changed": false, "msg": "authorization on proxmox cluster failed with exception: 401 Unauthorized: 'root@pam!********' is not a valid token ID - not able to split into user and token parts - {'errors': b''}"}
PLAY RECAP *******************************************************************************************************************************************************************************************
localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
 
Ok, solution found.

I had to go to Permissions, to give to the new user and then to give also to the API token.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!