Bug 1248983 - SPICE-XPI: Spice fails when using proxy
SPICE-XPI: Spice fails when using proxy
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: spice-xpi (Show other bugs)
6.7
x86_64 Linux
unspecified Severity urgent
: rc
: ---
Assigned To: Christophe Fergeau
SPICE QE bug list
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-31 05:21 EDT by Martin
Modified: 2015-08-03 07:19 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-03 07:19:46 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)

  None (edit)
Description Martin 2015-07-31 05:21:44 EDT
Description of problem:
When launching a spice session using a spice proxy, the connection fails with error message "unable to connect to graphics server".

Version-Release number of selected component (if applicable):
spice-xpi-2.7-27.el6.x86_64


How reproducible:
You will need a spice proxy

Steps to Reproduce:
1. Launch firefox 38.1.0 with the environment variable SPICE_PROXY set
2. Connect to a VM through rhev using spice

Actual results:
Error popup showing "could not connect to graphic server"

Additional info:

I have managed to get around this issue by downgrading spice-xpi to spice-xpi-2.7-25.el6.x86_64 and reopening firefox. 

when using spice-xpi-2.7-27 the ~.spicec/spice-xpi log shows the following:

2015-07-31 11:16:38,349 INFO  nsPluginInstance::Connect: SPICE_XPI_SOCKET: /tmp/spicec-Fuf4P5/spice-xpi
2015-07-31 11:16:38,349 INFO  nsPluginInstance::Connect: SPICE_PROXY unset
2015-07-31 11:16:38,349 INFO  nsPluginInstance::Connect: SPICE_FOREIGN_MENU_SOCKET: /tmp/spicec-Fuf4P5/spice-foreign
2015-07-31 11:16:38,350 INFO  nsPluginInstance::Connect: Launching /usr/libexec/spice-xpi-client 
2015-07-31 11:16:40,356 INFO  nsPluginInstance::Connect: Initiating connection with controller
2015-07-31 11:16:51,537 ERROR nsPluginInstance::CallOnDisconnected: could not get browser window, when trying to call OnDisconnected

When using spice-xpi-2.7-25:
2015-07-31 10:55:39,198 INFO  nsPluginInstance::Connect: SPICE_XPI_SOCKET: /tmp/spicec-aGgDDf/spice-xpi
2015-07-31 10:55:39,198 INFO  nsPluginInstance::Connect: SPICE_FOREIGN_MENU_SOCKET: /tmp/spicec-aGgDDf/spice-foreign
2015-07-31 10:55:39,199 INFO  nsPluginInstance::Connect: Launching /usr/libexec/spice-xpi-client 
2015-07-31 10:55:41,201 INFO  nsPluginInstance::Connect: Initiating connection with controller
2015-07-31 10:55:57,887 ERROR nsPluginInstance::CallOnDisconnected: could not get browser window, when trying to call OnDisconnected
Comment 1 Christophe Fergeau 2015-07-31 05:27:52 EDT
(In reply to Martin from comment #0)
> Description of problem:
> When launching a spice session using a spice proxy, the connection fails
> with error message "unable to connect to graphics server".
> 
> Version-Release number of selected component (if applicable):
> spice-xpi-2.7-27.el6.x86_64
> 
> 
> How reproducible:
> You will need a spice proxy
> 
> Steps to Reproduce:
> 1. Launch firefox 38.1.0 with the environment variable SPICE_PROXY set

Setting SPICE_PROXY should not be needed, there is a checkbox in RHEV console options to indicate whether a proxy should be used or not for the SPICE connection. Is the "Use SPICE proxy" checkbox checked in RHEV console options?

It's expected that the latest spice-xpi build clears the SPICE_PROXY variable  from the environment if SPICE proxy use is disabled in RHEV console options.
Comment 3 Martin 2015-07-31 06:05:12 EDT
(In reply to Christophe Fergeau from comment #1)
> (In reply to Martin from comment #0)
> > Description of problem:
> > When launching a spice session using a spice proxy, the connection fails
> > with error message "unable to connect to graphics server".
> > 
> > Version-Release number of selected component (if applicable):
> > spice-xpi-2.7-27.el6.x86_64
> > 
> > 
> > How reproducible:
> > You will need a spice proxy
> > 
> > Steps to Reproduce:
> > 1. Launch firefox 38.1.0 with the environment variable SPICE_PROXY set
> 
> Setting SPICE_PROXY should not be needed, there is a checkbox in RHEV
> console options to indicate whether a proxy should be used or not for the
> SPICE connection. Is the "Use SPICE proxy" checkbox checked in RHEV console
> options?
> 
> It's expected that the latest spice-xpi build clears the SPICE_PROXY
> variable  from the environment if SPICE proxy use is disabled in RHEV
> console options.

We are connecting to the RHEV through locally forwarded ports through a jumphost, so the SPICE_PROXY variable is set to http//localhost:<some random port> with the port number being randomized each time firefox is launched.

In order to select the SPICE proxy option in the RHEV console options I have to define a spice proxy on the rhev manager, and since the forwarded port is randomized each time the client launches firefox we have no way of telling the rhev manager what port to use other than through a client side environment variable.

So if I'm understanding you correctly it's not possible to use the SPICE_PROXY environment variable any more?
Comment 4 Christophe Fergeau 2015-07-31 12:06:26 EDT
(In reply to Martin from comment #3)
> (In reply to Christophe Fergeau from comment #1)
> > (In reply to Martin from comment #0)
> > > Description of problem:
> > > When launching a spice session using a spice proxy, the connection fails
> > > with error message "unable to connect to graphics server".
> > > 
> > > Version-Release number of selected component (if applicable):
> > > spice-xpi-2.7-27.el6.x86_64
> > > 
> > > 
> > > How reproducible:
> > > You will need a spice proxy
> > > 
> > > Steps to Reproduce:
> > > 1. Launch firefox 38.1.0 with the environment variable SPICE_PROXY set
> > 
> > Setting SPICE_PROXY should not be needed, there is a checkbox in RHEV
> > console options to indicate whether a proxy should be used or not for the
> > SPICE connection. Is the "Use SPICE proxy" checkbox checked in RHEV console
> > options?
> > 
> > It's expected that the latest spice-xpi build clears the SPICE_PROXY
> > variable  from the environment if SPICE proxy use is disabled in RHEV
> > console options.
> 
> We are connecting to the RHEV through locally forwarded ports through a
> jumphost, so the SPICE_PROXY variable is set to http//localhost:<some random
> port> with the port number being randomized each time firefox is launched.
> 
> In order to select the SPICE proxy option in the RHEV console options I have
> to define a spice proxy on the rhev manager, and since the forwarded port is
> randomized each time the client launches firefox we have no way of telling
> the rhev manager what port to use other than through a client side
> environment variable.
> 
> So if I'm understanding you correctly it's not possible to use the
> SPICE_PROXY environment variable any more?

Well, this variable is used by spice-xpi to enable/disable proxy as instructed by RHEV. Before spice-xpi-2.7-27.el6, the proxy could be set, but not unset (see bug #1049475), which is why in your case, setting SPICE_PROXY before starting firefox worked (the plugin never removed it from the environment).
Unsetting SPICE_PROXY is the only change between -26 and -27, so one option is to stay with that build.

A more future-proof option though could be to use update-alternatives to set a custom 'spice-xpi-client' which would be a simple shell-script setting SPICE_PROXY to the right value, and then starting remote-viewer, eg

#!/bin/sh
export SPICE_PROXY=xxxx
/usr/bin/remote-viewer $@

The SPICE_PROXY variable would be set after spice-xpi removes it from the environment, so remote-viewer would be able to use your custom SPICE_PROXY value
Could this work for you?
Comment 5 David Blechter 2015-07-31 13:39:19 EDT
(In reply to Martin from comment #0)
> Description of problem:
> When launching a spice session using a spice proxy, the connection fails
> with error message "unable to connect to graphics server".
> 
> Version-Release number of selected component (if applicable):
> spice-xpi-2.7-27.el6.x86_64
> 
> 
> How reproducible:
> You will need a spice proxy
> 
> Steps to Reproduce:
> 1. Launch firefox 38.1.0 with the environment variable SPICE_PROXY set
> 2. Connect to a VM through rhev using spice
> 
> Actual results:
> Error popup showing "could not connect to graphic server"
> 
> Additional info:
> 
> I have managed to get around this issue by downgrading spice-xpi to
> spice-xpi-2.7-25.el6.x86_64 and reopening firefox. 
> 
> when using spice-xpi-2.7-27 the ~.spicec/spice-xpi log shows the following:
> 
> 2015-07-31 11:16:38,349 INFO  nsPluginInstance::Connect: SPICE_XPI_SOCKET:
> /tmp/spicec-Fuf4P5/spice-xpi
> 2015-07-31 11:16:38,349 INFO  nsPluginInstance::Connect: SPICE_PROXY unset
> 2015-07-31 11:16:38,349 INFO  nsPluginInstance::Connect:
> SPICE_FOREIGN_MENU_SOCKET: /tmp/spicec-Fuf4P5/spice-foreign
> 2015-07-31 11:16:38,350 INFO  nsPluginInstance::Connect: Launching
> /usr/libexec/spice-xpi-client 
> 2015-07-31 11:16:40,356 INFO  nsPluginInstance::Connect: Initiating
> connection with controller
> 2015-07-31 11:16:51,537 ERROR nsPluginInstance::CallOnDisconnected: could
> not get browser window, when trying to call OnDisconnected
> 
> When using spice-xpi-2.7-25:
> 2015-07-31 10:55:39,198 INFO  nsPluginInstance::Connect: SPICE_XPI_SOCKET:
> /tmp/spicec-aGgDDf/spice-xpi
> 2015-07-31 10:55:39,198 INFO  nsPluginInstance::Connect:
> SPICE_FOREIGN_MENU_SOCKET: /tmp/spicec-aGgDDf/spice-foreign
> 2015-07-31 10:55:39,199 INFO  nsPluginInstance::Connect: Launching
> /usr/libexec/spice-xpi-client 
> 2015-07-31 10:55:41,201 INFO  nsPluginInstance::Connect: Initiating
> connection with controller
> 2015-07-31 10:55:57,887 ERROR nsPluginInstance::CallOnDisconnected: could
> not get browser window, when trying to call OnDisconnected

did you contact the customer support team prior to opening this BZ?
Comment 6 Martin 2015-08-03 03:46:31 EDT
(In reply to Christophe Fergeau from comment #4)
> (In reply to Martin from comment #3)
> > (In reply to Christophe Fergeau from comment #1)
> > > (In reply to Martin from comment #0)
> > > > Description of problem:
> > > > When launching a spice session using a spice proxy, the connection fails
> > > > with error message "unable to connect to graphics server".
> > > > 
> > > > Version-Release number of selected component (if applicable):
> > > > spice-xpi-2.7-27.el6.x86_64
> > > > 
> > > > 
> > > > How reproducible:
> > > > You will need a spice proxy
> > > > 
> > > > Steps to Reproduce:
> > > > 1. Launch firefox 38.1.0 with the environment variable SPICE_PROXY set
> > > 
> > > Setting SPICE_PROXY should not be needed, there is a checkbox in RHEV
> > > console options to indicate whether a proxy should be used or not for the
> > > SPICE connection. Is the "Use SPICE proxy" checkbox checked in RHEV console
> > > options?
> > > 
> > > It's expected that the latest spice-xpi build clears the SPICE_PROXY
> > > variable  from the environment if SPICE proxy use is disabled in RHEV
> > > console options.
> > 
> > We are connecting to the RHEV through locally forwarded ports through a
> > jumphost, so the SPICE_PROXY variable is set to http//localhost:<some random
> > port> with the port number being randomized each time firefox is launched.
> > 
> > In order to select the SPICE proxy option in the RHEV console options I have
> > to define a spice proxy on the rhev manager, and since the forwarded port is
> > randomized each time the client launches firefox we have no way of telling
> > the rhev manager what port to use other than through a client side
> > environment variable.
> > 
> > So if I'm understanding you correctly it's not possible to use the
> > SPICE_PROXY environment variable any more?
> 
> Well, this variable is used by spice-xpi to enable/disable proxy as
> instructed by RHEV. Before spice-xpi-2.7-27.el6, the proxy could be set, but
> not unset (see bug #1049475), which is why in your case, setting SPICE_PROXY
> before starting firefox worked (the plugin never removed it from the
> environment).
> Unsetting SPICE_PROXY is the only change between -26 and -27, so one option
> is to stay with that build.
> 
> A more future-proof option though could be to use update-alternatives to set
> a custom 'spice-xpi-client' which would be a simple shell-script setting
> SPICE_PROXY to the right value, and then starting remote-viewer, eg
> 
> #!/bin/sh
> export SPICE_PROXY=xxxx
> /usr/bin/remote-viewer $@
> 
> The SPICE_PROXY variable would be set after spice-xpi removes it from the
> environment, so remote-viewer would be able to use your custom SPICE_PROXY
> value
> Could this work for you?

Thank you, I will look into it. 

You may close this ticket.

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