[GH-ISSUE #136] requests.exceptions.ConnectionError: HTTPSConnectionPool NewConnectionError #68

Closed
opened 2026-02-27 15:46:16 +03:00 by kerem · 5 comments
Owner

Originally created by @Denyreal on GitHub (Feb 21, 2023).
Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/136

Originally assigned to: @jhollowe on GitHub.

Hi thank you for this great tool.

I cannot make it work because i'm dumb :

i installed got on ansible controller
ansible [core 2.14.2]
pip install proxmoxer requests

on proxmox :
pip install proxmoxer requests

i checked if the api works :

curl -k -d 'username=root@pam' --data-urlencode 'password=MYPASSWORD https://192.168.10.30:8006/api2/json/access/ticket

it works :

pvedaemon[425432]: <root@pam> successful auth for user 'root@pam

when i'm trying to deploy playbook :

error_proxmoxer.txt

  • hosts: perseverance
    gather_facts: no
    vars:
    inventory_hostname: "perseverance"
    pve_api_user: "root@pam"
    pve_api_password: "{{ vault_root_passwd }}"
    lxc_container_name: "nextcloud"
    lxc_os_template: "fedora-37"
    lxc_network_bridge: "vmbr0"
    lxc_network_ip_address: "192.168.10.140/24"
    lxc_root_password: "{{ vault_root_passwd }}"
    ansible_ssh_common_args: '-o StrictHostKeyChecking=no -o IdentitiesOnly=yes'
    ansible_user: root
    ansible_ssh_private_key_file: keys/mars.lab
    python_interpreter: python3.9
    tasks:
    • name: Create LXC container on Proxmox
      proxmox:
      node: "{{ inventory_hostname }}"
      api_user: "{{ pve_api_user }}"
      api_host: 'perseverance'
      api_password: "{{ pve_api_password }}"
      vmid: " 140 "
      ostemplate: "{{ lxc_os_template }}"
      hostname: "{{ lxc_container_name }}"
      password: "{{ lxc_root_password }}"
      netif: "name=eth0,bridge={{ lxc_network_bridge }},ip={{ lxc_network_ip_address }}"
      cores: 2
      features:

      • nesting=1
      • mount=cifs,nfs
    • name: Install Nextcloud package in LXC container
      shell: >
      pvesh create /nodes/{{ inventory_hostname }}/lxc/{{ lxc_container_name }}/exec --tty -- /bin/bash -c "dnf -y install nextcloud"

    • name: Start Nextcloud service in LXC container
      shell: >
      pvesh create /nodes/{{ inventory_hostname }}/lxc/{{ lxc_container_name }}/exec --tty -- /bin/bash -c "systemctl start nextcloud"

i got this error :

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: requests.exceptions.ConnectionError: HTTPSConnectionPool(host='%20perseverance%20', port=8006): Max retries exceeded with url: /api2/json/access/ticket (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1b86ec8df0>: Failed to establish a new connection: [Errno -2] Name or service not known')) fatal: [192.168.10.30]: FAILED! => {"changed": false, "msg": "HTTPSConnectionPool(host='%20perseverance%20', port=8006): Max retries exceeded with url: /api2/json/access/ticket (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1b86ec8df0>: Failed to establish a new connection: [Errno -2] Name or service not known'))"}

Do i need to change the https method to ssh ? if yes how ?

Thank you very much for any help.

Regards

