[GH-ISSUE #335] traceback in get_ip #263

Closed
opened 2026-02-26 09:37:04 +03:00 by kerem · 6 comments
Owner

Originally created by @ThomasWaldmann on GitHub (Apr 11, 2018).
Original GitHub issue: https://github.com/nsupdate-info/nsupdate.info/issues/335

Originally assigned to: @ThomasWaldmann on GitHub.

Internal Server Error: /overview/
Traceback (most recent call last):
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 164, in get_response
    response = response.render()
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/response.py", line 158, in render
    self.content = self.rendered_content
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/response.py", line 135, in rendered_content
    content = template.render(context, self._request)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/backends/django.py", line 74, in render
    return self.template.render(context)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 210, in render
    return self._render(context)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 202, in _render
    return self.nodelist.render(context)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 905, in render
    bit = self.render_node(node, context)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 919, in render_node
    return node.render(context)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 135, in render
    return compiled_parent._render(context)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 202, in _render
    return self.nodelist.render(context)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 905, in render
    bit = self.render_node(node, context)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 919, in render_node
    return node.render(context)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 65, in render
    result = block.nodelist.render(context)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 905, in render
    bit = self.render_node(node, context)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 919, in render_node
    return node.render(context)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/defaulttags.py", line 224, in render
    nodelist.append(node.render(context))
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/defaulttags.py", line 574, in render
    six.iteritems(self.extra_context)}
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/defaulttags.py", line 573, in <dictcomp>
    values = {key: val.resolve(context) for key, val in
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 648, in resolve
    obj = self.var.resolve(context)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 789, in resolve
    value = self._resolve_lookup(context)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 849, in _resolve_lookup
    current = current()
  File "/srv/nsupdate.info/repo/nsupdate/main/models.py", line 292, in get_ipv4
    return self.get_ip('ipv4')
  File "/srv/nsupdate.info/repo/nsupdate/main/models.py", line 285, in get_ip
    return dnstools.query_ns(self.get_fqdn(), record)
  File "/srv/nsupdate.info/repo/nsupdate/main/dnstools.py", line 255, in query_ns
    answer = resolver.query(str(fqdn), rdtype)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/dns/resolver.py", line 962, in query
    source_port=source_port)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/dns/query.py", line 257, in udp
    one_rr_per_rrset=one_rr_per_rrset)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/dns/message.py", line 807, in from_wire
    reader.read()
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/dns/message.py", line 748, in read
    self._get_section(self.message.additional, adcount)
  File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/dns/message.py", line 681, in _get_section
    raise UnknownTSIGKey('got signed message without keyring')
UnknownTSIGKey: got signed message without keyring

Request repr(): 
<WSGIRequest
path:/overview/,
GET:<QueryDict: {}>,
POST:<QueryDict: {}>,
COOKIES:{'csrftoken': 'AK0x5IThQTKganwfh67FQfv57Kynb1gV',
 'sessionid': 'ca1k9wi7t1p93r6egt93ius7usgc016g'},
