Closed jannikk09 closed 10 months ago
Hi, can you run the sync with -l DEBUG3
and post the output here?
2023-10-26 12:35:31,139 - DEBUG2: NetBox results are paginated. Getting next page
{'_body_position': None,
'_cookies': <RequestsCookieJar[]>,
'body': None,
'headers': {'User-Agent': 'netbox-sync/1.5.1', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Authorization': 'Token b7557275f404b35ac4ff964d3b45e37d75c4ac1e', 'Content-Type': 'application/json'},
'hooks': {'response': []},
'method': 'GET',
'url': 'http://srv-app03.domain.de/api/ipam/ip-addresses/?exclude=config_context&limit=200&offset=200'}
2023-10-26 12:35:31,140 - DEBUG: Starting new HTTP connection (1): srv-app03.domain.de:80
send: b'GET /api/ipam/ip-addresses/?exclude=config_context&limit=200&offset=200 HTTP/1.1\r\nHost: srv-app03.domain.de\r\nUser-Agent: netbox-sync/1.5.1\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\nAuthorization: Token b7557275f404b35ac4ff964d3b45e37d75c4ac1e\r\nContent-Type: application/json\r\n\r\n'
reply: 'HTTP/1.1 404 Not Found\r\n'
header: Date: Thu, 26 Oct 2023 12:35:31 GMT
header: Server: Apache/2.4.52 (Ubuntu)
header: Content-Length: 278
header: Keep-Alive: timeout=5, max=100
header: Connection: Keep-Alive
header: Content-Type: text/html; charset=iso-8859-1
2023-10-26 12:35:31,141 - DEBUG: http://srv-app03.domain.de:80 "GET /api/ipam/ip-addresses/?exclude=config_context&limit=200&offset=200 HTTP/1.1" 404 278
2023-10-26 12:35:31,142 - DEBUG2: Received HTTP Status 404.
2023-10-26 12:35:31,142 - DEBUG: Response Body:
2023-10-26 12:35:31,142 - ERROR: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/netbox-sync/netbox-sync.py", line 143, in <module>
main()
File "/opt/netbox-sync/netbox-sync.py", line 98, in main
nb_handler.query_current_data(source.dependent_netbox_objects)
File "/opt/netbox-sync/module/netbox/connection.py", line 461, in query_current_data
full_nb_data = self.request(nb_object_class)
File "/opt/netbox-sync/module/netbox/connection.py", line 282, in request
result["results"].extend(response.json().get("results"))
File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The stack trace should not appear, I guess this is an issue within the library versioning. Have to test this.
But your webserver says:
reply: 'HTTP/1.1 404 Not Found\r\n'
header: Date: Thu, 26 Oct 2023 12:35:31 GMT
header: Server: Apache/2.4.52 (Ubuntu)
header: Content-Length: 278
Which seems to indicate a Webserver configuration issue.
Could it be because port 80 is not used by the Apache web server?
NetBox is also only on port 443 and not on 8000
Best is to troubleshoot using curl and see if the endpoints are actually reachable as designed. Then you can adjust your configuration accordingly and try another sync.
I just reconfigured my Apache config. The Sync is over HTTP - just added this the config. Now it works
Hello, I followed the instructions and installed the plugin.
The connection to Netbox and vCenter works. Now I have this error:`
Here is my settings.ini: