Unable to access console via dashboard

Bug #1770348 reported by Shilpa Devharakar
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Expired
Undecided
Unassigned

Bug Description

Description
===========
VNC Console in Dashboard fails to connect after pulling current master (commit 50f42333f5b59d39ddf4c7c1f1aefc32908ac8d1) and unable to access console on dashboard, it gives invalid token error.

Earlier console was working but it failed after below patch got merged:
https://review.openstack.org/#/c/325414/ >> Use ConsoleAuthToken object to generate authorizations

Steps to reproduce
==================
1. Pull current master for nova
2. Make sure noVNC version points to stable/v0.6
3. Confirm nova configuration file points to
4. novncproxy_base_url = http://<ip_address>/vnc_auto.html
5. Restart the nova services.
6. Cretae instance and access console for it via dashboard.

Expected result
===============
One should successfully able to access console for instance on dashboard.

Actual result
=============
ERROR nova.console.websocketproxy InvalidToken: The token '***' is invalid or has expired

Logs & Configs
==============
1. Nova.conf

[vnc]
xvpvncproxy_host = 0.0.0.0
novncproxy_host = 0.0.0.0
server_proxyclient_address = 127.0.0.1
server_listen = 127.0.0.1
xvpvncproxy_base_url = http://<ip_address>/console
novncproxy_base_url = http://<ip_address>/vnc_auto.html

2. nova-novncproxy logs

INFO nova.console.websocketproxy [-] 10.232.48.204 - - [09/May/2018 15:08:50] 10.232.48.204: Plain non-SSL (ws://) WebSocket connection
INFO nova.console.websocketproxy [-] 10.232.48.204 - - [09/May/2018 15:08:50] 10.232.48.204: Version hybi-13, base64: 'False'
INFO nova.console.websocketproxy [-] 10.232.48.204 - - [09/May/2018 15:08:50] 10.232.48.204: Path: '/websockify?token=93810ef7-7db8-4cd9-b40c-ddc58795a080'
DEBUG oslo_db.sqlalchemy.engines [None req-4608b6a7-1709-4f77-aef9-4f50117e3d03 None None] MySQL server mode set to STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION {{(pid=28561) _check_effective_sql_mode /usr/local/lib/python2.7/dist-packages/oslo_db/sqlalchemy/engines.py:308}}
DEBUG nova.objects.console_auth_token [None req-4608b6a7-1709-4f77-aef9-4f50117e3d03 None None] Token validation failed {{(pid=28561) validate /opt/stack/nova/nova/objects/console_auth_token.py:143}}
INFO nova.console.websocketproxy [None req-4608b6a7-1709-4f77-aef9-4f50117e3d03 None None] handler exception: The token '***' is invalid or has expired
DEBUG nova.console.websocketproxy [None req-4608b6a7-1709-4f77-aef9-4f50117e3d03 None None] exception {{(pid=28561) vmsg /usr/local/lib/python2.7/dist-packages/websockify-0.8.0-py2.7.egg/websockify/websocket.py:875}}
ERROR nova.console.websocketproxy Traceback (most recent call last):
ERROR nova.console.websocketproxy File "/usr/local/lib/python2.7/dist-packages/websockify-0.8.0-py2.7.egg/websockify/websocket.py", line 930, in top_new_client
ERROR nova.console.websocketproxy client = self.do_handshake(startsock, address)
ERROR nova.console.websocketproxy File "/usr/local/lib/python2.7/dist-packages/websockify-0.8.0-py2.7.egg/websockify/websocket.py", line 860, in do_handshake
ERROR nova.console.websocketproxy self.RequestHandlerClass(retsock, address, self)
ERROR nova.console.websocketproxy File "/opt/stack/nova/nova/console/websocketproxy.py", line 324, in __init__
ERROR nova.console.websocketproxy websockify.ProxyRequestHandler.__init__(self, *args, **kwargs)
ERROR nova.console.websocketproxy File "/usr/local/lib/python2.7/dist-packages/websockify-0.8.0-py2.7.egg/websockify/websocket.py", line 114, in __init__
ERROR nova.console.websocketproxy SimpleHTTPRequestHandler.__init__(self, req, addr, server)
ERROR nova.console.websocketproxy File "/usr/lib/python2.7/SocketServer.py", line 652, in __init__
ERROR nova.console.websocketproxy self.handle()
ERROR nova.console.websocketproxy File "/usr/local/lib/python2.7/dist-packages/websockify-0.8.0-py2.7.egg/websockify/websocket.py", line 581, in handle
ERROR nova.console.websocketproxy SimpleHTTPRequestHandler.handle(self)
ERROR nova.console.websocketproxy File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
ERROR nova.console.websocketproxy self.handle_one_request()
 File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
  method()
 File "/usr/local/lib/python2.7/dist-packages/websockify-0.8.0-py2.7.egg/websockify/websocket.py", line 543, in do_GET
  if not self.handle_websocket():
 File "/usr/local/lib/python2.7/dist-packages/websockify-0.8.0-py2.7.egg/websockify/websocket.py", line 531, in handle_websocket
  self.new_websocket_client()
 File "/opt/stack/nova/nova/console/websocketproxy.py", line 236, in new_websocket_client
  connect_info = self._get_connect_info(ctxt, token)
 File "/opt/stack/nova/nova/console/websocketproxy.py", line 192, in _get_connect_info
  connect_info = self._get_connect_info_database(ctxt, token)
 File "/opt/stack/nova/nova/console/websocketproxy.py", line 159, in _get_connect_info_database
  objects.ConsoleAuthToken.validate(ctxt, token))
 File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", line 184, in wrapper
  result = fn(cls, context, *args, **kwargs)
 File "/opt/stack/nova/nova/objects/console_auth_token.py", line 144, in validate
  raise exception.InvalidToken(token='***')
ERROR nova.console.websocketproxy InvalidToken: The token '***' is invalid or has expired

Tags: console vnc
description: updated
Revision history for this message
Matt Riedemann (mriedem) wrote :

How did you deploy nova? Are you using devstack? If so, you need some devstack changes also:

https://review.openstack.org/#/c/484973/

https://review.openstack.org/#/c/567298/

tags: added: console vnc
Revision history for this message
Matt Riedemann (mriedem) wrote :

Also see this workaround if you're not using devstack:

https://review.openstack.org/#/c/333990/37/nova/conf/workarounds.py

Changed in nova:
status: New → Incomplete
Revision history for this message
Shilpa Devharakar (shilpasd) wrote :

Thanks Matt, after fetching below devstack changes able to access console in dashboard.

https://review.openstack.org/#/c/484973/

https://review.openstack.org/#/c/567298/

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for OpenStack Compute (nova) because there has been no activity for 60 days.]

Changed in nova:
status: Incomplete → Expired
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.