Originally created by @Denyreal on GitHub (Feb 21, 2023). Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/136 Originally assigned to: @jhollowe on GitHub. Hi thank you for this great tool. I cannot make it work because i'm dumb : i installed got on ansible controller ansible [core 2.14.2] pip install proxmoxer requests on proxmox : pip install proxmoxer requests i checked if the api works : `curl -k -d 'username=root@pam' --data-urlencode 'password=MYPASSWORD https://192.168.10.30:8006/api2/json/access/ticket ` it works : `pvedaemon[425432]: <root@pam> successful auth for user 'root@pam ` when i'm trying to deploy playbook : [error_proxmoxer.txt](https://github.com/proxmoxer/proxmoxer/files/10798337/error_proxmoxer.txt) --- - hosts: perseverance gather_facts: no vars: inventory_hostname: "perseverance" pve_api_user: "root@pam" pve_api_password: "{{ vault_root_passwd }}" lxc_container_name: "nextcloud" lxc_os_template: "fedora-37" lxc_network_bridge: "vmbr0" lxc_network_ip_address: "192.168.10.140/24" lxc_root_password: "{{ vault_root_passwd }}" ansible_ssh_common_args: '-o StrictHostKeyChecking=no -o IdentitiesOnly=yes' ansible_user: root ansible_ssh_private_key_file: keys/mars.lab python_interpreter: python3.9 tasks: - name: Create LXC container on Proxmox proxmox: node: "{{ inventory_hostname }}" api_user: "{{ pve_api_user }}" api_host: 'perseverance' api_password: "{{ pve_api_password }}" vmid: " 140 " ostemplate: "{{ lxc_os_template }}" hostname: "{{ lxc_container_name }}" password: "{{ lxc_root_password }}" netif: "name=eth0,bridge={{ lxc_network_bridge }},ip={{ lxc_network_ip_address }}" cores: 2 features: - nesting=1 - mount=cifs,nfs - name: Install Nextcloud package in LXC container shell: > pvesh create /nodes/{{ inventory_hostname }}/lxc/{{ lxc_container_name }}/exec --tty -- /bin/bash -c "dnf -y install nextcloud" - name: Start Nextcloud service in LXC container shell: > pvesh create /nodes/{{ inventory_hostname }}/lxc/{{ lxc_container_name }}/exec --tty -- /bin/bash -c "systemctl start nextcloud" i got this error : `An exception occurred during task execution. To see the full traceback, use -vvv. The error was: requests.exceptions.ConnectionError: HTTPSConnectionPool(host='%20perseverance%20', port=8006): Max retries exceeded with url: /api2/json/access/ticket (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1b86ec8df0>: Failed to establish a new connection: [Errno -2] Name or service not known')) fatal: [192.168.10.30]: FAILED! => {"changed": false, "msg": "HTTPSConnectionPool(host='%20perseverance%20', port=8006): Max retries exceeded with url: /api2/json/access/ticket (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1b86ec8df0>: Failed to establish a new connection: [Errno -2] Name or service not known'))"} ` Do i need to change the https method to ssh ? if yes how ? Thank you very much for any help. Regards
kerem 2026-02-27 15:46:16 +03:00
Author
Owner

@jhollowe commented on GitHub (Feb 22, 2023):

As you can see in the error log it is trying to connect to '%20perseverance%20' instead of 'perseverance'. I don't know exactly where the extra spaces are getting added to your hostname, but that seems to be the reason the connection is not working.

If you are not able to figure it out, please ask on the ansible forums as this is not a proxmoxer issue.

<!-- gh-comment-id:1439289206 --> @jhollowe commented on GitHub (Feb 22, 2023): As you can see in the error log it is trying to connect to `'%20perseverance%20'` instead of `'perseverance'`. I don't know exactly where the extra spaces are getting added to your hostname, but that seems to be the reason the connection is not working. If you are not able to figure it out, please ask on the ansible forums as this is not a proxmoxer issue.
Author
Owner

@Denyreal commented on GitHub (Feb 22, 2023):

As i told you i 'm dumb. Thank you very much.

<!-- gh-comment-id:1440528891 --> @Denyreal commented on GitHub (Feb 22, 2023): As i told you i 'm dumb. Thank you very much.
Author
Owner

@jhollowe commented on GitHub (Feb 22, 2023):

You aren't dumb, you are just learning something new. It takes time and experimentation to get complex things like Ansible working correctly.
We were all where you were at once upon a time. Some people are ahead of the learning curve in some topics, and you are ahead of them in other topics.

<!-- gh-comment-id:1440868974 --> @jhollowe commented on GitHub (Feb 22, 2023): You aren't dumb, you are just learning something new. It takes time and experimentation to get complex things like Ansible working correctly. We were all where you were at once upon a time. Some people are ahead of the learning curve in some topics, and you are ahead of them in other topics.
Author
Owner

@Denyreal commented on GitHub (Feb 22, 2023):

Thank you for your support it give me motivation.

<!-- gh-comment-id:1440874054 --> @Denyreal commented on GitHub (Feb 22, 2023): Thank you for your support it give me motivation.
Author
Owner

@Denyreal commented on GitHub (Feb 22, 2023):

i'll try to get some help here

thank you very much.

<!-- gh-comment-id:1440940229 --> @Denyreal commented on GitHub (Feb 22, 2023): i'll try to get some help [here](https://serverfault.com/questions/1123534/ansible-proxmoxer-httpsconnectionpoolhost-perseverance-port-8006) thank you very much.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmoxer#68
No description provided.