Bulk Edit VLANs 502 #568

Closed
opened 2025-12-29 16:23:22 +01:00 by adam · 7 comments
Owner

Originally created by @bsakdol on GitHub (Dec 7, 2016).

I am trying to apply a VLAN group using the edit selected button, but when I select my group and hit apply, I get a 502 page. However, after getting the 502 a few times, I tried to see if I could do it with fewer VLAN's selected and was able to apply a group to 5 VLAN's. Unfortunately, when I tried 5 more, I got a 502 page again. I am not selecting any other field, other than applying a group, when I do the bulk edit. I have many VLAN's imported through CSV and many of the created in the web UI. This happened on 1.7.1 and 1.7.2-r1

Originally created by @bsakdol on GitHub (Dec 7, 2016). I am trying to apply a VLAN group using the `edit selected` button, but when I select my group and hit apply, I get a 502 page. However, after getting the 502 a few times, I tried to see if I could do it with fewer VLAN's selected and was able to apply a group to 5 VLAN's. Unfortunately, when I tried 5 more, I got a 502 page again. I am not selecting any other field, other than applying a group, when I do the bulk edit. I have many VLAN's imported through CSV and many of the created in the web UI. This happened on 1.7.1 and 1.7.2-r1
adam closed this issue 2025-12-29 16:23:22 +01:00
Author
Owner

@jeremystretch commented on GitHub (Dec 7, 2016):

Error code 502 would indicate that the WSGI service running behind the HTTP service is not available, and is unlikely to be related to any particular functionality in NetBox. Are you sure you don't mean a 500 error? If this is the case, please provide the text of the provided error message. If it is a 502 error, you'll need to troubleshoot your installation.

@jeremystretch commented on GitHub (Dec 7, 2016): Error code 502 would indicate that the WSGI service running behind the HTTP service is not available, and is unlikely to be related to any particular functionality in NetBox. Are you sure you don't mean a 500 error? If this is the case, please provide the text of the provided error message. If it _is_ a 502 error, you'll need to troubleshoot your installation.
Author
Owner

@bsakdol commented on GitHub (Dec 7, 2016):

Yep, it is definitely a 502 bad gateway. Just odd that is the only thing that causes the 502. But if I'm the only one having the issue, it's obviously something to do with our environment.

@bsakdol commented on GitHub (Dec 7, 2016): Yep, it is definitely a 502 bad gateway. Just odd that is the only thing that causes the 502. But if I'm the only one having the issue, it's obviously something to do with our environment.
Author
Owner

@jeremystretch commented on GitHub (Dec 7, 2016):

What happens if you try to make the changes while running the development server (http://localhost:8000)?

./manage.py runserver
@jeremystretch commented on GitHub (Dec 7, 2016): What happens if you try to make the changes while running the development server (http://localhost:8000)? ``` ./manage.py runserver ```
Author
Owner

@bsakdol commented on GitHub (Dec 7, 2016):

A server error occurred. Please contact the administrator.

@bsakdol commented on GitHub (Dec 7, 2016): A server error occurred. Please contact the administrator.
Author
Owner

@bsakdol commented on GitHub (Dec 7, 2016):

On the server, I see the following:

  File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 170, in __call__
    response = self.get_response(request)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 124, in get_response
    response = self._middleware_chain(request)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 41, in inner
    response = response_for_exception(request, exc)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 86, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 124, in handle_uncaught_exception
    extra={'status_code': 500, 'request': request},
  File "/usr/lib/python2.7/logging/__init__.py", line 1193, in error
    self._log(ERROR, msg, args, **kwargs)
  File "/usr/lib/python2.7/logging/__init__.py", line 1286, in _log
    self.handle(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 1296, in handle
    self.callHandlers(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 1336, in callHandlers
    hdlr.handle(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 759, in handle
    self.emit(record)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/log.py", line 121, in emit
    self.send_mail(subject, message, fail_silently=True, html_message=html_message)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/log.py", line 124, in send_mail
    mail.mail_admins(subject, message, *args, connection=self.connection(), **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/core/mail/__init__.py", line 103, in mail_admins
    mail.send(fail_silently=fail_silently)
  File "/usr/local/lib/python2.7/dist-packages/django/core/mail/message.py", line 342, in send
    return self.get_connection(fail_silently).send_messages([self])
  File "/usr/local/lib/python2.7/dist-packages/django/core/mail/backends/smtp.py", line 100, in send_messages
    new_conn_created = self.open()
  File "/usr/local/lib/python2.7/dist-packages/django/core/mail/backends/smtp.py", line 58, in open
    self.connection = connection_class(self.host, self.port, **connection_params)
  File "/usr/lib/python2.7/smtplib.py", line 256, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/lib/python2.7/smtplib.py", line 316, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/usr/lib/python2.7/smtplib.py", line 291, in _get_socket
    return socket.create_connection((host, port), timeout)
  File "/usr/lib/python2.7/socket.py", line 557, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
gaierror: [Errno -2] Name or service not known
@bsakdol commented on GitHub (Dec 7, 2016): On the server, I see the following: ```Traceback (most recent call last): File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run self.result = application(self.environ, self.start_response) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 170, in __call__ response = self.get_response(request) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 124, in get_response response = self._middleware_chain(request) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 41, in inner response = response_for_exception(request, exc) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 86, in response_for_exception response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info()) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 124, in handle_uncaught_exception extra={'status_code': 500, 'request': request}, File "/usr/lib/python2.7/logging/__init__.py", line 1193, in error self._log(ERROR, msg, args, **kwargs) File "/usr/lib/python2.7/logging/__init__.py", line 1286, in _log self.handle(record) File "/usr/lib/python2.7/logging/__init__.py", line 1296, in handle self.callHandlers(record) File "/usr/lib/python2.7/logging/__init__.py", line 1336, in callHandlers hdlr.handle(record) File "/usr/lib/python2.7/logging/__init__.py", line 759, in handle self.emit(record) File "/usr/local/lib/python2.7/dist-packages/django/utils/log.py", line 121, in emit self.send_mail(subject, message, fail_silently=True, html_message=html_message) File "/usr/local/lib/python2.7/dist-packages/django/utils/log.py", line 124, in send_mail mail.mail_admins(subject, message, *args, connection=self.connection(), **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/core/mail/__init__.py", line 103, in mail_admins mail.send(fail_silently=fail_silently) File "/usr/local/lib/python2.7/dist-packages/django/core/mail/message.py", line 342, in send return self.get_connection(fail_silently).send_messages([self]) File "/usr/local/lib/python2.7/dist-packages/django/core/mail/backends/smtp.py", line 100, in send_messages new_conn_created = self.open() File "/usr/local/lib/python2.7/dist-packages/django/core/mail/backends/smtp.py", line 58, in open self.connection = connection_class(self.host, self.port, **connection_params) File "/usr/lib/python2.7/smtplib.py", line 256, in __init__ (code, msg) = self.connect(host, port) File "/usr/lib/python2.7/smtplib.py", line 316, in connect self.sock = self._get_socket(host, port, self.timeout) File "/usr/lib/python2.7/smtplib.py", line 291, in _get_socket return socket.create_connection((host, port), timeout) File "/usr/lib/python2.7/socket.py", line 557, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): gaierror: [Errno -2] Name or service not known ```
Author
Owner

@jeremystretch commented on GitHub (Dec 7, 2016):

Interesting. Looks like an issue with your SMTP configuration. The service dies when it attempts to send an email notifying admins of the error. You could try setting ADMINS = [] in configuration.py to avoid this, but it's probably just an issue with your email settings.

Going to close this out as it doesn't appear to be a bug.

@jeremystretch commented on GitHub (Dec 7, 2016): Interesting. Looks like an issue with your SMTP configuration. The service dies when it attempts to send an email notifying admins of the error. You could try setting `ADMINS = []` in configuration.py to avoid this, but it's probably just an issue with your [email settings](http://netbox.readthedocs.io/en/latest/configuration/optional-settings/#email). Going to close this out as it doesn't appear to be a bug.
Author
Owner

@bsakdol commented on GitHub (Dec 8, 2016):

FWIW... After commenting out the e-mail addresses in configuration.py, the error causing the issue was due to duplicate VLAN names being added to the same group. For instance, all my management VLAN's are named LAN-MANAGEMENT and it didn't like VLAN's of the same name being added to the same group.

@bsakdol commented on GitHub (Dec 8, 2016): FWIW... After commenting out the e-mail addresses in configuration.py, the error causing the issue was due to duplicate VLAN names being added to the same group. For instance, all my management VLAN's are named LAN-MANAGEMENT and it didn't like VLAN's of the same name being added to the same group.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#568