KeyError "password" when connecting to shared controller

Bug #1625632 reported by Andreas Hasenack
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
juju-deployer
Fix Released
Undecided
Tim Van Steenburgh

Bug Description

$ dpkg-query -W juju-deployer python-jujuclient juju-2.0
juju-2.0 2.0-beta18-0ubuntu1~16.04.1~juju1
juju-deployer 0.9.0~bzr192~56~ubuntu16.04.1
python-jujuclient 0.53.1+bzr94+35~ubuntu16.04.1

I'm not sure what changed, because this worked a few days ago. But now I cannot connect to a shared controller anymore and deploy applications with juju2:

andreas@nsn7:~$ juju list-controllers
CONTROLLER MODEL USER ACCESS+ CLOUD/REGION MODELS+ MACHINES+ VERSION+
canonistack-lcy02-b18* - ahasenack@external (unknown) canonistack/lcy02 2 1 2.0-beta18

+ these are the last known values, run with --refresh to see the latest information.

andreas@nsn7:~$ juju add-model elk --credential canonistack
Using credential 'canonistack' cached in controller
Added 'elk' model on canonistack/lcy02 with credential 'canonistack' for user 'ahasenack'

andreas@nsn7:~$ juju list-controllers
CONTROLLER MODEL USER ACCESS+ CLOUD/REGION MODELS+ MACHINES+ VERSION+
canonistack-lcy02-b18* elk ahasenack@external (unknown) canonistack/lcy02 2 1 2.0-beta18

+ these are the last known values, run with --refresh to see the latest information.

andreas@nsn7:~$ juju list-models
CONTROLLER: canonistack-lcy02-b18

MODEL OWNER STATUS ACCESS LAST CONNECTION
elk* ahasenack@external available admin never connected

andreas@nsn7:~$ juju status
MODEL CONTROLLER CLOUD/REGION VERSION
elk canonistack-lcy02-b18 canonistack/lcy02 2.0-beta18

APP VERSION STATUS SCALE CHARM STORE REV OS NOTES

UNIT WORKLOAD AGENT MACHINE PUBLIC-ADDRESS PORTS MESSAGE

MACHINE STATE DNS INS-ID SERIES AZ

Now I try to deploy applications:
$ time juju-deployer -Wdv -c landscape-and-elk.yaml -w 120
2016-09-20 10:14:00 [DEBUG] deployer.cli: Using runtime GoEnvironment on canonistack-lcy02-b18:ahasenack@external/elk
2016-09-20 10:14:00 [INFO] deployer.cli: Using deployment landscape-and-elk.yaml
2016-09-20 10:14:00 [INFO] deployer.cli: Starting deployment of landscape-and-elk.yaml
2016-09-20 10:14:00 [DEBUG] deployer.import: Getting charms...
2016-09-20 10:14:00 [DEBUG] deployer.charm: Cache dir /home/andreas/.local/share/juju/.deployer-store-cache/cs_trusty_haproxy
2016-09-20 10:14:00 [DEBUG] deployer.charm: Cache dir /home/andreas/.local/share/juju/.deployer-store-cache/cs_~ahasenack_landscape-server
2016-09-20 10:14:00 [DEBUG] deployer.charm: Cache dir /home/andreas/.local/share/juju/.deployer-store-cache/cs_trusty_postgresql
2016-09-20 10:14:00 [DEBUG] deployer.charm: Cache dir /home/andreas/.local/share/juju/.deployer-store-cache/cs_trusty_filebeat
2016-09-20 10:14:00 [DEBUG] deployer.charm: Cache dir /home/andreas/.local/share/juju/.deployer-store-cache/cs_~canonical-is-sa_trusty_apache-openid
2016-09-20 10:14:00 [DEBUG] deployer.charm: Cache dir /home/andreas/.local/share/juju/.deployer-store-cache/cs_trusty_kibana
2016-09-20 10:14:00 [DEBUG] deployer.charm: Cache dir /home/andreas/.local/share/juju/.deployer-store-cache/cs_trusty_apache2
2016-09-20 10:14:00 [DEBUG] deployer.charm: Cache dir /home/andreas/.local/share/juju/.deployer-store-cache/cs_trusty_rabbitmq-server
2016-09-20 10:14:00 [DEBUG] deployer.charm: Cache dir /home/andreas/.local/share/juju/.deployer-store-cache/cs_trusty_topbeat
2016-09-20 10:14:00 [DEBUG] deployer.charm: Cache dir /home/andreas/.local/share/juju/.deployer-store-cache/cs_trusty_filebeat
2016-09-20 10:14:00 [DEBUG] deployer.charm: Cache dir /home/andreas/.local/share/juju/.deployer-store-cache/cs_trusty_filebeat
2016-09-20 10:14:00 [DEBUG] deployer.charm: Cache dir /home/andreas/.local/share/juju/.deployer-store-cache/cs_trusty_elasticsearch-15
2016-09-20 10:14:00 [DEBUG] deployer.charm: Cache dir /home/andreas/.local/share/juju/.deployer-store-cache/cs_trusty_zulu8
2016-09-20 10:14:00 [DEBUG] deployer.charm: Cache dir /home/andreas/.local/share/juju/.deployer-store-cache/cs_trusty_logstash
2016-09-20 10:14:00 [DEBUG] deployer.deploy: Resolving configuration
2016-09-20 10:14:00 [DEBUG] deployer.env: Connecting to canonistack-lcy02-b18:ahasenack@external/elk...
Traceback (most recent call last):
  File "/usr/bin/juju-deployer", line 9, in <module>
    load_entry_point('juju-deployer==0.9.0', 'console_scripts', 'juju-deployer')()
  File "/usr/lib/python2.7/dist-packages/deployer/cli.py", line 140, in main
    run()
  File "/usr/lib/python2.7/dist-packages/deployer/cli.py", line 250, in run
    importer.Importer(env, deployment, options).run()
  File "/usr/lib/python2.7/dist-packages/deployer/action/importer.py", line 301, in run
    self.env.connect()
  File "/usr/lib/python2.7/dist-packages/deployer/env/go.py", line 78, in connect
    self.client = self.client_class.connect(self.name)
  File "/usr/lib/python2.7/dist-packages/jujuclient/environment.py", line 87, in connect
    return connector().run(cls, env_name)
  File "/usr/lib/python2.7/dist-packages/jujuclient/connector.py", line 41, in run
    jhome, data = self.parse_env(env_name)
  File "/usr/lib/python2.7/dist-packages/jujuclient/juju2/connector.py", line 62, in parse_env
    'password': account['password'],
KeyError: 'password'

Tags: canonical-is

Related branches

summary: - Keyerror "password" when connecting to shared controller
+ KeyError "password" when connecting to shared controller
Revision history for this message
Tim Kuhlman (timkuhlman) wrote :

I also have seen this issue and when I changed the code to run "account.get('password')" letting it be set to None, the call to connect failed.

Revision history for this message
Tim Kuhlman (timkuhlman) wrote :

I am able to work around the error by adding a password the .local/share/juju/accounts.yaml after that juju-deployer works fine.

Regarding an actual fix I'm able to easily bypass this error and have it fail further down the line. Digging in deeper I was able to see the login request with an empty password is getting a discharge-required-error but I wasn't able to figure out how to properly login in this case. What I have is at lp:~timkuhlman/python-jujuclient/no-password

I should also note that in my test setup I am doing this all with LXD.

Revision history for this message
Tim Kuhlman (timkuhlman) wrote :

I have now seen this problem on an Openstack deployment also.

Revision history for this message
Paul Gear (paulgear) wrote :

I'm seeing this bug with the shared access Canonistack controller. This means that we're unable to deploy using that controller with juju-deployer.

tags: added: canonical-is
Revision history for this message
Francesco Banconi (frankban) wrote :

The KeyError is related to https://bugs.launchpad.net/juju/+bug/1631772
The discharge required error is due to the fact that juju-deployer, AFAIK, does not support macaroons based auth.

Changed in juju-deployer:
assignee: nobody → Tim Van Steenburgh (tvansteenburgh)
status: New → In Progress
Revision history for this message
Tim Van Steenburgh (tvansteenburgh) wrote :

r97, released in ppa:tvansteenburgh/ppa

Changed in juju-deployer:
status: In Progress → Fix Released
Revision history for this message
Tim Van Steenburgh (tvansteenburgh) wrote :

Oops, not actually released yet.

Changed in juju-deployer:
status: Fix Released → In Progress
Changed in juju-deployer:
status: In Progress → Fix Committed
Changed in juju-deployer:
status: Fix Committed → Fix Released
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.