Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] mac address #451

Open
Geekul opened this issue Jan 31, 2025 · 9 comments
Open

[Bug] mac address #451

Geekul opened this issue Jan 31, 2025 · 9 comments
Assignees
Labels
bug Something isn't working iosxe ios-xe source vmware Vmware source

Comments

@Geekul
Copy link

Geekul commented Jan 31, 2025

Is this urgent?

No

How are you running netbox-ssot?

Docker

What is the version of netbox-ssot

latest: main or develop tag

Which module has the issue?

IOS-XE

Share your configuration

ource:
  - name: MLS-DC
    type: ios-xe
    hostname: a.b.c.d
    username: user
    password: pass
    port: 830
    validateCert: False
    hostTenantRelations:
      - .* = MyTenant
    hostSiteRelations:
      - .* = DC
    vlanTenantRelations:
      - .* = MyTenant
    collectArpData:
      true

What is the problem?

2025/01/31 11:29:44 main.go:117 ERROR (MLS-DC): create mac address for object type: add mac address MACAddress{MAC: 00:D6:FE:25:D9:06}: unexpected status code: 400: {"assigned_object_id":["This field cannot be null."]}
2025/01/31 11:29:44 main.go:136 INFO (main): Skipping removing orphaned objects because run failed...

Steps to reproduce

docker run

What did you expect to happen?

n/n

What actually happened?

n/a

Share DEBUG-level logs (remove sensitive information)


Share your environment details

Ubuntu 24.04

@Geekul Geekul changed the title [Bug] <title> [Bug] mac address Jan 31, 2025
@bl4ko bl4ko self-assigned this Jan 31, 2025
@bl4ko bl4ko added bug Something isn't working iosxe ios-xe source labels Jan 31, 2025
@bl4ko
Copy link
Owner

bl4ko commented Jan 31, 2025

Hello, unfortunately I can't reproduce this. Can you also include the log before, where interfaces are created (obviously without sensitive information)?

@Geekul
Copy link
Author

Geekul commented Jan 31, 2025

Hello,

13:40:39 main.go:102         INFO    (MLS-DC): Initializing source
2025/01/31 13:40:43 iosxe.go:144        INFO    (MLS-DC): Successfully initialized DeviceInfo in 0.041266 seconds
2025/01/31 13:40:58 iosxe.go:144        INFO    (MLS-DC): Successfully initialized Interfaces in 15.051749 seconds
2025/01/31 13:40:58 iosxe.go:144        INFO    (MLS-DC): Successfully initialized ArpData in 0.390724 seconds
2025/01/31 13:40:58 main.go:110         INFO    (MLS-DC): Successfully initialized source ✓
2025/01/31 13:40:58 main.go:113         INFO    (MLS-DC): Syncing source...
2025/01/31 13:40:58 add_items.go:717    DEBUG   (MLS-DC): Manufacturer Cisco already exists in Netbox and is up to date...
2025/01/31 13:40:58 add_items.go:772    DEBUG   (MLS-DC): Device type Generic Model already exists in Netbox and is up to date...
2025/01/31 13:40:58 add_items.go:659    DEBUG   (MLS-DC): Device role Switch already exists in Netbox and is up to date...
2025/01/31 13:40:58 add_items.go:828    DEBUG   (MLS-DC): Platform IOS-XE already exists in Netbox and is up to date...
2025/01/31 13:40:58 add_items.go:884    DEBUG   (MLS-DC): Device WS-MLS-DC already exists in Netbox and is up to date...
2025/01/31 13:40:58 iosxe.go:163        INFO    (MLS-DC): Successfully synced Device in 0.000461 seconds
2025/01/31 13:40:58 add_items.go:1114   DEBUG   (MLS-DC): Interface GigabitEthernet1/0/9 already exists in Netbox and is up to date...
2025/01/31 13:40:58 add_items.go:1386   DEBUG   (MLS-DC): MAC address 00:CC:FC:84:A9:89 does not exist in Netbox. Creating it...
2025/01/31 13:40:58 rest.go:164         DEBUG   (MLS-DC): Creating objects.MACAddress with path /api/dcim/mac-addresses/ with data: MACAddress{MAC: 00:CC:FC:84:A9:89}
2025/01/31 13:40:58 main.go:117         ERROR   (MLS-DC): create mac address for object type: add mac address MACAddress{MAC: 00:CC:FC:84:A9:89}: unexpected status code: 400: {"assigned_object_id":["This field cannot be null."]}
2025/01/31 13:40:58 main.go:136         INFO    (main): Skipping removing orphaned objects because run failed...
2025/01/31 13:40:58 main.go:146         INFO    (main): ⚠ syncing of source MLS-DC failed

Thanks

@Geekul
Copy link
Author

Geekul commented Jan 31, 2025

v1.9.0-v1.9.3

2025/01/31 15:30:03 add_items.go:1337 DEBUG (vmware): MAC address 24:6E:96:52:2E:C0 does not exist in Netbox. Creating it...
2025/01/31 15:30:03 rest.go:164 DEBUG (vmware): Creating objects.MACAddress with path /api/dcim/mac-addresses/ with data: MACAddress{MAC: 24:6E:96:52:2E:C0}
2025/01/31 15:30:03 main.go:117 ERROR (vmware): failed to sync vmware host xxxx nics with error: physical interfaces sync: create mac address for object type: add mac address MACAddress{MAC: 24:6E:96:52:2E:C0}: unexpected status code: 400: {"assigned_object_id":["This field cannot be null."]}
2025/01/31 15:30:03 main.go:136 INFO (main): Skipping removing orphaned objects because run failed...
2025/01/31 15:30:03 main.go:146 INFO (main): ⚠ syncing of source vmware failed

