RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1448151 - Remote-viewer needs to report 'vnc-error' signal message upon connect failure
Summary: Remote-viewer needs to report 'vnc-error' signal message upon connect failure
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: virt-viewer
Version: 8.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: 8.2
Assignee: Uri Lublin
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-04 15:57 UTC by Daniel Berrangé
Modified: 2021-05-18 15:53 UTC (History)
19 users (show)

Fixed In Version: virt-viewer-9.0-9.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 921330
Environment:
Last Closed: 2021-05-18 15:53:32 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Debug log for test scenario-1 (10.82 KB, text/plain)
2020-12-11 10:20 UTC, zhoujunqin
no flags Details

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

Comment 15 zhoujunqin 2020-12-11 10:17:07 UTC
I can reproduce this issue with build:
virt-viewer-9.0-4.el8.x86_64

Get same result with Comment 7.


Then try to verify this bug with new build:
virt-viewer-9.0-5.el8.x86_64

Steps:
Environment setup:
Prepare a spice and a vnc guest:

SPICE guest:
$ virsh dumpxml spice
...
    <graphics type='spice' port='5900' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
      <image compression='off'/>
    </graphics>

VNC guest:
# virsh dumpxml vnc
...
    <graphics type='vnc' port='5901' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>


Test scenario-1: Connect to a spice port through  vnc protocol.

$ remote-viewer vnc://10.xx.xx.xx:5900  --debug --gtk-vnc-debug


Result:
The remote-viewer window pops with "Waiting for display 1...",and then remote-viewer closes. An error message prompts:

Unable to connect to the graphics server vnc://xx.xx.xx.xx:5900 

Error while parsing server version

I can click "OK" button to exit.

Test scenario-2: Connect to a nonexistent port through vnc protocol.

[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
Unable to connect to 10.xx.xx.xx:5909: Connection refused

Then I can click "OK" button to exit, more info "Unable to connect to 10.xx.xx.xx:5909: Connection refused
"added, but it's acceptable. 


Test scenario-3: Connect to a nonexistent port through spice protocol.

[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
That's as expected.


Test scenario-4: Connect to a vnc port through spice protocol.

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

Summary:
I get expected result from test scenario-2 to scenario-4.

But I have a question for test scenario-1, when use vnc protocol connecting to a port which is occupied by a spice guest, the remote-viewer launches with "Waiting for display 1..." and then pops up a error message.
Why not prompt error message directly and skip launching remote-viewer window, thanks.
And I think "Error while parsing server version" is not accurate here.

Comment 17 zhoujunqin 2020-12-11 10:20:04 UTC
Created attachment 1738415 [details]
Debug log for test scenario-1

Comment 18 Uri Lublin 2020-12-14 10:42:05 UTC
(In reply to zhoujunqin from comment #15)
> Summary:
> I get expected result from test scenario-2 to scenario-4.
> 
> But I have a question for test scenario-1, when use vnc protocol connecting
> to a port which is occupied by a spice guest, the remote-viewer launches
> with "Waiting for display 1..." and then pops up a error message.

Yes, this bug is about adding that pop-up window with the error message.

> Why not prompt error message directly and skip launching remote-viewer
> window, thanks.

I agree it's a bit inconsistent and I guess some would prefer the first
window not appearing at all, but I think it's not too important.
You can look at it as if this window is letting
the user know it's trying to connect to the VM.

> And I think "Error while parsing server version" is not accurate here.

remote-viewer just shows the error message it got from gtk-vnc.

Comment 19 zhoujunqin 2020-12-15 02:49:47 UTC
Hi Uri,
Thanks for your reply, I agree with your opinion.
So I move this bug from ON_QA to VERIFIED status based on Comment 15 and Comment 18, thanks.

Comment 21 Uri Lublin 2021-01-12 12:22:19 UTC
When qemu-kvm exits, gtk-vnc client signals an error saying "Server closed the connection".
virt-viewer/remote-viewer show the error to the user, as this bug requests.

virt-viewer-9.0-4.el8 did not show any error to the user and simply exited.

The behavior change for this specific error is not good, especially for automatic tests.
When qemu-kvm exits, virt-viewer can ignore this specific error and exit too.
Alternatively gtk-vnc can ignore and not send a signal for it.

Comment 22 Daniel Berrangé 2021-01-12 18:08:10 UTC
(In reply to Uri Lublin from comment #21)
> When qemu-kvm exits, gtk-vnc client signals an error saying "Server closed
> the connection".
> virt-viewer/remote-viewer show the error to the user, as this bug requests.
> 
> virt-viewer-9.0-4.el8 did not show any error to the user and simply exited.

Actually I think what is implemented does not actually match what's requested.

The request is asking for an error message to be displayed when the VNC connection fails the handshake.

What's implemented displays an error message every single time the VNC connection is closed in an unexpected scenario, whether by the client or the server.

I think remote-viewer/virt-viewer needs to be fixed to *only* display the vnc-error signal message, if it has *not* yet received the vnc-initialized signal.

If we have already received vnc-initialized then the session is fully operational, and a vnc-error would reflect the server dropping the connection. Probably. There's no good way to distinguish expected from unexpected termination once the sesson is up & running really.

None the less, we must preserve the long standing behaviour that virt-viewer/remote-viewer exit when the VNC server terminates, provided the session has reached the "initialized" phase.

Comment 23 Guo, Zhiyi 2021-01-19 10:44:53 UTC
(In reply to Uri Lublin from comment #21)
> When qemu-kvm exits, gtk-vnc client signals an error saying "Server closed
> the connection".
> virt-viewer/remote-viewer show the error to the user, as this bug requests.
> 
> virt-viewer-9.0-4.el8 did not show any error to the user and simply exited.
> 
> The behavior change for this specific error is not good, especially for
> automatic tests.
> When qemu-kvm exits, virt-viewer can ignore this specific error and exit too.
> Alternatively gtk-vnc can ignore and not send a signal for it.

Uri, any update for this bug?

Based on Daniel's comment on comment 22, should we reopen this bug?

Zhiyi

Comment 24 Daniel Berrangé 2021-01-19 10:49:43 UTC
There's a fix upstream in https://gitlab.com/virt-viewer/virt-viewer/-/merge_requests/54

Comment 26 zhoujunqin 2021-01-25 02:54:06 UTC
Hi Zhiyi,
Could you help double check with the latest virt-viewew version - virt-viewer-9.0-9.el8.x86_64 in your beaker jobs, thanks.

BR,
juzhou.

Comment 29 zhoujunqin 2021-01-28 05:26:15 UTC
Hi Zhiyi,

Thanks for your confirmation, and I also can't reproduce your Comment 20 issue with the latest package: virt-viewer-9.0-9.el8.x86_64

Steps as below:

Reproduce with virt-viewer-9.0-7.el8.x86_64

1. Use virt-install to install a vm with setting graphics to vnc

# virt-install \
>         --name test \
>         --cpu host-model \
>         --ram=8192 \
>         --vcpus=2,sockets=1,cores=1,threads=2 \
>         --hvm \
>         --noreboot \
>         --os-variant rhel8.3 \
>         --os-type=linux \
>         --location=http://download.eng.pek2.redhat.com/rhel-8/nightly/RHEL-8/RHEL-8.3.1-20210127.n.0/compose/BaseOS/x86_64/os/ \
>         --disk path=/home/test.qcow2,bus=scsi,format='qcow2',cache=none,size=30 \
>         --controller type=scsi,model=virtio-scsi \
>         --graphics vnc,listen=0.0.0.0

Starting install...
Retrieving file vmlinuz...                                                        | 9.1 MB  00:00:00     
Retrieving file initrd.img...                                                     |  70 MB  00:00:00     
Allocating 'test.qcow2'                                                           |  30 GB  00:00:00     
Gtk-Message: 22:02:31.846: Failed to load module "pk-gtk-module"
Gtk-Message: 22:02:31.858: Failed to load module "pk-gtk-module"

(virt-viewer:61760): GLib-GIO-CRITICAL **: 22:02:31.858: g_dbus_proxy_new_sync: assertion 'G_IS_DBUS_CONNECTION (connection)' failed

(virt-viewer:61760): virt-viewer-WARNING **: 22:12:58.791: vnc-session: got vnc error Server closed the connection

Domain creation completed.
You can restart your domain by running:
  virsh --connect qemu:///system start test


Test result:
After VM installation completed then click the reboot button inside vm, virt-viewer will prompt a window show "Unable to connect to the graphic server localhost:5900" and process never terminate without user interaction.

Try to verify with latest version:
virt-viewer-9.0-9.el8.x86_64

# virt-install \
>         --name test \
>         --cpu host-model \
>         --ram=8192 \
>         --vcpus=2,sockets=1,cores=1,threads=2 \
>         --hvm \
>         --noreboot \
>         --os-variant rhel8.3 \
>         --os-type=linux \
>         --location=http://download.eng.pek2.redhat.com/rhel-8/nightly/RHEL-8/RHEL-8.3.1-20210127.n.0/compose/BaseOS/x86_64/os/ \
>         --disk path=/home/test.qcow2,bus=scsi,format='qcow2',cache=none,size=30 \
>         --controller type=scsi,model=virtio-scsi \
>         --graphics vnc,listen=0.0.0.0
Starting install...
Retrieving file vmlinuz...                                                        | 9.1 MB  00:00:00     
Retrieving file initrd.img...                                                     |  70 MB  00:00:00     
Allocating 'test.qcow2'                                                           |  30 GB  00:00:00     
Gtk-Message: 22:21:18.952: Failed to load module "pk-gtk-module"
Gtk-Message: 22:21:19.059: Failed to load module "pk-gtk-module"

(virt-viewer:63107): GLib-GIO-CRITICAL **: 22:21:19.059: g_dbus_proxy_new_sync: assertion 'G_IS_DBUS_CONNECTION (connection)' failed

(virt-viewer:63107): virt-viewer-WARNING **: 22:27:44.586: vnc-session: got vnc error Server closed the connection
Domain creation completed.
You can restart your domain by running:
  virsh --connect qemu:///system start test


Test result:
After VM installation completed then click the reboot button inside vm, virt-viewer will close without a prompt window and process will terminate as well.

So I move this bug from ON_QA to VERIFIED, thanks.

Comment 31 errata-xmlrpc 2021-05-18 15:53:32 UTC
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 (virt-viewer bug fix and enhancement update), 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://access.redhat.com/errata/RHBA-2021:1876


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