Open lTomBackl opened 2 months ago
Hi @lTomBackl,
can it be, that you redirect to https? I had the same error, when using the wrong non https URI.
best wishes Elias
Hi @lTomBackl,
can it be, that you redirect to https? I had the same error, when using the wrong non https URI.
best wishes Elias
Hello @eliaswimmer,
thank you for your reply.
The netbox api URL is set as an environment variable, and it's set as https://... We are also using nb_inventory, which works fine. Only the ansible netbox modules have issues.
Our netbox instance is running as a docker container, below are the logs when I execute the above mentioned playbook:
netbox-1 | ::1 - - [03/Oct/2024:11:19:37 +0000] "GET /login/ HTTP/1.1" 200 3260 "-" "curl/8.5.0"
netbox-1 | 2024/10/03 11:19:38 [info] 673688#673688 "netbox" application started
netbox-1 | 192.168.1.2 - - [03/Oct/2024:11:19:38 +0000] "GET /api/dcim/locations/?limit=0 HTTP/1.1" 200 10464 "-" "ansible 2.16.11 Python 3.12.6"
netbox-1 | 192.168.1.2 - - [03/Oct/2024:11:19:38 +0000] "GET /api/dcim/regions/?limit=0 HTTP/1.1" 200 2692 "-" "ansible 2.16.11 Python 3.12.6"
netbox-1 | 192.168.1.2 - - [03/Oct/2024:11:19:38 +0000] "GET /api/dcim/sites/?limit=0 HTTP/1.1" 200 174805 "-" "ansible 2.16.11 Python 3.12.6"
netbox-1 | 192.168.1.2 - - [03/Oct/2024:11:19:38 +0000] "GET /api/dcim/site-groups/?limit=0 HTTP/1.1" 200 2047 "-" "ansible 2.16.11 Python 3.12.6"
netbox-1 | 192.168.1.2 - - [03/Oct/2024:11:19:38 +0000] "GET /api/tenancy/tenants/?limit=0 HTTP/1.1" 200 40826 "-" "ansible 2.16.11 Python 3.12.6"
netbox-1 | 192.168.1.2 - - [03/Oct/2024:11:19:38 +0000] "GET /api/dcim/device-roles/?limit=0 HTTP/1.1" 200 6355 "-" "ansible 2.16.11 Python 3.12.6"
netbox-1 | 192.168.1.2 - - [03/Oct/2024:11:19:38 +0000] "GET /api/virtualization/virtual-disks/?limit=0 HTTP/1.1" 200 10300 "-" "ansible 2.16.11 Python 3.12.6"
netbox-1 | 192.168.1.2 - - [03/Oct/2024:11:19:38 +0000] "GET /api/dcim/platforms/?limit=0 HTTP/1.1" 200 23562 "-" "ansible 2.16.11 Python 3.12.6"
netbox-1 | 192.168.1.2 - - [03/Oct/2024:11:19:38 +0000] "GET /api/ipam/services/?limit=0 HTTP/1.1" 200 52 "-" "ansible 2.16.11 Python 3.12.6"
netbox-1 | 192.168.1.2 - - [03/Oct/2024:11:19:38 +0000] "GET /api/dcim/manufacturers/?limit=0 HTTP/1.1" 200 11807 "-" "ansible 2.16.11 Python 3.12.6"
netbox-1 | 192.168.1.2 - - [03/Oct/2024:11:19:38 +0000] "GET /api/dcim/racks/?limit=0 HTTP/1.1" 200 65713 "-" "ansible 2.16.11 Python 3.12.6"
netbox-1 | 192.168.1.2 - - [03/Oct/2024:11:19:38 +0000] "GET /api/virtualization/clusters/?limit=0 HTTP/1.1" 200 2637 "-" "ansible 2.16.11 Python 3.12.6"
netbox-1 | 192.168.1.2 - - [03/Oct/2024:11:19:38 +0000] "GET /api/dcim/device-types/?limit=0 HTTP/1.1" 200 159835 "-" "ansible 2.16.11 Python 3.12.6"
netbox-1 | ::1 - - [03/Oct/2024:11:19:52 +0000] "GET /login/ HTTP/1.1" 200 3260 "-" "curl/8.5.0"
netbox-1 | 192.168.1.2 - - [03/Oct/2024:11:19:53 +0000] "GET /api/ HTTP/1.1" 403 58 "-" "python-requests/2.32.3"
netbox-1 | 192.168.1.2 - - [03/Oct/2024:11:19:53 +0000] "GET /api/status/ HTTP/1.1" 200 549 "-" "python-requests/2.32.3"
netbox-1 | ::1 - - [03/Oct/2024:11:20:08 +0000] "GET /login/ HTTP/1.1" 200 3260 "-" "curl/8.5.0"
Almost every request gets a 200, except for the "/api/" one, which gets a 403.
After reading your answer I did some further research and stumbled across this. We are also using a reverse proxy in front of netbox, could this be the issue?
pynetbox version is 7.4.0
Thanks for any further help
Tom
Ansible NetBox Collection version
v3.20.0
Ansible version
ansible [core 2.16.11] config file = /work/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.12/site-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible python version = 3.12.6 (main, Sep 11 2024, 08:48:26) [GCC 13.2.1 20240309] (/usr/bin/python3) jinja version = 3.1.4 libyaml = True
NetBox version
v4.1.1
Python version
3.11
Steps to Reproduce
Exception when running the following playbook to create a VM:
I do also use nb_inventory without any issues.
Could it be, that there is a version check issue -> observed error:
... netbox_utils.py", line 782, in _version_check_greater ValueError: not enough values to unpack (expected 2, got 1)
Thank you
Expected Behavior
create a vm object in netbox
Observed Behavior