Bug 1448151

Summary: Remote-viewer needs to report 'vnc-error' signal message upon connect failure
Product: Red Hat Enterprise Linux 8 Reporter: Daniel Berrangé <berrange>
Component: virt-viewerAssignee: Default Assignee for SPICE Bugs <rh-spice-bugs>
Status: NEW --- QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 8.0CC: astepano, berrange, bsanford, cfergeau, cwei, djasa, elima, fidencio, gkong, juzhou, mjenner, mzhan, rduda, spice-qe-bugs, tpelka, tzheng, victortoso
Target Milestone: rcKeywords: Triaged
Target Release: 8.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 921330 Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Comment 2 Pavel Grunt 2017-06-08 13:51:13 UTC
Why gtk-vnc reports that is connected (emits "vnc-connected"), when it is not. It would fix the issue as well and lead to the same error dialog used by the spice connection

Comment 3 Daniel Berrangé 2017-06-14 09:00:00 UTC
The 'vnc-error' signal provides details of the actual error message, which helps diagnose what the problem is. No other existing signal could be retrofitted to provide that info.

Comment 5 zhoujunqin 2019-10-15 09:59:08 UTC
Hi Daniel,
I noticed that this bug has been marked with rhel-7.8.0+ flag, and now we're in Beta phase, but this bug is still in NEW status,
Do you have any plan to fix it on rhel7.8?

BR,
juzhou.

Comment 7 zhoujunqin 2019-10-21 03:40:11 UTC
Current testing result with package version:
virt-viewer-5.0-17.el7.x86_64
gtk-vnc2-0.7.0-3.el7.x86_64

Steps:
1.Prepare a spice guest,set its port as 5900.
$ virsh dumpxml test
    <graphics type='spice' port='5900' tlsPort='5901' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
      <image compression='off'/>
    </graphics>

2. Use remote-viewer vnc instead spice to connect the guest,the window pops with "Waiting for diaplay 1...",
and then closes with no error of not being able to connect to server.

$ remote-viewer vnc://10.xx.xx.xx:5900  --debug --gtk-vnc-debug
(remote-viewer:17243): virt-viewer-DEBUG: 11:11:56.016: Opening display to vnc://10.xx.xx.xx:5900
(remote-viewer:17243): virt-viewer-DEBUG: 11:11:56.016: Guest (null) has a vnc display
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.024: vncconnection.c Init VncConnection=0x5635fd1b50f0
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.024: vncdisplaykeymap.c Using X11 backend
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.028: vncdisplaykeymap.c XKB keyboard map name 'evdev+aliases(qwerty)'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.028: vncdisplaykeymap.c Server vendor is 'The X.Org Foundation'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'Generic Event Extension'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'SHAPE'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'MIT-SHM'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'XInputExtension'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'XTEST'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'BIG-REQUESTS'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'SYNC'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'XKEYBOARD'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'XC-MISC'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'SECURITY'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'XFIXES'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'RENDER'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'RANDR'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'XINERAMA'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'Composite'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'DAMAGE'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'MIT-SCREEN-SAVER'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'DOUBLE-BUFFER'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'RECORD'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'DPMS'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'Present'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'DRI3'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'X-Resource'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'XVideo'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'XVideo-MotionCompensation'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'GLX'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'XFree86-VidModeExtension'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'XFree86-DGA'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Found extension 'DRI2'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplaykeymap.c Using evdev keycode mapping
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncdisplay.c Grab sequence is now Control_L+Alt_L
(remote-viewer:17243): virt-viewer-DEBUG: 11:11:56.029: After open connection callback fd=-1
(remote-viewer:17243): virt-viewer-DEBUG: 11:11:56.029: Opening connection to display at vnc://10.73.196.83:5900
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.029: vncconnection.c Open host=10.xx.xx.xx port=5900
(remote-viewer:17243): virt-viewer-DEBUG: 11:11:56.029: notebook show status 0x5635fd17c230
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.097: vncconnection.c Open coroutine starting
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.097: vncconnection.c Started background coroutine
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.097: vncconnection.c Resolving host 10.xx.xx.xx 5900
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.097: vncconnection.c Trying one socket
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.097: vncconnection.c Socket pending
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.097: vncconnection.c Finally connected
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.097: vncconnection.c Emit main context 13
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.097: vncdisplay.c Grab sequence is now Control_L+Alt_L
(remote-viewer:17243): virt-viewer-DEBUG: 11:11:56.097: notebook show status 0x5635fd17c230
(remote-viewer:17243): virt-viewer-DEBUG: 11:11:56.098: Insert display 0 0x5635fcf06680
(remote-viewer:17243): virt-viewer-DEBUG: 11:11:56.098: notebook show status 0x5635fd17c230
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.098: vncdisplay.c Connected to VNC server
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.098: vncconnection.c Protocol initialization
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:56.098: vncconnection.c Read error Resource temporarily unavailable
(remote-viewer:17243): virt-viewer-DEBUG: 11:11:56.123: Allocated 1024x740
(remote-viewer:17243): virt-viewer-DEBUG: 11:11:56.123: Child allocate 1024x640
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.201: vncconnection.c No server greeting, sending partial client greeting
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.201: vncconnection.c Read error Resource temporarily unavailable
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.201: vncconnection.c Error: Error while parsing server version
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.201: vncconnection.c Emit main context 16
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.201: vncdisplay.c VNC server error
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.201: vncconnection.c Doing final VNC cleanup
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.201: vncconnection.c Close VncConnection=0x5635fd1b50f0
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.202: vncconnection.c Emit main context 15
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.202: vncdisplay.c Disconnected from VNC server
(remote-viewer:17243): virt-viewer-DEBUG: 11:11:58.202: Not removing main window 0 0x5635fcee8d00
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.202: vncdisplay.c Grab sequence is now Control_L+Alt_L
(remote-viewer:17243): virt-viewer-DEBUG: 11:11:58.202: Disconnected
(remote-viewer:17243): virt-viewer-DEBUG: 11:11:58.202: close vnc=0x5635fd1a8230
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.202: vncconnection.c Init VncConnection=0x5635fd238590
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.202: vncdisplaykeymap.c Using X11 backend
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.204: vncdisplaykeymap.c XKB keyboard map name 'evdev+aliases(qwerty)'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.204: vncdisplaykeymap.c Server vendor is 'The X.Org Foundation'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'Generic Event Extension'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'SHAPE'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'MIT-SHM'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'XInputExtension'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'XTEST'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'BIG-REQUESTS'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'SYNC'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'XKEYBOARD'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'XC-MISC'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'SECURITY'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'XFIXES'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'RENDER'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'RANDR'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'XINERAMA'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'Composite'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'DAMAGE'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'MIT-SCREEN-SAVER'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'DOUBLE-BUFFER'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'RECORD'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'DPMS'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'Present'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'DRI3'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'X-Resource'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'XVideo'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'XVideo-MotionCompensation'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'GLX'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'XFree86-VidModeExtension'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'XFree86-DGA'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Found extension 'DRI2'
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplaykeymap.c Using evdev keycode mapping
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplay.c Grab sequence is now Control_L+Alt_L
(remote-viewer:17243): virt-viewer-DEBUG: 11:11:58.206: notebook show status 0x5635fd17c230
(remote-viewer:17243): virt-viewer-DEBUG: 11:11:58.206: Guest (null) display has disconnected, shutting down
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplay.c Display destroy, requesting that VNC connection close
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncdisplay.c Releasing VNC widget
(remote-viewer:17243): gtk-vnc-DEBUG: 11:11:58.206: vncconnection.c Finalize VncConnection=0x5635fd238590


3.If use remote-viewer vnc to connect a guest with port which doesn't exist even for spice,there is error:
eg:
[vnc]
$ remote-viewer vnc://10.xx.xx.xx:5909 
Window pops out,and error shows as:Unable to connect to the graphic server vnc://10.xx.xx.xx:5909
[spice]
$ remote-viewer spice://10.xx.xx.xx:5909 
Window pops out,and error shows as:Unable to connect to the graphic server spice://10.xx.xx.xx:5909

4. Re-run step1 and step2, with a vnc guest, set its port as 5900.

$ virsh dumpxml test
    <graphics type='vnc' port='5900' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>

$ remote-viewer spice://10.xx.xx.xx:5900 
Window pops out,and error shows as:Unable to connect to the graphic server spice://10.xx.xx.xx:5909.

Result:
Remote-viewer works well with spice protocol connection.
For vnc protocol, it reports error when connecting a guest with port which doesn't exist. 
But when use vnc protocol connecting to a port which occupied by a spice guest, the remote-viewer opens with "Waiting for diaplay 1..." and then closes.

Hi toso,
Please help check the current testing result, and it has same behavior on rhel8.
But it doesn't affect our testing much, thanks.

Comment 9 Frediano Ziglio 2020-09-01 13:00:48 UTC
Current behaviour is that connection is closed, debug output is

(remote-viewer:165683): virt-viewer-DEBUG: 13:58:43.794: Opening display to vnc://localhost:5900
(remote-viewer:165683): virt-viewer-DEBUG: 13:58:43.796: Guest (null) has a vnc display
(remote-viewer:165683): virt-viewer-DEBUG: 13:58:43.796: After open connection callback fd=-1
(remote-viewer:165683): virt-viewer-DEBUG: 13:58:43.797: Opening connection to display at vnc://localhost:5900
(remote-viewer:165683): virt-viewer-DEBUG: 13:58:43.797: notebook show status 0x55574a30a2a0
(remote-viewer:165683): virt-viewer-DEBUG: 13:58:43.851: notebook show status 0x55574a30a2a0
(remote-viewer:165683): virt-viewer-DEBUG: 13:58:43.852: Insert display 0 0x55574a3ced30
(remote-viewer:165683): virt-viewer-DEBUG: 13:58:43.852: notebook show status 0x55574a30a2a0
(remote-viewer:165683): virt-viewer-DEBUG: 13:58:43.873: Allocated 1024x743
(remote-viewer:165683): virt-viewer-DEBUG: 13:58:43.873: Child allocate 1024x640
(remote-viewer:165683): virt-viewer-DEBUG: 13:58:46.252: Not removing main window 0 0x55574a0ff0f0
(remote-viewer:165683): virt-viewer-DEBUG: 13:58:46.253: Disconnected
(remote-viewer:165683): virt-viewer-DEBUG: 13:58:46.253: close vnc=0x55574a338220
(remote-viewer:165683): virt-viewer-DEBUG: 13:58:46.253: notebook show status 0x55574a30a2a0
(remote-viewer:165683): virt-viewer-DEBUG: 13:58:46.253: Guest (null) display has disconnected, shutting down