netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
16.35k stars 2.6k forks source link

Cable bulk import when importing circuit terminations #17954

Open Sergii-Lucky opened 2 weeks ago

Sergii-Lucky commented 2 weeks ago

Deployment Type

Self-hosted

Triage priority

I volunteer to perform this work (if approved)

NetBox Version

v.4.1.6

Python Version

3.12

Steps to Reproduce

When trying to use the bulk cable import feature to import cables with circuit terminations, I'm getting the error "Record 1 side_a_device: Object not found:397718".

To reproduce: I have an existing device NTT-ODF1 with a port X01. I have an existing circuit, 397718 and I'm trying to connect to Termination A

Import data: side_a_device,side_a_type,side_a_name,side_b_device,side_b_type,side_b_name 397718,circuits.circuittermination,A,NTT-ODF1,dcim.rearport,X01

Expected Behavior

Should be able to import cables connected to circuit terminations.

Observed Behavior

Screenshot 2024-11-07 at 16 50 17 Screenshot 2024-11-07 at 16 46 55 Screenshot 2024-11-07 at 16 46 22
jsenecal commented 2 weeks ago

I noticed the same today. I have found the culprit and would be willing to submit a fix for it @bctiemann @Sergii-Lucky,

_clean_side is missing the use-case of circuitterminations and this could probably be added easily.

If @Sergii-Lucky would like me to take this issue, just let me know and I'll start working on a fix.

Sergii-Lucky commented 2 weeks ago

@jsenecal Yes, of course. Let me know if you need additional information or any help from my side.

jeremystretch commented 2 weeks ago

Thanks @jsenecal, I've assigned this to you.

sleepinggenius2 commented 2 weeks ago

While this is being fixed for circuit terminations, I believe there is currently a similar issue for Power Feed type terminations, which should probably also be addressed.

jsenecal commented 1 week ago

While this is being fixed for circuit terminations, I believe there is currently a similar issue for Power Feed type terminations, which should probably also be addressed.

This is another issue with a similar fix. Can you link the issue so I can submit a different PR @sleepinggenius2 ?

sleepinggenius2 commented 1 week ago

I'm not aware of a Github issue opened for that at this time. Can it be included as part of this one or should I open a new one and link it here?

Sergii-Lucky commented 1 week ago

I'm not aware of a Github issue opened for that at this time. Can it be included as part of this one or should I open a new one and link it here?

Please open a new one. I am not sure if it's necessary to link it here.

sleepinggenius2 commented 1 week ago

I have opened #18008 for the power feed use case.

jsenecal commented 4 days ago

@jeremystretch, not sure if you noticed but I submitted a PR for this bug