Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.
This repository has been archived by the owner on May 24, 2023. It is now read-only.

"Update Categories" fails when using unicode domains #11

Closed
ghost opened this issue Sep 11, 2019 · 1 comment
Closed

"Update Categories" fails when using unicode domains #11

ghost opened this issue Sep 11, 2019 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Sep 11, 2019

The application fails to update domain categories when it is tracking a unicode domain. The following error is displayed in the console:

[+] Starting update of $UNICODE_DOMAIN
20:01:16 [Q] ERROR Failed [autumn-three-steak-earth] - name 'error' is not defined : Traceback (most recent call last):
  File "/home/USER/Code/Shepherd/modules/review.py", line 126, in check_ibm_xforce
    req = self.session.get(xforce_api_uri, headers=headers, verify=False)
  File "/home/USER/.local/lib/python3.7/site-packages/requests/sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
  File "/home/USER/.local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/USER/.local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/home/USER/.local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/home/USER/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 603, in urlopen
    chunked=chunked)
  File "/home/USER/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 355, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.7/http/client.py", line 1229, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1270, in _send_request
    self.putheader(hdr, value)
  File "/usr/lib/python3.7/http/client.py", line 1202, in putheader
    values[i] = one_value.encode('latin-1')
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 54-55: ordinal not in range(256)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/USER/.local/lib/python3.7/site-packages/django_q/cluster.py", line 381, in worker
    res = f(*task['args'], **task['kwargs'])
  File "/home/USER/Code/Shepherd/tasks.py", line 105, in check_domains
    lab_results = domain_review.check_domain_status()
  File "/home/USER/Code/Shepherd/modules/review.py", line 450, in check_domain_status
    xforce_results = self.check_ibm_xforce(domain_name)
  File "/home/USER/Code/Shepherd/modules/review.py", line 143, in check_ibm_xforce
    print('[!] IBM X-Force request failed: {}'.format(error))
NameError: name 'error' is not defined
@chrismaddalena
Copy link
Contributor

Of course, that makes sense. I'll look into this and see what we can do.

The good news, for now, is the code tries to handle these failures. It's just that the error handling is apparently broken. Oops! I'll get that fixe din this next update I'm preparing and then work on handling unicode domains.

Thanks for heads up!

@chrismaddalena chrismaddalena self-assigned this Sep 27, 2019
@chrismaddalena chrismaddalena pinned this issue Sep 27, 2019
@chrismaddalena chrismaddalena added the bug Something isn't working label Sep 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant