When adding a device name with special characters, 502 error #126

Closed
opened 2025-12-29 15:34:17 +01:00 by adam · 2 comments
Owner

Originally created by @Zmegolaz on GitHub (Jul 1, 2016).

Steps to reproduce:

  1. Click Devices -> Add a Device
  2. Use special characters (in my case "ö") in the name.
  3. Click Create.

I get a 502 error from nginx. The device is actually created, with the special characters working, so it's mostly a user experience bug, just use the back button or something like that to get back to the site. The same thing happens when editing devices, and it's the same for Sites too.

I'm using:
Gentoo Linux
nginx 1.10.0
gunicorn 19.4.5
python 2.7.11
Not sure where I find the actual Netbox version, but I got it from Github 2016-06-28, last commit was 66a16dd06b.

Originally created by @Zmegolaz on GitHub (Jul 1, 2016). Steps to reproduce: 1. Click Devices -> Add a Device 2. Use special characters (in my case "ö") in the name. 3. Click Create. I get a 502 error from nginx. The device is actually created, with the special characters working, so it's mostly a user experience bug, just use the back button or something like that to get back to the site. The same thing happens when editing devices, and it's the same for Sites too. I'm using: Gentoo Linux nginx 1.10.0 gunicorn 19.4.5 python 2.7.11 Not sure where I find the actual Netbox version, but I got it from Github 2016-06-28, last commit was 66a16dd06b9018e195eee62cb7b33746f41b38c6.
adam added the type: bug label 2025-12-29 15:34:17 +01:00
adam closed this issue 2025-12-29 15:34:17 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 1, 2016):

Sounds like #140, which was fixed recently in v1.0.7. You can find it on the releases page (or just git pull origin master).

Please ask to have this reopened if you still have the problem on v1.0.7.

@jeremystretch commented on GitHub (Jul 1, 2016): Sounds like #140, which was fixed recently in v1.0.7. You can find it on the [releases page](https://github.com/digitalocean/netbox/releases) (or just `git pull origin master`). Please ask to have this reopened if you still have the problem on v1.0.7.
Author
Owner

@Jacq commented on GitHub (Jul 12, 2016):

I think I hit a similar issue with latest v1.1.0 but for rack names.
If a rack name has a special char when editing the asociatted devices you get the same nginx error. For example with rack name "Sótano", editing device 36 associated to it you get:

UnicodeEncodeError at /dcim/devices/36/edit/
'ascii' codec can't encode character u'\xf3' in position 8: ordinal not in range(128)
Request Method: GET
Request URL: http://localhost/dcim/devices/36/edit/
Django Version: 1.9.7
Exception Type: UnicodeEncodeError
Exception Value:
'ascii' codec can't encode character u'\xf3' in position 8: ordinal not in range(128)
Exception Location: /usr/local/lib/python2.7/dist-packages/django/utils/html.py in format_html, line 101
Python Executable: /usr/bin/python
Python Version: 2.7.6
Python Path:
['/opt/netbox/netbox',
'/',
'/usr/bin',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages']
Server time: Tue, 12 Jul 2016 10:54:00 +0000
Unicode error hint

The string that could not be encoded/decoded was: nta Sótano

Cheers,
Jacq

@Jacq commented on GitHub (Jul 12, 2016): I think I hit a similar issue with latest v1.1.0 but for rack names. If a rack name has a special char when editing the asociatted devices you get the same nginx error. For example with rack name "Sótano", editing device 36 associated to it you get: > UnicodeEncodeError at /dcim/devices/36/edit/ > 'ascii' codec can't encode character u'\xf3' in position 8: ordinal not in range(128) > Request Method: GET > Request URL: http://localhost/dcim/devices/36/edit/ > Django Version: 1.9.7 > Exception Type: UnicodeEncodeError > Exception Value: > 'ascii' codec can't encode character u'\xf3' in position 8: ordinal not in range(128) > Exception Location: /usr/local/lib/python2.7/dist-packages/django/utils/html.py in format_html, line 101 > Python Executable: /usr/bin/python > Python Version: 2.7.6 > Python Path: > ['/opt/netbox/netbox', > '/', > '/usr/bin', > '/usr/lib/python2.7', > '/usr/lib/python2.7/plat-x86_64-linux-gnu', > '/usr/lib/python2.7/lib-tk', > '/usr/lib/python2.7/lib-old', > '/usr/lib/python2.7/lib-dynload', > '/usr/local/lib/python2.7/dist-packages', > '/usr/lib/python2.7/dist-packages'] > Server time: Tue, 12 Jul 2016 10:54:00 +0000 > Unicode error hint > > The string that could not be encoded/decoded was: nta Sótano Cheers, Jacq
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#126