with v1.8.14
2025/01/31 15:35:55 main.go:134 INFO (main): ✓ Successfully removed orphans
2025/01/31 15:35:55 main.go:143 INFO (main): 🚀 Syncing took 3 min 27 sec in total

I think the problem comes from 41ce5c5

@Geekul
Copy link
Author

Geekul commented Feb 5, 2025

Hello,
The problem described above applies to the VMware and iOSXE sources.
Thanks

@bl4ko bl4ko added the vmware Vmware source label Feb 5, 2025
@bl4ko
Copy link
Owner

bl4ko commented Feb 5, 2025

I have added more verbose logs, could you rerun develop version again?

@Geekul
Copy link
Author

Geekul commented Feb 5, 2025

Hello,

2025/02/05 12:36:10 rest.go:152         DEBUG   (MLS-DC): Successfully patched objects.DeviceRole: DeviceRole{Name: Switch}
2025/02/05 12:36:10 add_items.go:831    DEBUG   (MLS-DC): Platform IOS-XE does not exist in Netbox. Creating it...
2025/02/05 12:36:10 rest.go:164         DEBUG   (MLS-DC): Creating objects.Platform with path /api/dcim/platforms/ with data: Platform{Name: IOS-XE, Manufacturer: Manufacturer{Name: Cisco}}
2025/02/05 12:36:10 rest.go:192         DEBUG   (MLS-DC): Successfully created objects.Platform: Platform{Name: IOS-XE, Manufacturer: Manufacturer{Name: Cisco}}
2025/02/05 12:36:10 add_items.go:887    DEBUG   (MLS-DC): Device MLS-DC does not exist in Netbox. Creating it...
2025/02/05 12:36:10 rest.go:164         DEBUG   (MLS-DC): Creating objects.Device with path /api/dcim/devices/ with data: Device{Name: MLS-DC, Type: DeviceType{Manufacturer: Cisco, Model: Generic Model}, Role: DeviceRole{Name: Switch}, Site: Site{Name: DefaultSite}}
2025/02/05 12:36:10 rest.go:192         DEBUG   (MLS-DC): Successfully created objects.Device: Device{Name: MLS-DC, Type: DeviceType{Manufacturer: Cisco, Model: Generic Model}, Role: DeviceRole{Name: Switch}, Site: Site{Name: DefaultSite}}
2025/02/05 12:36:10 iosxe.go:163        INFO    (MLS-DC): Successfully synced Device in 0.610926 seconds
2025/02/05 12:36:10 add_items.go:1117   DEBUG   (MLS-DC): Interface GigabitEthernet1/0/38 does not exist in Netbox. Creating it...
2025/02/05 12:36:10 rest.go:164         DEBUG   (MLS-DC): Creating objects.Interface with path /api/dcim/interfaces/ with data: Interface{Name: GigabitEthernet1/0/38, Device: MLS-DC, Type: 1000BASE-T (1GE)}
2025/02/05 12:36:10 rest.go:192         DEBUG   (MLS-DC): Successfully created objects.Interface: Interface{Name: GigabitEthernet1/0/38, Device: MLS-DC, Type: 1000BASE-T (1GE)}
2025/02/05 12:36:10 add_items.go:1387   DEBUG   (MLS-DC): MAC address 00:CC:FC:84:A9:A6 does not exist in Netbox. Creating it...
2025/02/05 12:36:10 rest.go:164         DEBUG   (MLS-DC): Creating objects.MACAddress with path /api/dcim/mac-addresses/ with data: MACAddress{MAC: 00:CC:FC:84:A9:A6, AssignedObjectType: dcim.interface, AssignedObjectID: 1}
2025/02/05 12:36:10 main.go:117         ERROR   (MLS-DC): create mac address for object type: add mac address MACAddress{MAC: 00:CC:FC:84:A9:A6, AssignedObjectType: dcim.interface, AssignedObjectID: 1} for interface Interface{Name: GigabitEthernet1/0/38, Device: MLS-DC, Type: 1000BASE-T (1GE)}: unexpected status code: 400: {"assigned_object_id":["This field cannot be null."]}
2025/02/05 12:36:10 main.go:136         INFO    (main): Skipping removing orphaned objects because run failed...
2025/02/05 12:36:10 main.go:152         INFO    (main): ⚠ syncing of source vmware failed
2025/02/05 12:36:10 main.go:152         INFO    (main): ⚠ syncing of source MLS-DC failed

Thanks

@bl4ko
Copy link
Owner

bl4ko commented Feb 5, 2025

Which netbox version are you running?

@Geekul
Copy link
Author

Geekul commented Feb 5, 2025

Which netbox version are you running?

4.2.1

@bl4ko
Copy link
Owner

bl4ko commented Feb 5, 2025

Could you maybe try 4.2.2.

I actually have no idea why this happens, I also can't reproduce it on my 4.2.2 instance, but I have seen there were some mac address fixes in 4.2.2: netbox-community/netbox#18363.

Fixes like this also make my microservice uncompatible between patch versions, since it completely relies on API functionalities 😞 ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working iosxe ios-xe source vmware Vmware source
Projects
None yet
Development

No branches or pull requests

2 participants