Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1204482 - nova-novncproxy fails with ValidationError: Origin header protocol does not match this host
nova-novncproxy fails with ValidationError: Origin header protocol does not m...
Status: CLOSED ERRATA
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-packstack (Show other bugs)
6.0 (Juno)
Unspecified Linux
high Severity high
: z2
: 6.0 (Juno)
Assigned To: Ivan Chavero
Ami Jeain
: Regression, ZStream
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-03-22 09:55 EDT by Nir Magnezi
Modified: 2015-04-07 11:11 EDT (History)
10 users (show)

See Also:
Fixed In Version: openstack-packstack-2014.2-0.20.dev1467.g70c9655.el7ost
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-04-07 11:11:20 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
packstack logs (1.52 MB, application/x-gzip)
2015-03-22 09:56 EDT, Nir Magnezi
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Launchpad 1436969 None None None Never
OpenStack gerrit 168195 None None None Never
Red Hat Product Errata RHSA-2015:0789 normal SHIPPED_LIVE Important: openstack-packstack and openstack-puppet-modules security and bug fix update 2015-04-07 15:08:02 EDT

  None (edit)
Description Nir Magnezi 2015-03-22 09:55:48 EDT
Description of problem:
=======================
nova-novncproxy does not work.
Deployed with packstack (answer file attached).
It works for some topologies, yet it fails for a distributed topology that consists from: controller, networker, 2 computes.

Version-Release number of selected component (if applicable):
=============================================================
RHEL-OSP6: 2015-03-20.2
openstack-packstack-2014.2-0.18.dev1462.gbb05296.el7ost.noarch
openstack-packstack-puppet-2014.2-0.18.dev1462.gbb05296.el7ost.noarch

How reproducible:
=================
2/2

Steps to Reproduce:
===================
1. Deploy openstack using packstack with the attached answer file.
2. Boot an instance.
3. Try to open VNC console.

Actual results:
===============
VNC Console fails to open.
snipped from nova-novncproxy:

  File "/usr/lib/python2.7/site-packages/websockify/websocket.py", line 711, in top_new_client
    self.new_client()
  File "/usr/lib/python2.7/site-packages/nova/console/websocketproxy.py", line 177, in new_client
    self.new_websocket_client()
  File "/usr/lib/python2.7/site-packages/nova/console/websocketproxy.py", line 108, in new_websocket_client
    raise exception.ValidationError(detail=detail)
ValidationError: Origin header protocol does not match this host.

Expected results:
=================
Should work with no errors.
Comment 4 Nir Magnezi 2015-03-22 09:56:39 EDT
Created attachment 1005055 [details]
packstack logs
Comment 7 Lars Kellogg-Stedman 2015-03-24 16:54:22 EDT
Can you confirm that (a) you are accessing your dashboard via https and (b) the output of "nova get-vnc-console <instance_name_or_id> novnc" returns an http url?

If you click on the "Click here to show only console" link, does that work?
Comment 8 Nir Magnezi 2015-03-26 04:19:06 EDT
(In reply to Lars Kellogg-Stedman from comment #7)
> Can you confirm that (a) you are accessing your dashboard via https and (b)
> the output of "nova get-vnc-console <instance_name_or_id> novnc" returns an
> http url?
> 
> If you click on the "Click here to show only console" link, does that work?

I re-installed to verify the answers for your questions.

a) Horizon works now (for some reason..) and I can access it via https. due i have to say it seems that the login stage is a bit slow..

b) the output of get-vnc-console is an https url.
Comment 9 Lars Kellogg-Stedman 2015-03-26 09:41:00 EDT
I've had a chance to look at this environment, and there are at least two things going on here. The error described in this biz...

    ValidationError: Origin header protocol does not match this host.

...is caused because nova-novncproxy is comparing the protocol being used to access the proxy (https) against the url used in novavncproxy_base_url in /etc/nova/nova.conf.  This is a problem, because in general that setting is only required on the compute nodes, and is left unset on the controller.  The short term solution is to modify that setting on the controller to match the setting on the compute hosts:

    novncproxy_base_url=https://10.35.161.235:6080/vnc_auto.html

Setting this resolves the 'protocol does not match' error.  However, I am still unable to get the console to operate because novncproxy is throwing the following exception:

2015-03-26 15:36:38.726 25407 INFO nova.console.websocketproxy [-] Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/websockify/websocket.py", line 697, in top_new_client
  File "/usr/lib/python2.7/site-packages/websockify/websocket.py", line 629, in do_handshake
    # Continue on to handle WebSocket upgrade
AttributeError: WSRequestHandler instance has no attribute 'last_code'

The Internet suggests that this may be indicative of some sort of certificate problem, although it also appears to be a clear bug in nova-novncproxy, which is expecting this attribute to be available at all times when clearly it is not.
Comment 10 Lars Kellogg-Stedman 2015-03-26 12:06:59 EDT
With websockify 0.6.0, the "WSRequestHandler instance has no attribute 'last_code'" exception is gone, but the browser connection is still closing for some reason...but I can't rule out my connectivity to the TLV lab, which seems to be pretty awful today.  In any case, that's a separate issue; we've identified the cause behind this bz and should probably just update packstack to handle the nova configuration on the controller appropriately.
Comment 11 Lars Kellogg-Stedman 2015-03-26 13:39:49 EDT
I opened https://bugs.launchpad.net/puppet-nova/+bug/1436969 against puppet-nova, since anything relying on those modules is going to experience the same problem.
Comment 12 Lars Kellogg-Stedman 2015-03-26 14:15:56 EDT
If we solve this in packstack, we could do it like this:

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

ichavero is working on a puppet-nova fix.
Comment 13 Ivan Chavero 2015-03-27 15:40:31 EDT
Can i have acks qe and pm acks for this bug?

thanks!
Comment 14 Lars Kellogg-Stedman 2015-03-28 14:23:28 EDT
New patches are here:

puppet-nova: https://review.openstack.org/#/c/168545/
packstack: https://review.openstack.org/#/c/168547/
Comment 15 Ivan Chavero 2015-03-30 05:54:51 EDT
This bug also needs a new OPM packages: openstack-puppet-modules-2014.2.12-4.el7ost
Comment 17 Lars Kellogg-Stedman 2015-03-30 17:05:22 EDT
FYI:

The puppet-nova patch was rejected and needed to be re-worked.  There are new patches available at:

[puppet-nova] https://review.openstack.org/#/c/168545/
[packstack] https://review.openstack.org/#/c/169079/
Comment 18 Ivan Chavero 2015-03-31 23:11:07 EDT
created a package with a more accepted upstream patch.
Comment 20 Ami Jeain 2015-04-02 07:48:32 EDT
verified novnc works using the attached answer file, on:
# rpm -qa |grep openstack-packstack-2014
openstack-packstack-2014.2-0.20.dev1467.g70c9655.el7ost.noarch
Comment 21 Ami Jeain 2015-04-02 11:08:52 EDT
verified:
use the attached answerfile.
nova get-vnc-console INSTANCE_NAME novnc

open the output url in the browser and it worked
Comment 23 errata-xmlrpc 2015-04-07 11:11:20 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-0789.html

Note You need to log in before you can comment on or make changes to this bug.