Ubuntu – How to resolve a 401 error when setting up Juju MAAS environment

jujumaas

Here is the debug output:

  
2014-01-14 17:09:57 DEBUG juju.environs.configstore disk.go:77 Making /home/neo/.juju/environments
2014-01-14 17:09:57 INFO juju.environs open.go:156 environment info already exists; using New not Prepare
2014-01-14 17:09:57 DEBUG juju.provider.maas environprovider.go:33 opening environment "maas".
2014-01-14 17:09:58 ERROR juju supercommand.go:282 could not access file 'aead8cd6-dc25-4b05-8b31-b7696316546b-provider-state': gomaasapi: got error back from server: 401 UNAUTHORIZED
ERROR 2014-01-14 11:28:47,651 maasserver ################################ Exception:  ################################
ERROR 2014-01-14 11:28:47,652 maasserver Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 115, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/decorators/vary.py", line 19, in inner_func
    response = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/piston/resource.py", line 128, in __call__
    actor, anonymous = self.authenticate(request, rm)
  File "/usr/lib/python2.7/dist-packages/maasserver/api_support.py", line 47, in authenticate
    RestrictedResource, self).authenticate(request, rm)
  File "/usr/lib/python2.7/dist-packages/piston/resource.py", line 103, in authenticate
    if not authenticator.is_authenticated(request):
  File "/usr/lib/python2.7/dist-packages/maasserver/api_auth.py", line 57, in is_authenticated
    raise OAuthUnauthorized(error)
OAuthUnauthorized

I am trying to connect to my freshly setup maas enviroment. Has anyone else seen this error?

Best Answer

I've actually stumbled upon this error and it was some time ago, but I'm afraid I don't remember the details and the logs AND that version of that maas test server is looong gone.

If memory serves though...I'd go for one of the next 2

1 - "Misconfigured environment" If you tried bootstrapping with a misconfigured yaml with small errors previously and it failed (such as credentials or MaaS IP), then you should delete the environment manually and retry. The file "your_environment.jenv" should be at ~/.juju/environments . There used to be a bug (or feature) that wouldn't let a new yaml configuration overwrite the old environment, which meant that whatever changes you made to correct it, wouldn't really matter.

2 - Configuration Issue. Unless MaaS is vanilla try running dpkg-reconfigure on your maas-cluster-controller & region-controller. On that note...Try talking over plain HTTP. (Adjusting the url in the environments.yaml and the maas url for the cluster & region in the reconfigure window).

Related Question