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

Server Error on Interface disconnect #2642

Closed
PeterG3 opened this issue Dec 4, 2018 · 5 comments
Closed

Server Error on Interface disconnect #2642

PeterG3 opened this issue Dec 4, 2018 · 5 comments

Comments

@PeterG3
Copy link

PeterG3 commented Dec 4, 2018

Environment

  • Python version: v3.5.2
  • NetBox version: v2.4.6

Steps to Reproduce

  1. Create two devices
  2. Connect some interfaces
  3. Try to disconnect an interface and confirm this operation
  4. Server error is displayed

Sometimes it is working but in 9 of 10 cases we get those errors for up to 10 minutes and then the same disconnect operation is working fine.

Expected Behavior

The operation should not produce a internal server error.

Observed Behavior

Server Error

There was a problem with your request. Please contact an administrator.
The complete exception is provided below:

<class 'ValueError'>
Cannot assign "<django.contrib.auth.models.AnonymousUser object at 0x7f91c9aaae48>": "ObjectChange.user" must be a "User" instance.

Looks very familiar to issue 2621

@PeterG3
Copy link
Author

PeterG3 commented Dec 4, 2018

We tried different users on different OS and browsers with several devices.

@martink2
Copy link

martink2 commented Dec 4, 2018

This is the Stack Trace for the error

File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/exception.py" in inner
  35.             response = get_response(request)

File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py" in _get_response
  128.                 response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py" in _get_response
  126.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python3.5/dist-packages/django/views/generic/base.py" in view
  69.             return self.dispatch(request, *args, **kwargs)

File "/usr/local/lib/python3.5/dist-packages/django/contrib/auth/mixins.py" in dispatch
  85.         return super().dispatch(request, *args, **kwargs)

File "/usr/local/lib/python3.5/dist-packages/django/views/generic/base.py" in dispatch
  89.         return handler(request, *args, **kwargs)

File "/opt/netbox/netbox/dcim/views.py" in post
  1965.             interfaceconnection.delete()

File "/usr/local/lib/python3.5/dist-packages/django/db/models/base.py" in delete
  891.         return collector.delete()

File "/usr/local/lib/python3.5/dist-packages/django/db/models/deletion.py" in delete
  307.                             sender=model, instance=obj, using=self.using

File "/usr/local/lib/python3.5/dist-packages/django/dispatch/dispatcher.py" in send
  178.             for receiver in self._live_receivers(sender)

File "/usr/local/lib/python3.5/dist-packages/django/dispatch/dispatcher.py" in <listcomp>
  178.             for receiver in self._live_receivers(sender)

File "/usr/local/lib/python3.5/dist-packages/django/utils/functional.py" in _curried
  11.         return _curried_func(*(args + moreargs), **dict(kwargs, **morekwargs))

File "/opt/netbox/netbox/extras/middleware.py" in _record_object_deleted
  37.         instance.log_change(request.user, request.id, OBJECTCHANGE_ACTION_DELETE)

File "/opt/netbox/netbox/dcim/models.py" in log_change
  2098.                 object_data=serialize_object(interface, extra=connection_data)

File "/usr/local/lib/python3.5/dist-packages/django/db/models/base.py" in __init__
  477.                     _setattr(self, field.name, rel_obj)

File "/usr/local/lib/python3.5/dist-packages/django/db/models/fields/related_descriptors.py" in __set__
  197.                     self.field.remote_field.model._meta.object_name,

Exception Type: ValueError at /dcim/interface-connections/17421/delete/
Exception Value: Cannot assign "<django.contrib.auth.models.AnonymousUser object at 0x7f91c95aa470>": "ObjectChange.user" must be a "User" instance.
Request information:
USER: d043423

I am neither a python nor a django expert but from what googling reveals is that django.contrib.auth.models.AnonymousUser is a user which is not logged in, which in the case above is not the case. A line below in the error it even states the logged in user.

@jeremystretch is there anything more we can do to increase debugging ?

@jeremystretch
Copy link
Member

Our requirement for accepting a bug report is that it must be reproducible on a clean installation of the latest release. Please see if you can reproduce this behavior on a clean installation of v2.4.8.

@jeremystretch jeremystretch added the status: revisions needed This issue requires additional information to be actionable label Dec 4, 2018
@PeterG3
Copy link
Author

PeterG3 commented Dec 5, 2018

After updating to v2.4.8 I encountered still the same issue after the first try.
Next step would be a clean install and test it again. Will keep you updated.

@netbox-community netbox-community deleted a comment from dunderrrrrr Dec 11, 2018
@jeremystretch
Copy link
Member

Closing due to inactivity. Please request to re-open if this issue is found to be reproducible on a recent stable release.

@jeremystretch jeremystretch removed the status: revisions needed This issue requires additional information to be actionable label Dec 19, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants