[2.3] When a machine fails and the oauth token gets expired, it may traceback

Bug #1759275 reported by Andres Rodriguez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
High
Unassigned

Bug Description

A machine failed to access the repository, it was marked as 'Failed commissioning' and after that the logs show the following (my guess is that maas tried to save cloud-init messages but the oauth token had already expired).

This is really bad because it leads the user to believe that there's a nasty failure in MAAS when in reality it is not a failure.

2018-03-27 13:17:44 regiond: [info] 100.99.5.14 POST /MAAS/metadata/status/fmwph6 HTTP/1.1 --> 204 NO_CONTENT (referrer: -; agent: python-requests/2.9.1)
2018-03-27 13:17:44 regiond: [info] 100.99.5.14 POST /MAAS/metadata/status/fmwph6 HTTP/1.1 --> 204 NO_CONTENT (referrer: -; agent: python-requests/2.9.1)
2018-03-27 13:17:45 maasserver: [error] ################################ Exception: "Authorization Error: 'Invalid access token: nrcy9EJPnDW9eazMnN'" ################################
2018-03-27 13:17:45 maasserver: [error] ################################ Exception: "Authorization Error: 'Invalid access token: nrcy9EJPnDW9eazMnN'" ################################
2018-03-27 13:17:45 maasserver: [error] Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/maasserver/api/auth.py", line 55, in is_authenticated
    consumer, token, parameters = self.validate_token(request)
  File "/usr/lib/python3/dist-packages/piston3/authentication.py", line 321, in validate_token
    return oauth_server.verify_request(oauth_request)
  File "/usr/lib/python3/dist-packages/piston3/oauth.py", line 432, in verify_request
    token = self._get_token(oauth_request, 'access')
  File "/usr/lib/python3/dist-packages/piston3/oauth.py", line 488, in _get_token
    raise OAuthError('Invalid %s token: %s' % (token_type, token_field))
piston3.oauth.OAuthError: Invalid access token: nrcy9EJPnDW9eazMnN

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/utils/views.py", line 185, in view_atomic_with_post_commit_savepoint
    return view_atomic(*args, **kwargs)
  File "/usr/lib/python3.5/contextlib.py", line 30, in inner
    return func(*args, **kwds)
  File "/usr/lib/python3/dist-packages/maasserver/api/support.py", line 59, in __call__
    response = upcall(request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/django/views/decorators/vary.py", line 21, in inner_func
    response = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/piston3/resource.py", line 145, in __call__
    actor, anonymous = self.authenticate(request, rm)
  File "/usr/lib/python3/dist-packages/piston3/resource.py", line 120, in authenticate
    if not authenticator.is_authenticated(request):
  File "/usr/lib/python3/dist-packages/maasserver/api/auth.py", line 57, in is_authenticated
    raise OAuthUnauthorized(error)
maasserver.api.auth.OAuthUnauthorized: "Authorization Error: 'Invalid access token: nrcy9EJPnDW9eazMnN'"

Changed in maas:
milestone: none → 2.4.0beta2
importance: Undecided → High
status: New → Triaged
Changed in maas:
milestone: 2.4.0beta2 → 2.4.0beta3
Changed in maas:
milestone: 2.4.0beta3 → 2.4.0rc2
Changed in maas:
milestone: 2.4.0rc2 → 2.5.x
Revision history for this message
Adam Collard (adam-collard) wrote :

This bug has not seen any activity in the last 6 months, so it is being automatically closed.

If you are still experiencing this issue, please feel free to re-open.

MAAS Team

Changed in maas:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.