Skip to end of metadata
Go to start of metadata


The storeonce is agent is crashing with  the following message

Traceback (most recent call last):
  File "/omd/sites/buscar/lib/python3/requests_oauthlib/", line 477, in request
    url, headers, data = self._client.add_token(
  File "/omd/sites/buscar/lib/python3/oauthlib/oauth2/rfc6749/clients/", line 198, in add_token
    raise TokenExpiredError()
oauthlib.oauth2.rfc6749.errors.TokenExpiredError: (token_expired)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "share/check_mk/agents/special/agent_storeonce4x", line 10, in <module>
  File "/omd/sites/buscar/lib/python3/cmk/special_agents/", line 260, in main
    special_agent_main(parse_arguments, agent_storeonce4x_main)
  File "/omd/sites/buscar/lib/python3/cmk/special_agents/utils/", line 159, in special_agent_main
    _special_agent_main_core(parse_arguments, main_fn, sys.argv[1:])
  File "/omd/sites/buscar/lib/python3/cmk/special_agents/utils/", line 141, in _special_agent_main_core
  File "/omd/sites/buscar/lib/python3/cmk/special_agents/", line 251, in agent_storeonce4x_main
  File "/omd/sites/buscar/lib/python3/cmk/special_agents/utils/", line 51, in append_json
    for l in data:
  File "/omd/sites/buscar/lib/python3/cmk/special_agents/", line 154, in handler_simple
    yield from (requester.get(uri) for uri in uris)
  File "/omd/sites/buscar/lib/python3/cmk/special_agents/", line 154, in <genexpr>
    yield from (requester.get(uri) for uri in uris)
  File "/omd/sites/buscar/lib/python3/cmk/special_agents/", line 142, in get
    resp = self._oauth_session.request(
  File "/omd/sites/buscar/lib/python3/requests_oauthlib/", line 496, in request
    token = self.refresh_token(
  File "/omd/sites/buscar/lib/python3/requests_oauthlib/", line 446, in refresh_token
    self.token = self._client.parse_request_body_response(r.text, scope=self.scope)
  File "/omd/sites/buscar/lib/python3/oauthlib/oauth2/rfc6749/clients/", line 421, in parse_request_body_response
    self.token = parse_token_response(body, scope=scope)
  File "/omd/sites/buscar/lib/python3/oauthlib/oauth2/rfc6749/", line 431, in parse_token_response
  File "/omd/sites/buscar/lib/python3/oauthlib/oauth2/rfc6749/", line 441, in validate_token_parameters
    raise MissingTokenError(description="Missing access token parameter.")
oauthlib.oauth2.rfc6749.errors.MissingTokenError: (missing_token) Missing access token parameter.


  1. Example with Special Agent of Storeonce4x 

    • Find out the detailed special agent command (Type of agent column)

      OMD[mysite]:~$ cmk -D hostname

      an easier way would be this command: /bin/sh -c "$(cmk -D k8s | grep -A1 "^Type of agent:" | grep "Program:" | cut -f2 -d':')"

      Please note that if a line matching "^Type of agent:" followed by a line matching "^  Program:" exists more than once, then the output might be messed up.

    • Check if there are some options for debugging

      OMD[mysite]:~$ ~/share/check_mk/agents/special/agent_storeonce4x -h
      • The're three options for debugging the request

        --debug, -d           Enable debug mode (keep some exceptions unhandled)
          --verbose, -v
          --vcrtrace TRACEFILE, --tracefile TRACEFILE
                                    If this flag is set to a TRACEFILE that does not exist yet, it will be created and
                                    all requests the program sends and their corresponding answers will be recorded in said file.
                                    If the file already exists, no requests are sent to the server, but the responses will be
                                    replayed from the tracefile. 
    • Modify the special agent command by adding these three options

      OMD[mysite]:~$ ~/share/check_mk/agents/special/agent_storeonce4x <OTHER ARGUMENTS> --debug -v --vcrtrace ~/tmp/vcrtrace.txt 2>1 ~/tmp/storeonce4x_with_debug.txt
    • Run the special agent with no debug options, to create an agent output. With this file we can reproduce your issue

      /omd/sites/mysite/share/check_mk/agents/special/agent_kube <OTHER ARGUMENTS> > ~/tmp/k8s_agent_output.txt
  2. Rename the token file
    the storeonce4x special agent is using username / password for authentication. After the successful login we obtain the access token. The access token is used for the future REST requests. If you want to read more, you can check this out:
    1. We save the token file inside the site in

    2. rename the file to 

    3. run the special agent again

There is no content with the specified labels

Write a comment…