Issue with CablePath.DoesNotExist after upgrade from NetBox 2.10.10 to 2.11.x

923 views
Skip to first unread message

Igor Rozkov

unread,
Jun 7, 2021, 5:23:57 AM6/7/21
to NetBox
After upgrade from 2.10.10 to 2.11.3 or 2.11.4 we got some strange behaviour on DELETE for most of the cables which terminate circuits. Specifically, we receive API response  HTTP/1.1 204 No Content as for OK delete but cable remains in NetBox, i.e. can be retrieved with GET and is shown in UI. Tried to delete via UI for a couple of such cables - deleted OK. When tried to upgrade 2.10.10 -> 2.11.6 same applies, but now both API and UI return an error:

API:
{
  "error": "CablePath matching query does not exist.",
  "exception": "DoesNotExist",
  "netbox_version": "2.11.6",
  "python_version": "3.7.10"
}

UI:
<class 'dcim.models.cables.CablePath.DoesNotExist'>
CablePath matching query does not exist.

I'm not a good in Django, but the table itself does exist (dcim_cablepath), so maybe something goes wrong with migration script (no errors though for upgrade steps)...

Any ideas what can be looked for to solve this problem?

Best,

Igor

HNL Network

unread,
Jun 8, 2021, 11:52:07 AM6/8/21
to NetBox
Same error on 2.11.5 deleting the cable, deleting the interface, the circuit and deleting the firewall itself.

<class 'dcim.models.cables.CablePath.DoesNotExist'>
CablePath matching query does not exist. 
Python version: 3.8.5 
NetBox version: 2.11.5

Jeremy Stretch

unread,
Jun 8, 2021, 3:43:15 PM6/8/21
to HNL Network, NetBox
Without a detailed accounting of your deployment and the steps you took to upgrade, I'm afraid there's not much help anyone can offer.

Try rebuilding the cable paths with "manage.py trace_paths --force". This will force a rebuild of all paths, and should resolve any discrepancies lingering from a failed upgrade.

Jeremy Stretch
Distinguished Engineer, NS1
Office of the CTO
 
website: ns1.com
email: jstretch@ns1.com
 
twitterlinkedin
 
banner


--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/a3555cde-2126-4966-a152-08aaa177ad2dn%40googlegroups.com.

Igor Rozkov

unread,
Jun 9, 2021, 2:40:00 AM6/9/21
to NetBox

Thanks Jeremy,

cable retrace makes no difference.
I believe this issue has to be linked to the recent changes to circuits where you have to get cable termination data indirectly, and maybe this leads to some cable tracing misses, also that is just a guess...

As fo upgrade, we do very same procedure when we see any data or API changes announced - we replicate data from prod into dev/test environment and run our API calls against data we have.

Base upgrade steps:
1) build target version NetBox docker image (pull source from gir for that)
2) prod: pg_dump ... > data / dev: psql .... < data
3) run all manage.py calls from upgrade.sh; run manage.py createsuperuser
4) restart; run our API calls/tests

Unfortunately I have no good idea how to reproduce this on empty database, we see this problem not for all but for most of the cables with circuit termination involved, whilst interface termination only cables all seems to work as expected...

Thanks again,

Igor

Alex Nidetch

unread,
Jun 11, 2021, 2:05:05 PM6/11/21
to NetBox
Hey Jeremy,

I have run into the same issue:

<class 'dcim.models.cables.CablePath.DoesNotExist'>
CablePath matching query does not exist. 
 Python version: 3.6.8 
NetBox version: 2.11.6

My upgrade path has been basically following every minor update into every major update.

Thanks,
Alex

Igor Rozkov

unread,
Jun 17, 2021, 9:10:54 AM6/17/21
to NetBox

Andrey Kornienko

unread,
Jun 21, 2021, 10:09:12 AM6/21/21
to NetBox
Hi all,
Update on this issue.
It seems 2.11.7 resolves the original problem when you couldn't delete the cable which terminates a circuit.
But with 2.11.7 you now can't re-add a new cable with exactly same A-end / B-end as deleted one.
(think of scenario when you accidentally deleted the cable and want to add it again)

To reproduce the issue:
1. Add a circuit
2. Add circuit termination Z side ( I didn't add Termination A side)
3. Termination -> Connect -> Interface. Fill in details (lets say Switch1 and Port1)
4. Once cable added, try to "disconnect" it (this should be successful)
5. Try to add the cable again and connect it to exactly same device/port (Switch1 Port1)
6. Netbox throws this error:
<class 'dcim.models.cables.Cable.DoesNotExist'> 
 Cable matching query does not exist.
Python version: 3.6.8 NetBox version: 2.11.7

Workaround:
When you re-add the cable, specify another port on your device , e.g. Switch1 Port2
Then delete this cable.
Add it again, now with your original port where you want it to be, e.g.  Switch1 Port1

Thanks,
Andrey

Igor Rozkov

unread,
Jun 21, 2021, 10:46:13 AM6/21/21
to NetBox
There is another bug in 2.11.7 with cables, maybe both somehow relate.
If you delete cable which connects two interface on different  devices (talking API actions, not tested in UI) and then will try to add it to the new just created interface on a new just created device it goes with error 'Cable matching query does not exist'. Full response and data for a new cable POST query as example:

{
    "error": "Cable matching query does not exist.",
    "exception": "DoesNotExist",
    "netbox_version": "2.11.7",
    "python_version": "3.7.10"
}
stdClass Object
(
    [termination_a_type] => dcim.interface
    [termination_a_id] => 6380
    [termination_b_type] => dcim.interface
    [termination_b_id] => 41235
 ...
)

Sure, both interfaces exist at the moment (id's 6380 & 41235)
To solve this problem you can either do 1) manage.py invalidate all just before execution POST or 2) disable cache in config (CACHE_TIMEOUT = 0) - both workarounds are not suitable for production

/IR

Jack Bennett

unread,
Jul 5, 2021, 6:22:07 AM7/5/21
to NetBox
Just deleted a cable from an interface to a rear port, Now I cannot create any new cable between any interface/front+rear port on any device.

docker-compose. Only been planning my network for a week this isn't a heavily used DB
<class 'dcim.models.cables.Cable.DoesNotExist'>
Cable matching query does not exist. Python version: 3.8.10 NetBox version: 2.11.7

fixed by:
/opt/netbox/venv/bin/python ./manage.py invalidate all

not by rebuild_prefixes or trace_paths albeit I forgot to use --force.

Brian Candler

unread,
Jul 5, 2021, 7:14:03 AM7/5/21
to NetBox
Known issue with caching: can be resolved by turning off query caching (CACHE_TIMEOUT = 0)
Reply all
Reply to author
Forward
0 new messages