Closed xavpaice closed 4 years ago
This might be a simpler example, using the controller.py from the example dir:
(venv) xav@xplt:~/repos/python-libjuju/examples$ python3 controller.py
DEBUG:asyncio:Using selector: EpollSelector
DEBUG:juju.client.connection:Driver connected to juju wss://canonical-jimm.jujucharms.com:443/api
DEBUG:juju.client.connection:connection 139800843530448 -> {
"type": "Admin",
"request": "Login",
"version": 3,
"params": {
"auth-tag": null,
"macaroons": [
[
{
"identifier": "redacted",
"signature": "redacted",
"location": "jimm",
"caveats": [
{
"cid": "redacted",
"vid": "redacted",
"cl": "https://api.jujucharms.com/identity"
}
]
},
{
"identifier": "redacted",
"signature": "redacted",
"caveats": [
{
"cid": "declared username my_username"
},
{
"cid": "time-before 2020-06-11T00:32:41.490962218Z"
}
]
}
]
]
},
"request-id": 1
}
DEBUG:juju.client.connection:connection 139800843530448 <- {'request-id': 1, 'response': {'controller-tag': 'controller-3875af18-2e12-11e9-ad13-4bddbe64a218', 'user-info': {'display-name': 'my_username', 'identity': 'user-my_username@external', 'controller-access': '', 'model-access': ''}, 'facades': [{'name': 'Bundle', 'versions': [1]}, {'name': 'Cloud', 'versions': [1, 2, 3, 4, 5]}, {'name': 'Controller', 'versions': [3]}, {'name': 'JIMM', 'versions': [1]}, {'name': 'ModelManager', 'versions': [2, 3, 4, 5]}, {'name': 'Pinger', 'versions': [1]}, {'name': 'UserManager', 'versions': [1]}], 'server-version': '2.6.10'}}
WARNING:juju.client.connection:unknown facade JIMM
Traceback (most recent call last):
File "controller.py", line 41, in <module>
loop.run(main())
File "/home/xav/repos/python-libjuju/examples/venv/lib/python3.7/site-packages/juju/loop.py", line 38, in run
raise task.exception()
File "controller.py", line 20, in main
await controller.connect()
File "/home/xav/repos/python-libjuju/examples/venv/lib/python3.7/site-packages/juju/controller.py", line 111, in connect
await self._connector.connect_controller(controller_name, **kwargs)
File "/home/xav/repos/python-libjuju/examples/venv/lib/python3.7/site-packages/juju/client/connector.py", line 101, in connect_controller
specified_facades=specified_facades,
File "/home/xav/repos/python-libjuju/examples/venv/lib/python3.7/site-packages/juju/client/connector.py", line 69, in connect
self._connection = await Connection.connect(**kwargs)
File "/home/xav/repos/python-libjuju/examples/venv/lib/python3.7/site-packages/juju/client/connection.py", line 299, in connect
await self._connect_with_redirect([(endpoint, cacert)])
File "/home/xav/repos/python-libjuju/examples/venv/lib/python3.7/site-packages/juju/client/connection.py", line 671, in _connect_with_redirect
self._build_facades(login_result.get('facades', {}))
File "/home/xav/repos/python-libjuju/examples/venv/lib/python3.7/site-packages/juju/client/connection.py", line 694, in _build_facades
known = client_facades[name]['versions']
KeyError: 'JIMM'
This is using juju==2.7.1 and Python 3.7.5, with the Juju snap v 2.7.6
Unfortunately due to click-happiness I somehow closed this by accident!
When running connect() to the controller, if the current controller is JAAS (canonical-jimm.jujucharms.com), the connection errors out with "KeyError: 'JIMM'"
If I switch to a controller that I've deployed on the same cloud, the connect works fine (but eats one machine of my quota for the controller).
The traceback I'm seeing: