Error when trying to navigate to organization > tags #2521

Closed
opened 2025-12-29 18:19:37 +01:00 by adam · 10 comments
Owner

Originally created by @ghost on GitHub (Apr 17, 2019).

Environment

  • Python version: 3.5.2
  • NetBox version: 2.5.10 (but was noticed in 2.5.3 also)

Steps to Reproduce

  1. Login to Netbox
  2. Click Organization tab
  3. Click Tags

What did you expect to happen?

tags to be listed / shown

What happened instead?

error message received, see attached image/below;

<class 'django.urls.exceptions.NoReverseMatch'>

Reverse for 'tag' with arguments '('',)' not found. 1 pattern(s) tried: ['extras/tags/(?P[\w-]+)/$']
error

Originally created by @ghost on GitHub (Apr 17, 2019). ### Environment * Python version: 3.5.2 * NetBox version: 2.5.10 (but was noticed in 2.5.3 also) ### Steps to Reproduce 1. Login to Netbox 2. Click Organization tab 3. Click Tags ### What did you expect to happen? tags to be listed / shown ### What happened instead? error message received, see attached image/below; <class 'django.urls.exceptions.NoReverseMatch'> Reverse for 'tag' with arguments '('',)' not found. 1 pattern(s) tried: ['extras/tags/(?P<slug>[\\w-]+)/$'] <img width="491" alt="error" src="https://user-images.githubusercontent.com/43499880/56298196-a3baea00-6129-11e9-80a9-a6334c10f806.PNG">
adam closed this issue 2025-12-29 18:19:37 +01:00
Author
Owner

@jeremystretch commented on GitHub (Apr 17, 2019):

I'm not able to reproduce this on v2.5.10. Looks like it may be a problem with one of your tags. Try this on the console and see if anything is missing a slug:

$ ./manage.py nbshell
>>> for tag in Tag.objects.all():
...   print('{} ({}): {}'.format(tag.name, tag.pk, tag.slug))

This will dump a list of all the tags you have defined and the PK and slug for each.

@jeremystretch commented on GitHub (Apr 17, 2019): I'm not able to reproduce this on v2.5.10. Looks like it may be a problem with one of your tags. Try this on the console and see if anything is missing a slug: ``` $ ./manage.py nbshell >>> for tag in Tag.objects.all(): ... print('{} ({}): {}'.format(tag.name, tag.pk, tag.slug)) ``` This will dump a list of all the tags you have defined and the PK and slug for each.
Author
Owner

@ghost commented on GitHub (Apr 17, 2019):

Hi Jeremy,

I'm unable to run that command, any ideas?

/opt/netbox/netbox$ ./manage.py nbshell
Traceback (most recent call last):
  File "./manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
@ghost commented on GitHub (Apr 17, 2019): Hi Jeremy, I'm unable to run that command, any ideas? ``` /opt/netbox/netbox$ ./manage.py nbshell Traceback (most recent call last): File "./manage.py", line 8, in <module> from django.core.management import execute_from_command_line ImportError: No module named django.core.management ```
Author
Owner

@jeremystretch commented on GitHub (Apr 17, 2019):

Try python3 manage.py nbshell. (You'll also need to activate the virtualenv first if you're using one.)

@jeremystretch commented on GitHub (Apr 17, 2019): Try `python3 manage.py nbshell`. (You'll also need to activate the virtualenv first if you're using one.)
Author
Owner

@ghost commented on GitHub (Apr 23, 2019):

Hi Jeremy,

Thank you, that worked, however here is the output I'm getting;

>>> print('{} ({}): {}'.format(tag.name, tag.pk, tag.slug))
Traceback (most recent call last):
  File "/usr/lib/python3.5/code.py", line 91, in runcode
    exec(code, self.locals)
  File "<console>", line 1, in <module>
NameError: name 'tag' is not defined
@ghost commented on GitHub (Apr 23, 2019): Hi Jeremy, Thank you, that worked, however here is the output I'm getting; ``` >>> print('{} ({}): {}'.format(tag.name, tag.pk, tag.slug)) Traceback (most recent call last): File "/usr/lib/python3.5/code.py", line 91, in runcode exec(code, self.locals) File "<console>", line 1, in <module> NameError: name 'tag' is not defined ```
Author
Owner

