Replies: 2 comments 2 replies
-
UPDATE: It looks as every time I run it, it successfully deletes 1 object, and then throws the above error |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi, have to admit, purge is not working as desired. I will remove this functionality in the next version. For testing purposes it is recommended to create a NetBox backup before the sync and then restore this backup if necessary. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
I can sucessfully sync objects from vCenter into netbox using this tool/function. However, when i try to purge so I can try another full sync, I get the below error:
2023-04-11 17:15:05,161 - INFO: Starting NetBox Sync v1.4.0 (2023-03-20)
2023-04-11 17:15:05,191 - INFO: Successfully connected to NetBox 'netboxfqdn'
2023-04-11 17:15:05,191 - INFO: Querying necessary objects from NetBox. This might take a while.
2023-04-11 17:15:08,412 - INFO: Finished querying necessary objects from NetBox
2023-04-11 17:15:08,452 - WARNING: Starting purge now. All objects with the tag 'NetBox-synced' will be deleted!!!
2023-04-11 17:15:08,452 - INFO: IP address 'x.x.x.x/24' will be deleted now
Traceback (most recent call last):
File "/opt/netbox-sync/module/netbox/connection.py", line 262, in request
result = response.json()
File "/opt/netbox-sync/.venv/lib64/python3.6/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib64/python3.6/json/init.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python3.6/json/decoder.py", line 357, 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 "./netbox-sync.py", line 143, in
main()
File "./netbox-sync.py", line 81, in main
nb_handler.just_delete_all_the_things()
File "/opt/netbox-sync/module/netbox/connection.py", line 833, in just_delete_all_the_things
result = self.request(nb_object_sub_class, req_type="DELETE", nb_id=this_object.nb_id)
File "/opt/netbox-sync/module/netbox/connection.py", line 263, in request
except (json.decoder.JSONDecodeError, requests.exceptions.JSONDecodeError):
AttributeError: module 'requests.exceptions' has no attribute 'JSONDecodeError'
Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions