repeated login attempt to websockets api results in confusing error message

Bug #1579836 reported by Chad Smith on 2016-05-09
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

When logging into the webscockets API with juju2,0, If a repeated login attempt is made while the connection is already active, the API error response seems incorrect.

 { u'Error': u'unknown version (3) of interface "Admin"',
    u'ErrorCode': u'not implemented',
    u'RequestId': 1,
    u'Response': { }}

Is there someway the API could either ignore the repeated login attempt with a success or report a more appropriate error or warning message?

To reproduce, juju-2.0 bootstrap an environment

Apply the following patch to intentionally make two login requests with python-juju-client on connect:

=== modified file ''
--- revid:<email address hidden>
+++ 2016-05-09 16:52:28 +0000
@@ -485,6 +485,7 @@
         # Store for constructing separate authenticated watch connections.
         self._creds = {'password': password, 'user': user}
         result = self._rpc(login_args)
+ result = self._rpc(login_args)
         self._auth = True
         self._info = copy.deepcopy(result)
         return result

Ensure JUJU_DATA is properly exported

# script to connect to default environment w/ python-juju-client.
from jujuclient import Environment

env = Environment.connect("default")

Chad Smith (chad.smith) on 2016-05-09
summary: - repeated login attempt to websockets api results in con
+ repeated login attempt to websockets api results in confusing error
+ message
Chad Smith (chad.smith) on 2016-05-12
tags: added: usability
tags: added: kanban-cross-team
tags: removed: kanban-cross-team
tags: added: api
Changed in juju-core:
status: New → Triaged
importance: Undecided → Medium
Changed in juju-core:
milestone: none → 2.0.0
affects: juju-core → juju
Changed in juju:
milestone: 2.0.0 → none
milestone: none → 2.0.0
Curtis Hovey (sinzui) on 2016-10-06
Changed in juju:
milestone: 2.0.0 → 2.0.1
Curtis Hovey (sinzui) on 2016-11-01
Changed in juju:
milestone: 2.0.1 → none
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers