Bug 1623947

Summary: Cannot transfer file to guest VM with logged-in user, which have never been logged out
Product: Red Hat Enterprise Linux 7 Reporter: Radek Duda <rduda>
Component: spice-vdagentAssignee: Victor Toso <victortoso>
Status: CLOSED ERRATA QA Contact: SPICE QE bug list <spice-qe-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.6CC: mtessun, rduda, spice-qe-bugs, victortoso
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spice-vdagent-0.14.0-16.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 10:51:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
spice-debug-log-snippet
none
spice-vdagent-log none

Description Radek Duda 2018-08-30 14:09:15 UTC
Created attachment 1479820 [details]
spice-debug-log-snippet

Description of problem:
client+host(rhel7.6):

Version-Release number of selected component (if applicable):

qemu-kvm-rhev-2.9.0-16.el7_4.16.x86_64
spice-server-0.14.0-6.el7.x86_64
spice-gtk3-0.35-2.el7.x86_64
spice-glib-0.35-2.el7.x86_64
virt-viewer-5.0-11.el7.x86_64

guest(rhel7.6):
spice-vdagent-0.14.0-15.el7.x86_64
kernel-3.10.0-940.el7.x86_64
gdm-3.28.2-7.el7.x86_64
dbus-1.10.24-12.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. Create new VM, add user and log-in. Do not log-out this user.
2. Transfer some file from client to guest VM (drag'n'drop)


Actual results:
File is not transferred. Message 'An error caused the following file transfers to fail: $filename' appears.

Expected results:
File is transferred from client to guest

Additional info:
Files could be transferred if user is at least once logged-out (by restarting Vm, shutting it down, or simply user log-out) and then logged-in. If Vm is shutdown forcibly, and then (after VM boots up) is user logged-in, file transfer will not work.

Comment 2 Radek Duda 2018-08-30 14:13:33 UTC
Created attachment 1479822 [details]
spice-vdagent-log

Comment 4 Victor Toso 2018-08-31 07:02:41 UTC
Hi Radek,

Could you please clarify the step "1. Create new VM, add user and log-in. Do not log-out this user." on what you do exactly?

If I try to switch user in GNOME interface, file transfer works as expected so I'm guessing you are doing something else.

As the regression flag is set, it is also nice to know the prior version that this situation did not happen.

Comment 5 Radek Duda 2018-08-31 09:18:26 UTC
(In reply to Victor Toso from comment #4)
> Hi Radek,
> 
> Could you please clarify the step "1. Create new VM, add user and log-in. Do
> not log-out this user." on what you do exactly?
> 
see Additional info of #c0 - I think it is quite explanatory :
'Files could be transferred if user is at least once logged-out (by restarting Vm, shutting it down, or simply user log-out) and then logged-in. '

"Do not log out this user" - I mean user account should not go through log-out procedure - ever (to reproduce this bug).

Now I found that if I restart /usr/bin/spice-vdagent (instead of log-out + log-in), I cannot reproduce this.

> If I try to switch user in GNOME interface, file transfer works as expected
> so I'm guessing you are doing something else.
> 
> As the regression flag is set, it is also nice to know the prior version
> that this situation did not happen.

I cannot reproduce this on rhel7.5 guest (kernel-3.10.0-862.el7, gdm-3.26.2.1-5.el7, dbus-1.10.24-7.el7). There is the same version of spice-vdagent (spice-vdagent-0.14.0-15.el7), so maybe the bug is elsewhere.

Comment 6 Victor Toso 2018-08-31 09:44:09 UTC
Trying to reproduce. Talked with Radek, it is a bit tricky to get spice-vdagent logs as that would always imply rebooting or restarting the agent and bug would not be reproducible anymore.

Downloading image where this happens.

Situation that this issue happens seems very limited and easy workaround, removing the blocker flag.

Comment 8 Victor Toso 2018-08-31 14:38:37 UTC
> journalctl -r -t spice-vdagent
> spice-vdagent[4058]: warning could not get file xfer save dir, file transfers will be disabled

So the file transfer was disabled in the agent because it could set a target directory for file transfers to be stored.

That's happening because g_get_user_special_dir () is returning NULL for either G_USER_DIRECTORY_DESKTOP or G_USER_DIRECTORY_DOWNLOAD.

That seems to be happening due a race between spice-vdagent and xdg-user-dirs as both can be started in parallel due .desktop settings being X-GNOME-Autostart-Phase=Initialization

Many thanks to Ray Strode on clarifying this :)

Comment 10 Victor Toso 2018-09-04 09:02:03 UTC
Patch posted [0], note that this is a regression introduced by rhbz#1412762, it seems (7.5)

[0] https://lists.freedesktop.org/archives/spice-devel/2018-September/045511.html
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1412762

Comment 14 errata-xmlrpc 2018-10-30 10:51:49 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, 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-2018:3175