Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.

Bug 1016435

Summary: virt-manager fails to start with OSError: [Errno 2] No such file or directory: '/root/.cache/virt-manager'
Product: [Fedora] Fedora Reporter: Alexander Todorov <atodorov>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: 20CC: berrange, crobinso, dallan, gscrivan, ilya.gradina, mcermak, raistlin, virt-maint
Target Milestone: ---Keywords: Regression, Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: virt-manager-0.10.0-5.git1ffcc0cc.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-16 02:14:11 EST Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Alexander Todorov 2013-10-08 03:47:09 EDT
Description of problem:

virt-manager fails to start over VNC when started from the console.

[root@ibm-ls22-01 ~]# virt-manager
Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-manager", line 277, in <module>
    main()
  File "/usr/share/virt-manager/virt-manager", line 177, in main
    virtinstcli.setupLogging("virt-manager", options.debug, False, False)
  File "/usr/share/virt-manager/virtinst/cli.py", line 158, in setupLogging
    os.mkdir(vi_dir, 0751)
OSError: [Errno 2] No such file or directory: '/root/.cache/virt-manager'


Version-Release number of selected component (if applicable):
virt-manager-0.10.0-4.git79196cdf.fc20.noarch

How reproducible:
always

Steps to Reproduce:
1. Xvnc -SecurityTypes None :1 
2. export DISPLAY=:1
3. metacity &
4. virt-manager


Actual results:
Python traceback, fails to start

Expected results:
application starts


Additional info:
This is a regression from previous releases, I use this setup quite a lot and it works just fine.
Comment 1 Alexander Todorov 2013-10-08 03:55:19 EDT
Creating the directory manually works around this issue so far.
Comment 2 Dario Faggioli 2013-10-08 06:21:05 EDT
And I think I'm just ading that I see this when trying to run `virt-install' from console to.

I just ssh-ed to my host and did the following:

# virt-install --paravirt --name f20_64 --ram 2048 --vcpus 4 -f /dev/fedora_odyn/f20_64 --network bridge=virbr0 --location http://dl.fedoraproject.org/pub/alt/stage/20-Beta-TC1/Fedora/x86_64/os/ --graphics none

And that's what I see:

[Errno 2] No such file or directory: '/root/.cache/virt-manager'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-install", line 1073, in <module>
    sys.exit(main())
  File "/usr/share/virt-manager/virt-install", line 1036, in main
    cli.setupLogging("virt-install", options.debug, options.quiet)
  File "/usr/share/virt-manager/virtinst/cli.py", line 158, in setupLogging
    os.mkdir(vi_dir, 0751)
OSError: [Errno 2] No such file or directory: '/root/.cache/virt-manager'
Comment 3 Dario Faggioli 2013-10-08 06:21:52 EDT
Oh, and I also confirm that `mkdir -p /root/.cache/virt-manager' does the trick here too.
Comment 4 Cole Robinson 2013-10-28 12:20:55 EDT
*** Bug 1023425 has been marked as a duplicate of this bug. ***
Comment 5 Dave Allan 2013-10-29 17:41:42 EDT
Seeing this on rawhide as well, virt-manager-0.10.0-4.git79196cdf.fc21.noarch
Comment 6 Giuseppe Scrivano 2013-10-31 13:47:41 EDT
XDG Base Directory Specification (Version 0.7) clearly states that if $XDG_CACHE_HOME is not defined, then a default equal to $HOME/.cache should be used to store user-specific data files.

I think virt-manager should create that directory if it doesn't already exist, in the same way as "mkdir -p $HOME/.cache/virt-manager" does.
Comment 7 Giuseppe Scrivano 2013-11-05 12:35:26 EST
patch accepted upstream:

commit 5798c5b9b42732caf98876a6a708379190dd9c6b
Author: Giuseppe Scrivano <gscrivan@redhat.com>
Date:   Fri Nov 1 13:26:24 2013 +0100

    virt-manager: prefer os.makedirs to os.mkdir when creating cache dir
    
    Ensure the parent directories exist when attempting to create the
    cache directory.
    
    Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1016435
    
    Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Comment 8 Cole Robinson 2013-11-05 13:18:38 EST
Since this can cause the app to fail to start if running as root, let's keep this open so users can track when a fixed update hits F20
Comment 9 Giuseppe Scrivano 2013-11-07 07:16:26 EST
*** Bug 1027744 has been marked as a duplicate of this bug. ***
Comment 10 Fedora Update System 2013-11-10 12:10:15 EST
virt-manager-0.10.0-5.git1ffcc0cc.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/virt-manager-0.10.0-5.git1ffcc0cc.fc20
Comment 11 Fedora Update System 2013-11-11 19:31:41 EST
Package virt-manager-0.10.0-5.git1ffcc0cc.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing virt-manager-0.10.0-5.git1ffcc0cc.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-21095/virt-manager-0.10.0-5.git1ffcc0cc.fc20
then log in and leave karma (feedback).
Comment 12 Fedora Update System 2013-11-16 02:14:11 EST
virt-manager-0.10.0-5.git1ffcc0cc.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.