bb-Ricardo / netbox-sync

Sync objects from VMware or redfish sources to NetBox
MIT License
290 stars 65 forks source link

Problems syncing after upgrade to Netbox-Sync 1.6.1 (Using Netbox 4.08) #407

Closed backlash-code closed 3 months ago

backlash-code commented 3 months ago

2024-08-07 12:09:38,321 - INFO: Querying necessary objects from NetBox. This might take a while. Traceback (most recent call last): File "/opt/netbox-sync/netbox-sync.py", line 146, in 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 521, in query_current_data self.inventory.add_object(nb_object_class, data=object_data, read_from_netbox=True) File "/opt/netbox-sync/module/netbox/inventory.py", line 176, in add_object new_object = object_type(data, read_from_netbox=read_from_netbox, inventory=self, source=source) File "/opt/netbox-sync/module/netbox/object_classes.py", line 1178, in init super().init(*args, **kwargs) File "/opt/netbox-sync/module/netbox/object_classes.py", line 296, in init self.update(data=data, read_from_netbox=read_from_netbox, source=source) File "/opt/netbox-sync/module/netbox/object_classes.py", line 1199, in update for object_type in data.get("object_types"): TypeError: 'NoneType' object is not iterable

No .ini changes has been made, the netbox upgrade was made initially.

backlash-code commented 3 months ago

Netbox was upgraded from 3.7.1 to 4.0.8 in the same process, but everything seems to work as expected. Now all sync-jobs is failing (different vc and esxi). Could it be changes to netbox db/structure ?

backlash-code commented 3 months ago

Found another thread from 2020 mentioning disable caching as an option: use_caching = false;

Looks like it "fixes" the above error, but I guess this its just a workaround, since enabling after successfull run doesn't fix the issue.

bb-Ricardo commented 3 months ago

Hi, Can you delete the cache and then try to sync again?

backlash-code commented 3 months ago

Doh! Sorry .. Looks like it solved the problem ;) Thanks.

bb-Ricardo commented 3 months ago

Anyway. I need to fix this behavior as it's not convenient to the user.

backlash-code commented 3 months ago

Yeah, you're right - thanks you for the tool and your efforts ;)