Bug 1122537 - build: Warn that manual intervention is required for gsettings schema install
Summary: build: Warn that manual intervention is required for gsettings schema install
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: virt-manager
Version: unspecified
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Cole Robinson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-23 12:58 UTC by jean-christophe manciot
Modified: 2015-04-06 20:04 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-04-06 20:04:50 UTC
Embargoed:


Attachments (Terms of Use)

Description jean-christophe manciot 2014-07-23 12:58:12 UTC
Description of problem:
----------------------
virt-manager --debug
[Wed, 23 Jul 2014 14:22:09 virt-manager 7049] DEBUG (cli:187) Launched with command line: /usr/local/share/virt-manager/virt-manager --debug
[Wed, 23 Jul 2014 14:22:09 virt-manager 7049] DEBUG (virt-manager:150) virt-manager version: 1.0.1
[Wed, 23 Jul 2014 14:22:09 virt-manager 7049] DEBUG (virt-manager:151) virtManager import: <module 'virtManager' from '/usr/local/share/virt-manager/virtManager/__init__.pyc'>
[Wed, 23 Jul 2014 14:22:09 virt-manager 7049] DEBUG (virt-manager:209) GTK version: 3.10.8

(virt-manager:7049): GLib-GIO-ERROR **: Settings schema 'org.virt-manager.virt-manager' is not installed

Version-Release number of selected component (if applicable):
-------------------------------------------------------------
Ubuntu 14.04 Desktop - Virt-manager 1.0.1 sources

How reproducible:
----------------
Every Launch

Steps to Reproduce:
------------------
1. Download virt-manager-1.0.1.tar.gz
2. tar -xvf virt-manager-1.0.1.tar.gz
3. Install all dependencies with synaptic:
- gir1.2-libvirt-glib-1.0
- gir1.2-gtk-vnc-2.0
- libgtk-vnc-2.0.0
- python-libvert
- python-urlgrabber
- python-libxml2
- python-ipaddr
4. Compile libosinfo 0.2.10 with the following dependencies:
+ libsoup2.4-dev
+ libsoup-gnome2.4-dev
+ libxslt1-dev
+ check
5. Install virt-manager:
python setup.py install
6. Modify all virt-* scripts inside /usr/local/bin with correct path, such as:
exec "/usr/share/virt-manager/virt-manager" "$@" 
--> exec "/usr/local/share/virt-manager/virt-manager" "$@"
7. Launch virt-manager

Actual results:
--------------
cf. "Description of problem"

Expected results:

Additional info:

Comment 1 jean-christophe manciot 2014-07-24 07:04:38 UTC
It seems to be a Path issue: I have found "org.virt-manager.virt-manager.gschema.xml" inside /usr/local/share/glib-2.0/schemas"; 
I suppose they are searched inside "/usr/share/glib-2.0/schemas". 
There must a link with the bug in 6. in previous comment.

Same bug here:
https://www.redhat.com/archives/virt-tools-list/2013-July/msg00056.html

Comment 2 Cole Robinson 2014-07-25 18:56:21 UTC
Yes, as mentioned in my mail in that thread, there's two issues:

- python setup.py install isn't running glib-compile-schemas where it is
dumping our schema.
- gsettings likely doesn't know to look in /usr/local/share for schemas.

I don't want to go down the route of making this automatically work, since virt-manager would have to mess with GSETTINGS_SCHEMA_DIR. However we can at least make the build system warn about what manual steps are likely required.

Comment 3 jean-christophe manciot 2014-07-26 00:38:11 UTC
Could you elaborate on the manual intervention required for gsettings?

Comment 4 jean-christophe manciot 2014-07-26 13:05:10 UTC
As I said before, I thing there's an issue with the global path setting somewhere: /usr/share is used instead of /usr/local/share. Here's why:

I've compiled the schemas with: 
root@VBox-Ubuntu-14:/usr/local/share/glib-2.0/schemas# glib-compile-schemas /usr/local/share/glib-2.0/schemas

The "gschemas.compiled" has been coorectly created in the same directory. Please note that this file looks identical to the "virt-manager-1.0.1/data/gschemas.compiled"
Then:

virt-manager-1.0.1/# export GSETTINGS_SCHEMA_DIR=/usr/local/share/glib-2.0/schemas

Then:
 
virt-manager-1.0.1/# virt-manager --debug[sam., 26 juil. 2014 14:53:41 virt-manager 17818] DEBUG (cli:187) Launched with command line: /usr/local/share/virt-manager/virt-manager --debug
[sam., 26 juil. 2014 14:53:41 virt-manager 17818] DEBUG (virt-manager:150) virt-manager version: 1.0.1
[sam., 26 juil. 2014 14:53:41 virt-manager 17818] DEBUG (virt-manager:151) virtManager import: <module 'virtManager' from '/usr/local/share/virt-manager/virtManager/__init__.pyc'>
[sam., 26 juil. 2014 14:53:41 virt-manager 17818] DEBUG (virt-manager:209) GTK version: 3.10.8
[sam., 26 juil. 2014 14:53:41 virt-manager 17818] DEBUG (engine:484) libguestfs inspection support: False
[sam., 26 juil. 2014 14:53:41 virt-manager 17818] DEBUG (systray:152) Showing systray: False
[sam., 26 juil. 2014 14:53:41 virt-manager 17818] DEBUG (cli:182) Uncaught exception:
Traceback (most recent call last):
  File "/usr/local/share/virt-manager/virtManager/engine.py", line 132, in _activate
    self.show_manager()
  File "/usr/local/share/virt-manager/virtManager/engine.py", line 924, in show_manager
    self._do_show_manager(None)
  File "/usr/local/share/virt-manager/virtManager/engine.py", line 868, in _do_show_manager
    manager = self.get_manager()
  File "/usr/local/share/virt-manager/virtManager/engine.py", line 829, in get_manager
    obj = vmmManager()
  File "/usr/local/share/virt-manager/virtManager/manager.py", line 117, in __init__
    vmmGObjectUI.__init__(self, "manager.ui", "vmm-manager")
  File "/usr/local/share/virt-manager/virtManager/baseclass.py", line 203, in __init__
    self.builder.add_from_string(file(uifile).read())
IOError: [Errno 2] No such file or directory: '/usr/share/virt-manager/ui/manager.ui'

Traceback (most recent call last):
  File "/usr/local/share/virt-manager/virtManager/engine.py", line 132, in _activate
    self.show_manager()
  File "/usr/local/share/virt-manager/virtManager/engine.py", line 924, in show_manager
    self._do_show_manager(None)
  File "/usr/local/share/virt-manager/virtManager/engine.py", line 868, in _do_show_manager
    manager = self.get_manager()
  File "/usr/local/share/virt-manager/virtManager/engine.py", line 829, in get_manager
    obj = vmmManager()
  File "/usr/local/share/virt-manager/virtManager/manager.py", line 117, in __init__
    vmmGObjectUI.__init__(self, "manager.ui", "vmm-manager")
  File "/usr/local/share/virt-manager/virtManager/baseclass.py", line 203, in __init__
    self.builder.add_from_string(file(uifile).read())
IOError: [Errno 2] No such file or directory: '/usr/share/virt-manager/ui/manager.ui'


Have you noticed the "No such file or directory: '/usr/share/virt-manager/ui/manager.ui'" errors? 
This file exists in the folder... /usr/local/share/virt-manager/ui/

Comment 5 Cole Robinson 2014-07-27 17:13:23 UTC
The manual intervention I meant was glib-schemas-compile and usage of GSETTINGS_SCHEMA_DIR to point to /usr/local

The UI path issue I haven't seen specifically, perhaps we are hardcoding /usr/share somewhere, instead of using whatever the configured prefix is.

Comment 6 Daniel Berrangé 2014-07-28 08:43:19 UTC
FWIW, I think it would be worth setting GSETTINGS_SCHEMA_DIR automatically in virt-manager. I had this same problem with Entangle and even though I clearly tell people what to do in summary printed by configure, there was still a never ending stream of bug reports. The code to set it isn't that difficult


https://gitorious.org/entangle/entangle/source/939ff0f16ee568287221da47376a679f147cb8cc:src/backend/entangle-preferences.c#L793

Comment 7 jean-christophe manciot 2014-07-28 09:43:40 UTC
@ Daniel Berrange: I have already tried to set GSETTINGS_SCHEMA_DIR. Other symptoms have been exposed afterwards which seem to indicate that there's a core issue with some basic path somewhere. 

It seems that some parts of the code use /usr/share while some other parts use /usr/local/share.

For example, when we install virt-manager with "python setup.py install",
- virt-manager tree is installed under /usr/local/share
- but all virt-* scripts inside /usr/local/bin point to usr/share/virt-manager/
- and /usr/share/glib-2.0/schemas/gschemas.compiled has been modified: maybe virt-manager-1.0.1/data/gschemas.compiled has been merged into it
- and there are attempts to read /usr/share/virt-manager/ui/manager.ui instead of /usr/local/share/virt-manager/ui/manager.ui

Comment 8 Cole Robinson 2015-04-06 20:04:50 UTC
I added a warning pointing at GSETTINGS_SCHEMA_DIR to setup.py install if not installing into /usr/share


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