@jeremystretch commented on GitHub (Apr 27, 2019):

You need to run both lines of code. The whole thing:

for tag in Tag.objects.all():
    print('{} ({}): {}'.format(tag.name, tag.pk, tag.slug))
@jeremystretch commented on GitHub (Apr 27, 2019): You need to run both lines of code. The whole thing: ``` for tag in Tag.objects.all(): print('{} ({}): {}'.format(tag.name, tag.pk, tag.slug)) ```
Author
Owner

@ghost commented on GitHub (Apr 29, 2019):

Hi Jeremy,

When running those lines it doesn't give me a list of tags, it just sends me to a new line - where if I hit enter it does the following;

>>> for tag in Tag.objects.all():
...     print('{} ({}): {}'.format(tag.name, tag.pk, tag.slug))
...
Traceback (most recent call last):
  File "/usr/lib/python3.5/code.py", line 91, in runcode
    exec(code, self.locals)
  File "<console>", line 1, in <module>
NameError: name 'Tag' is not defined
>>> for tag in Tag.objects.all():
...     print('{} ({}): {}'.format(tag.name, tag.pk, tag.slug))
...
Traceback (most recent call last):
  File "/usr/lib/python3.5/code.py", line 91, in runcode
    exec(code, self.locals)
  File "<console>", line 1, in <module>
NameError: name 'Tag' is not defined

is there something additional I should be doing?

@ghost commented on GitHub (Apr 29, 2019): Hi Jeremy, When running those lines it doesn't give me a list of tags, it just sends me to a new line - where if I hit enter it does the following; ``` >>> for tag in Tag.objects.all(): ... print('{} ({}): {}'.format(tag.name, tag.pk, tag.slug)) ... Traceback (most recent call last): File "/usr/lib/python3.5/code.py", line 91, in runcode exec(code, self.locals) File "<console>", line 1, in <module> NameError: name 'Tag' is not defined >>> for tag in Tag.objects.all(): ... print('{} ({}): {}'.format(tag.name, tag.pk, tag.slug)) ... Traceback (most recent call last): File "/usr/lib/python3.5/code.py", line 91, in runcode exec(code, self.locals) File "<console>", line 1, in <module> NameError: name 'Tag' is not defined ``` is there something additional I should be doing?
Author
Owner

@jeremystretch commented on GitHub (Apr 29, 2019):

I'm sorry but at this point I have to direct you to the mailing list for assistance as the issue raised does not seem to be a reproducible bug.

@jeremystretch commented on GitHub (Apr 29, 2019): I'm sorry but at this point I have to direct you to the [mailing list](https://groups.google.com/forum/#!forum/netbox-discuss) for assistance as the issue raised does not seem to be a reproducible bug.
Author
Owner

@k109x commented on GitHub (Jun 22, 2019):

hello there. the same problem at versions: 2.5.13, 2.6.0

for tag in Tag.objects.all(): print('{} ({}): {}'.format(tag.name, tag.pk, tag.slug))
...
rxtel (1): rxtel
sea-ix (2): sea-ix
megafon (3): megafon
beeline (4): beeline
ttk (5): ttk
vpn (6): vpn
Времянка (7):
Бардак (9): _1

Maybe, I should drop "broken" tags? How to do it?

@k109x commented on GitHub (Jun 22, 2019): hello there. the same problem at versions: 2.5.13, 2.6.0 >>> for tag in Tag.objects.all(): print('{} ({}): {}'.format(tag.name, tag.pk, tag.slug)) ... rxtel (1): rxtel sea-ix (2): sea-ix megafon (3): megafon beeline (4): beeline ttk (5): ttk vpn (6): vpn Времянка (7): Бардак (9): _1 Maybe, I should drop "broken" tags? How to do it?
Author
Owner

@k109x commented on GitHub (Jun 22, 2019):

fix
update extras_tag set slug = 'temp' where id=7;

@k109x commented on GitHub (Jun 22, 2019): fix update extras_tag set slug = 'temp' where id=7;
Author
Owner

@k109x commented on GitHub (Jun 22, 2019):

bug: when I add tag in russian layout, slug isn't created. Tag tab broking ;)

@k109x commented on GitHub (Jun 22, 2019): bug: when I add tag in russian layout, slug isn't created. Tag tab broking ;)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2521