Circuits. Get an error with a long name. #90

Closed
opened 2025-12-29 15:32:14 +01:00 by adam · 3 comments
Owner

Originally created by @laetrid on GitHub (Jun 29, 2016).

Firstly thanks for this awesome project :) and for Cheat Sheets ;)

Here is my problem:
I tried to create circuit with a pretty long name:
TL2-902011-1.RU.ANT.5A-RU.MSK.M9A​
And got an error:
"Server Error
There was a problem with your request. This error has been logged and administrative staff have been notified. Please return to the home page and try again."

Circuit was created, but if I tried to enter it or delete it I get the same error.

I can not find where is netbox logs located, so I can not provide more info on this error.
But it is reproducible.

Originally created by @laetrid on GitHub (Jun 29, 2016). Firstly thanks for this awesome project :) and for Cheat Sheets ;) Here is my problem: I tried to create circuit with a pretty long name: TL2-902011-1.RU.ANT.5A-RU.MSK.M9A​ And got an error: "Server Error There was a problem with your request. This error has been logged and administrative staff have been notified. Please return to the home page and try again." Circuit was created, but if I tried to enter it or delete it I get the same error. I can not find where is netbox logs located, so I can not provide more info on this error. But it is reproducible.
adam closed this issue 2025-12-29 15:32:15 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jun 29, 2016):

Well, this is strange. The problem isn't the length, but rather that there's some invisible junk hanging off the end of that string. I copied and pasted the circuit name you provided:

>>> name="TL2-902011-1.RU.ANT.5A-RU.MSK.M9A​"
>>> name
'TL2-902011-1.RU.ANT.5A-RU.MSK.M9A\xe2\x80\x8b'

This causes an issue in the circuit's __unicode__ method. I don't know how to prevent this from happening, but if you delete and recreate the circuit with a clean string it should be fine.

@jeremystretch commented on GitHub (Jun 29, 2016): Well, this is strange. The problem isn't the length, but rather that there's some invisible junk hanging off the end of that string. I copied and pasted the circuit name you provided: ``` >>> name="TL2-902011-1.RU.ANT.5A-RU.MSK.M9A​" >>> name 'TL2-902011-1.RU.ANT.5A-RU.MSK.M9A\xe2\x80\x8b' ``` This causes an issue in the circuit's `__unicode__` method. I don't know how to prevent this from happening, but if you delete and recreate the circuit with a clean string it should be fine.
Author
Owner

@jeremystretch commented on GitHub (Jun 29, 2016):

I just realized this circuit can't be deleted even through the admin UI because it tries to evaluate __unicode__ on the confirmation page and yields the same error.

To delete it, hover over the link to it in the circuits list and make a note of its numeric primary key. Then, run ./netbox/manage.py shell and paste in the following:

from circuits.models import Circuit
Circuit.objects.get(pk=<PK>).delete()
@jeremystretch commented on GitHub (Jun 29, 2016): I just realized this circuit can't be deleted even through the admin UI because it tries to evaluate `__unicode__` on the confirmation page and yields the same error. To delete it, hover over the link to it in the circuits list and make a note of its numeric primary key. Then, run `./netbox/manage.py shell` and paste in the following: ``` from circuits.models import Circuit Circuit.objects.get(pk=<PK>).delete() ```
Author
Owner

@laetrid commented on GitHub (Jun 30, 2016):

Thanks, I can delete it from shell.
It seems there is a problem with the last symbol if I insert string then delete last symbol and retype it Circuit created without a problem.
In shell is also good:

>>> name = 'TL2-902011-1.RU.ANT.5A-RU.MSK.M9A'
>>> name
'TL2-902011-1.RU.ANT.5A-RU.MSK.M9A'

So the problem was in messed string.
Thank you for help!

@laetrid commented on GitHub (Jun 30, 2016): Thanks, I can delete it from shell. It seems there is a problem with the last symbol if I insert string then delete last symbol and retype it Circuit created without a problem. In shell is also good: ``` >>> name = 'TL2-902011-1.RU.ANT.5A-RU.MSK.M9A' >>> name 'TL2-902011-1.RU.ANT.5A-RU.MSK.M9A' ``` So the problem was in messed string. Thank you for help!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#90