'astara-ctl ssh' command broken

Bug #1524592 reported by Eric Lopez on 2015-12-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Astara
Undecided
Unassigned
Kilo
Undecided
Unassigned
Liberty
Undecided
Unassigned

Bug Description

astara-ctl ssh command should connect via SSH to the resource on the management interface.

stack@devstack:/opt/stack/logs$ astara-ctl --debug --verbose ssh c2c5eebe-7157-475b-9762-6184bddf9be3
WARNING: 'astara-ctl ssh' is deprecated in favor of 'astara-ctl ssh' and will be removed in the Mitaka release.
REQ: curl -i http://127.0.0.1:5000/v2.0/tokens -X POST -H "User-Agent: python-neutronclient" -d '{"auth": {"tenantName": null, "passwordCredentials": {"username": null, "password": null}}}'
RESP: 400 {'Content-Length': '260', 'Vary': 'X-Auth-Token', 'Server': 'Apache/2.4.7 (Ubuntu)', 'Connection': 'close', 'Date': 'Thu, 10 Dec 2015 03:11:48 GMT', 'Content-Type': 'application/json', 'x-openstack-request-id': 'req-fdfb12fb-1814-4836-b65a-3ee77bab2d0a'} {"error": {"message": "Expecting to find username or userId in passwordCredentials - the server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error.", "code": 400, "title": "Bad Request"}}
{"error": {"message": "Expecting to find username or userId in passwordCredentials - the server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error.", "code": 400, "title": "Bad Request"}}
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 374, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/cliff/command.py", line 54, in run
    self.take_action(parsed_args)
  File "/opt/stack/astara/astara/cli/router.py", line 166, in take_action
    ports = n_c.show_router(router_id).get('router', {}).get('ports', {})
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 102, in with_params
    ret = self.function(instance, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 658, in show_router
    return self.get(self.router_path % (router), params=_params)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 293, in get
    headers=headers, params=params)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 270, in retry_request
    headers=headers, params=params)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 200, in do_request
    content_type=self.content_type())
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/client.py", line 158, in do_request
    self.authenticate_and_fetch_endpoint_url()
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/client.py", line 123, in authenticate_and_fetch_endpoint_url
    self.authenticate()
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/client.py", line 237, in authenticate
    self._authenticate_keystone()
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/client.py", line 218, in _authenticate_keystone
    raise exceptions.Unauthorized(message=resp_body)
Unauthorized: {"error": {"message": "Expecting to find username or userId in passwordCredentials - the server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error.", "code": 400, "title": "Bad Request"}}
Traceback (most recent call last):
  File "/usr/local/bin/astara-ctl", line 10, in <module>
    sys.exit(main())
  File "/opt/stack/astara/astara/cli/main.py", line 24, in main
    return app.RugController().run(args)
  File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 255, in run
    result = self.run_subcommand(remainder)
  File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 374, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/cliff/command.py", line 54, in run
    self.take_action(parsed_args)
  File "/opt/stack/astara/astara/cli/router.py", line 166, in take_action
    ports = n_c.show_router(router_id).get('router', {}).get('ports', {})
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 102, in with_params
    ret = self.function(instance, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 658, in show_router
    return self.get(self.router_path % (router), params=_params)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 293, in get
    headers=headers, params=params)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 270, in retry_request
    headers=headers, params=params)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 200, in do_request
    content_type=self.content_type())
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/client.py", line 158, in do_request
    self.authenticate_and_fetch_endpoint_url()
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/client.py", line 123, in authenticate_and_fetch_endpoint_url
    self.authenticate()
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/client.py", line 237, in authenticate
    self._authenticate_keystone()
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/client.py", line 218, in _authenticate_keystone
    raise exceptions.Unauthorized(message=resp_body)
neutronclient.common.exceptions.Unauthorized: {"error": {"message": "Expecting to find username or userId in passwordCredentials - the server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error.", "code": 400, "title": "Bad Request"}}

zhang sheng (langyxxl) wrote :

I have the same problem.

It seems devstack forgot put some configuration in "/etc/astara/orchestrator.ini". Then I add these to config file

auth_strategy = keystone
admin_user = admin
admin_password = "YOURPASSWORD"
admin_tenant_name = admin

All things is right now.

Reviewed: https://review.openstack.org/262956
Committed: https://git.openstack.org/cgit/openstack/astara/commit/?id=f24c5a1eee24b3793a4850018a1a1a410eb58d43
Submitter: Jenkins
Branch: master

commit f24c5a1eee24b3793a4850018a1a1a410eb58d43
Author: Eric Lopez <email address hidden>
Date: Sat Jan 2 00:08:51 2016 -0800

    Fixed astara-ctl ssh command

    * Modified 'RouterSSH' class to parse neutron ports for ASTARA:MGT port
    * Added Exception Handling in class for key or index error
    * Fixed ssh username used for connection
    * Generalized variable name for managment ip address usage

    Change-Id: I2b06e5cb512612cd1b99a438568ddd17a1653c84
    Closes-Bug: #1524592

Changed in astara:
status: New → Fix Released

Reviewed: https://review.openstack.org/275345
Committed: https://git.openstack.org/cgit/openstack/astara/commit/?id=d35432a5d38a5ba06adb686eaaa5e4ef9700b4e1
Submitter: Jenkins
Branch: stable/kilo

commit d35432a5d38a5ba06adb686eaaa5e4ef9700b4e1
Author: Ryan Petrello <email address hidden>
Date: Tue Feb 2 09:51:49 2016 -0800

    Fixed astara-ctl ssh command

    * Modified 'RouterSSH' class to parse neutron ports for ASTARA:MGT port
    * Added Exception Handling in class for key or index error
    * Fixed ssh username used for connection
    * Generalized variable name for management ip address usage

    Change-Id: Ia02c3718796e2c6b59312f5341ced76dd18dd8a2
    Partial-Bug: #1524592

tags: added: in-stable-kilo

Reviewed: https://review.openstack.org/275390
Committed: https://git.openstack.org/cgit/openstack/astara/commit/?id=d608aa61eef2231b2492eab4c707a4214d6b0ee9
Submitter: Jenkins
Branch: stable/liberty

commit d608aa61eef2231b2492eab4c707a4214d6b0ee9
Author: Ryan Petrello <email address hidden>
Date: Sat Jan 2 00:08:51 2016 -0800

    Fixed astara-ctl ssh command

    * Modified 'RouterSSH' class to parse neutron ports for ASTARA:MGT port
    * Added Exception Handling in class for key or index error
    * Fixed ssh username used for connection
    * Generalized variable name for managment ip address usage

    Closes-Bug: #1524592

    Conflicts:
     akanda/rug/cli/router.py
    Change-Id: I2b06e5cb512612cd1b99a438568ddd17a1653c84

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers