Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nsot completely breaks if the initial site is created with an emoji in the description #375

Open
dpedu opened this issue Dec 17, 2019 · 0 comments

Comments

@dpedu
Copy link

dpedu commented Dec 17, 2019

Hi! I tried out Nsot today. I tried both the 'latest' docker image and with building the image myself in the ./docker directory.

After logging in for the first time, the only controls available are those to create a Site. I used the name Test Site and description This is the test site 💩. Creating the site seems to work as the POST action completes successfully. The app then redirects me to /sites/1 when never loads beyond the screenshot shown below. The homescreen of the app is the same except the menu doesn't even load.

image

Logs:

[2019-12-17 16:43:11 +0000] [13] [INFO] 201 POST /api/sites/ (172.17.0.1) 23.01ms
[2019-12-17 16:43:11 +0000] [13] [INFO] 200 GET /api/users/0/ (172.17.0.1) 16.79ms
[2019-12-17 16:43:11 +0000] [13] [INFO] 200 GET /api/sites/1/networks/?include_ips=true&limit=1&state=reserved (172.17.0.1) 16.67ms
[2019-12-17 16:43:11 +0000] [12] [INFO] 200 GET /api/sites/1/networks/?include_ips=true&ip_version=6&limit=1 (172.17.0.1) 30.80ms
[2019-12-17 16:43:11 +0000] [15] [ERROR] Internal Server Error: /api/sites/1/
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/viewsets.py", line 95, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py", line 494, in dispatch
    response = self.handle_exception(exc)
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py", line 454, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py", line 491, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/nsot/api/views.py", line 117, in retrieve
    return self.success(serializer.data)
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/serializers.py", line 537, in data
    ret = super(Serializer, self).data
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/serializers.py", line 262, in data
    self._data = self.to_representation(self.instance)
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/serializers.py", line 504, in to_representation
    ret[field.field_name] = field.to_representation(attribute)
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/fields.py", line 788, in to_representation
    return six.text_type(value)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 22: ordinal not in range(128)
[2019-12-17 16:43:11 +0000] [13] [INFO] 200 GET /api/sites/1/networks/?include_ips=true&limit=1&state=allocated (172.17.0.1) 15.33ms
[2019-12-17 16:43:11 +0000] [12] [INFO] 200 GET /api/sites/1/networks/?include_ips=true&ip_version=4&limit=1 (172.17.0.1) 16.13ms
[2019-12-17 16:43:11 +0000] [13] [INFO] 200 GET /api/sites/1/networks/?include_ips=true&limit=1&state=orphaned (172.17.0.1) 15.28ms
[2019-12-17 16:43:11 +0000] [12] [INFO] 200 GET /api/sites/1/networks/?include_ips=true&limit=1&state=assigned (172.17.0.1) 21.10ms
[2019-12-17 16:43:11 +0000] [13] [INFO] 200 GET /api/sites/1/interfaces/?limit=1 (172.17.0.1) 22.34ms
[2019-12-17 16:43:11 +0000] [12] [ERROR] Internal Server Error: /api/sites/1/changes/
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 217, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 215, in _get_response
    response = response.render()
  File "/usr/local/lib/python2.7/dist-packages/django/template/response.py", line 107, in render
    self.content = self.rendered_content
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/response.py", line 72, in rendered_content
    ret = renderer.render(self.data, accepted_media_type, context)
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/renderers.py", line 105, in render
    allow_nan=not self.strict, separators=separators
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/utils/json.py", line 28, in dumps
    return json.dumps(*args, **kwargs)
  File "/usr/lib/python2.7/json/__init__.py", line 250, in dumps
    sort_keys=sort_keys, **kw).encode(obj)
  File "/usr/lib/python2.7/json/encoder.py", line 210, in encode
    return ''.join(chunks)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 23: ordinal not in range(128)
[2019-12-17 16:43:11 +0000] [15] [INFO] 500 GET /api/sites/1/ (172.17.0.1) 124.62ms
[2019-12-17 16:43:11 +0000] [15] [INFO] 200 GET /api/sites/1/devices/?limit=1 (172.17.0.1) 10.07ms
[2019-12-17 16:43:11 +0000] [15] [INFO] 200 GET /api/sites/1/networks/?include_ips=true&limit=1 (172.17.0.1) 11.01ms
[2019-12-17 16:43:11 +0000] [12] [INFO] 500 GET /api/sites/1/changes/?limit=10 (172.17.0.1) 68.19ms
```
@dpedu dpedu changed the title Nsot complete breaks if the initial site is created with an emoji in the description Nsot completely breaks if the initial site is created with an emoji in the description Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant