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

UNKNOWN: Exception raised during check': KeyError('token') #66

Open
Al2Klimov opened this issue Feb 19, 2020 · 0 comments
Open

UNKNOWN: Exception raised during check': KeyError('token') #66

Al2Klimov opened this issue Feb 19, 2020 · 0 comments

Comments

@Al2Klimov
Copy link

Command line: ["/usr/lib/nagios/plugins/check_docker","--containers","elasticsearch","--present","--restarts","23:42","--status","running","--uptime","120:60","--version"]

Container's image: docker.elastic.co/elasticsearch/elasticsearch:7.5.1

Output:

Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/check_docker/check_docker.py", line 985, in main
    [x.result() for x in futures.as_completed(threads)]
  File "/usr/local/lib/python3.7/dist-packages/check_docker/check_docker.py", line 985, in <listcomp>
    [x.result() for x in futures.as_completed(threads)]
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 425, in result
    return self.__get_result()
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/dist-packages/check_docker/check_docker.py", line 623, in check_version
    registry_hash = get_digest_from_registry(url)
  File "/usr/local/lib/python3.7/dist-packages/check_docker/check_docker.py", line 374, in get_digest_from_registry
    registry_info, status_code = get_url(url=url)
  File "/usr/local/lib/python3.7/dist-packages/check_docker/check_docker.py", line 278, in get_url
    response = better_urllib_get.open(url, timeout=timeout)
  File "/usr/lib/python3.7/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/local/lib/python3.7/dist-packages/check_docker/check_docker.py", line 133, in http_response
    return self.process_oauth2(request, response, www_authenticate_header)
  File "/usr/local/lib/python3.7/dist-packages/check_docker/check_docker.py", line 162, in process_oauth2
    auth_token = self._get_outh2_token(www_authenticate_header)
  File "/usr/local/lib/python3.7/dist-packages/check_docker/check_docker.py", line 151, in _get_outh2_token
    return process_urllib_response(token_response)['token']
KeyError: 'token'
OK: elasticsearch status is running; OK: elasticsearch restarts is 0; OK: elasticsearch uptime is 4d 23h; UNKNOWN: Exception raised during check': KeyError('token')
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