META:{'CONTENT_LENGTH': '',
 'CONTENT_TYPE': '',
 u'CSRF_COOKIE': u'AK0x5IThQTKganwfh67FQfv57Kynb1gV',
 u'CSRF_COOKIE_USED': True,
 'DOCUMENT_ROOT': '/srv/nsupdate.info/htdocs',
 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, br',
 'HTTP_ACCEPT_LANGUAGE': 'de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7',
 'HTTP_CACHE_CONTROL': 'max-age=0',
 'HTTP_CONNECTION': 'close',
 'HTTP_COOKIE': 'csrftoken=AK0x5IThQTKganwfh67FQfv57Kynb1gV; sessionid=ca1k9wi7t1p93r6egt93ius7usgc016g',
 'HTTP_DNT': '1',
 'HTTP_HOST': 'www.nsupdate.info',
 'HTTP_REFERER': 'https://www.nsupdate.info/accounts/login/',
 'HTTP_UPGRADE_INSECURE_REQUESTS': '1',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/65.0.3325.181 Chrome/65.0.3325.181 Safari/537.36',
 'HTTP_X_FORWARDED_FOR': '2a02:168:4a01:777:a36b:949e:c535:7f63',
 'HTTP_X_FORWARDED_PROTO': 'https',
 'HTTP_X_REAL_IP': '2a02:168:4a01:777:a36b:949e:c535:7f63',
 'PATH_INFO': u'/overview/',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '2a02:168:4a01:777:a36b:949e:c535:7f63',
 'REMOTE_PORT': '',
 'REQUEST_METHOD': 'GET',
 'REQUEST_URI': '/overview/',
 u'SCRIPT_NAME': u'',
 'SERVER_NAME': 'www.nsupdate.info',
 'SERVER_PORT': '80',
 'SERVER_PROTOCOL': 'HTTP/1.0',
Originally created by @ThomasWaldmann on GitHub (Apr 11, 2018). Original GitHub issue: https://github.com/nsupdate-info/nsupdate.info/issues/335 Originally assigned to: @ThomasWaldmann on GitHub. ``` Internal Server Error: /overview/ Traceback (most recent call last): File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 164, in get_response response = response.render() File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/response.py", line 158, in render self.content = self.rendered_content File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/response.py", line 135, in rendered_content content = template.render(context, self._request) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/backends/django.py", line 74, in render return self.template.render(context) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 210, in render return self._render(context) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 202, in _render return self.nodelist.render(context) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 905, in render bit = self.render_node(node, context) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 919, in render_node return node.render(context) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 135, in render return compiled_parent._render(context) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 202, in _render return self.nodelist.render(context) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 905, in render bit = self.render_node(node, context) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 919, in render_node return node.render(context) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 65, in render result = block.nodelist.render(context) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 905, in render bit = self.render_node(node, context) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 919, in render_node return node.render(context) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/defaulttags.py", line 224, in render nodelist.append(node.render(context)) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/defaulttags.py", line 574, in render six.iteritems(self.extra_context)} File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/defaulttags.py", line 573, in <dictcomp> values = {key: val.resolve(context) for key, val in File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 648, in resolve obj = self.var.resolve(context) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 789, in resolve value = self._resolve_lookup(context) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/django/template/base.py", line 849, in _resolve_lookup current = current() File "/srv/nsupdate.info/repo/nsupdate/main/models.py", line 292, in get_ipv4 return self.get_ip('ipv4') File "/srv/nsupdate.info/repo/nsupdate/main/models.py", line 285, in get_ip return dnstools.query_ns(self.get_fqdn(), record) File "/srv/nsupdate.info/repo/nsupdate/main/dnstools.py", line 255, in query_ns answer = resolver.query(str(fqdn), rdtype) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/dns/resolver.py", line 962, in query source_port=source_port) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/dns/query.py", line 257, in udp one_rr_per_rrset=one_rr_per_rrset) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/dns/message.py", line 807, in from_wire reader.read() File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/dns/message.py", line 748, in read self._get_section(self.message.additional, adcount) File "/srv/nsupdate.info/env/local/lib/python2.7/site-packages/dns/message.py", line 681, in _get_section raise UnknownTSIGKey('got signed message without keyring') UnknownTSIGKey: got signed message without keyring Request repr(): <WSGIRequest path:/overview/, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'csrftoken': 'AK0x5IThQTKganwfh67FQfv57Kynb1gV', 'sessionid': 'ca1k9wi7t1p93r6egt93ius7usgc016g'}, META:{'CONTENT_LENGTH': '', 'CONTENT_TYPE': '', u'CSRF_COOKIE': u'AK0x5IThQTKganwfh67FQfv57Kynb1gV', u'CSRF_COOKIE_USED': True, 'DOCUMENT_ROOT': '/srv/nsupdate.info/htdocs', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, br', 'HTTP_ACCEPT_LANGUAGE': 'de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7', 'HTTP_CACHE_CONTROL': 'max-age=0', 'HTTP_CONNECTION': 'close', 'HTTP_COOKIE': 'csrftoken=AK0x5IThQTKganwfh67FQfv57Kynb1gV; sessionid=ca1k9wi7t1p93r6egt93ius7usgc016g', 'HTTP_DNT': '1', 'HTTP_HOST': 'www.nsupdate.info', 'HTTP_REFERER': 'https://www.nsupdate.info/accounts/login/', 'HTTP_UPGRADE_INSECURE_REQUESTS': '1', 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/65.0.3325.181 Chrome/65.0.3325.181 Safari/537.36', 'HTTP_X_FORWARDED_FOR': '2a02:168:4a01:777:a36b:949e:c535:7f63', 'HTTP_X_FORWARDED_PROTO': 'https', 'HTTP_X_REAL_IP': '2a02:168:4a01:777:a36b:949e:c535:7f63', 'PATH_INFO': u'/overview/', 'QUERY_STRING': '', 'REMOTE_ADDR': '2a02:168:4a01:777:a36b:949e:c535:7f63', 'REMOTE_PORT': '', 'REQUEST_METHOD': 'GET', 'REQUEST_URI': '/overview/', u'SCRIPT_NAME': u'', 'SERVER_NAME': 'www.nsupdate.info', 'SERVER_PORT': '80', 'SERVER_PROTOCOL': 'HTTP/1.0', ```
kerem closed this issue 2026-02-26 09:37:04 +03:00
Author
Owner

@alainwolf commented on GitHub (Apr 12, 2018):

This error occurs when I try to access the overview page of the account associated with one particular domain for RFC2136 updates.
Other accounts with domains on the same name-server, but different TSIG-keys, don't have this problem.
Host updates still work on all domains across all accounts.

<!-- gh-comment-id:380849909 --> @alainwolf commented on GitHub (Apr 12, 2018): This error occurs when I try to access the overview page of the account associated with one particular domain for RFC2136 updates. Other accounts with domains on the same name-server, but different TSIG-keys, don't have this problem. Host updates still work on all domains across all accounts.
Author
Owner

@alainwolf commented on GitHub (Apr 23, 2018):

Before these errors started to occur I tried to change the TSIGKey on https://www.nsupdate.info/domain/xxxx/ of that particular domain from the one automatically created one by www.dnsupdate.info to one of those I already had created on my server.

On the next update from a client on that account, my DNS-server complained in its logs, that an update has been attempted with an invalid key.

When I returned to domain page on https://www.nsupdate.info/domain/xxxx/ it still showed me the original auto-created TSIGKey.

I therefore assumed that its not possible to change TSIGKeys. Along the line of that it is not possible to manually change host secrets either, just to let them be re-created by nsupdate.info. I assumed that its a bug on the website that the form-fields for TSIGKeys are editable.

I therefore reconfigured the domain on my DNS server to use the original auto-created TSIGKey again and immediately client updates started to work again.

Sometimes later I discovered that I get this Error 500 after logging on the website with the account of that domain. But client updates still worked. Only some days later some of the client updates also started to get HTTP error 500.

<!-- gh-comment-id:383664834 --> @alainwolf commented on GitHub (Apr 23, 2018): Before these errors started to occur I tried to change the TSIGKey on https://www.nsupdate.info/domain/xxxx/ of that particular domain from the one automatically created one by www.dnsupdate.info to one of those I already had created on my server. On the next update from a client on that account, my DNS-server complained in its logs, that an update has been attempted with an invalid key. When I returned to domain page on https://www.nsupdate.info/domain/xxxx/ it still showed me the original auto-created TSIGKey. I therefore assumed that its not possible to change TSIGKeys. Along the line of that it is not possible to manually change host secrets either, just to let them be re-created by nsupdate.info. I assumed that its a bug on the website that the form-fields for TSIGKeys are editable. I therefore reconfigured the domain on my DNS server to use the original auto-created TSIGKey again and immediately client updates started to work again. Sometimes later I discovered that I get this Error 500 after logging on the website with the account of that domain. But client updates still worked. Only some days later some of the client updates also started to get HTTP error 500.
Author
Owner

@ThomasWaldmann commented on GitHub (Apr 25, 2018):

@alainwolf I've applied the patch from #343 to https://www.nsupdate.info - can you try if it works better for the overview view for your problematic user/domain?

<!-- gh-comment-id:384347697 --> @ThomasWaldmann commented on GitHub (Apr 25, 2018): @alainwolf I've applied the patch from #343 to https://www.nsupdate.info - can you try if it works better for the overview view for your problematic user/domain?
Author
Owner

@alainwolf commented on GitHub (Apr 26, 2018):

Yes, I could see the overview again with that login. Thank you.
Did not try anything else (e.g. DNS client updates, changing TSIGkeys), as I rebuild everything with a new login.

<!-- gh-comment-id:384820176 --> @alainwolf commented on GitHub (Apr 26, 2018): Yes, I could see the overview again with that login. Thank you. Did not try anything else (e.g. DNS client updates, changing TSIGkeys), as I rebuild everything with a new login.
Author
Owner

@ThomasWaldmann commented on GitHub (Apr 27, 2018):

I just "fixed" the overview view troubles, the root cause is still unclear (and guess I do not have enough data and the environment to debug that).

<!-- gh-comment-id:384963877 --> @ThomasWaldmann commented on GitHub (Apr 27, 2018): I just "fixed" the overview view troubles, the root cause is still unclear (and guess I do not have enough data and the environment to debug that).
Author
Owner

@ThomasWaldmann commented on GitHub (Sep 28, 2018):

Closing this. Workaround for view is in place, rest is unclear / not actionable.

Reopen if there is more data.

<!-- gh-comment-id:425583006 --> @ThomasWaldmann commented on GitHub (Sep 28, 2018): Closing this. Workaround for view is in place, rest is unclear / not actionable. Reopen if there is more data.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nsupdate.info-nsupdate-info#263
No description provided.