Bug 979245 - Appropriate error message
Appropriate error message
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: libvirt (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Libvirt Maintainers
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-28 00:32 EDT by Amit Saha
Modified: 2015-07-26 18:15 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-28 04:00:39 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Amit Saha 2013-06-28 00:32:05 EDT
Description of problem:

Hello, when I try to dump the network configuration as a non-admin user, 'virsh' gives me an error message as follows:

$ virsh net-dumpxml default
error: failed to get network 'default'
error: Network not found: no network with matching name 'default'


The default network very well exists. But the error message hardly tells me what's wrong - that I don't have the right permissions.

Can something be done about this, please?

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Comment 1 Laine Stump 2013-06-28 03:19:37 EDT
(In reply to Amit Saha from comment #0)
> Description of problem:
> 
> Hello, when I try to dump the network configuration as a non-admin user,
> 'virsh' gives me an error message as follows:
> 
> $ virsh net-dumpxml default
> error: failed to get network 'default'
> error: Network not found: no network with matching name 'default'
> 
> 
> The default network very well exists. But the error message hardly tells me
> what's wrong - that I don't have the right permissions.

That isn't correct. What's wrong is that you are running virsh as a non-root user, and are therefore being connected to an unprivileged instance of libvirtd that allows non-root users to startup guests without having any extra privileges (the facilities available to the guests is limited in some ways, of course).

The libvirtd run as root is often called the "system" libvirtd, and has the url (on the local machine) "qemu:///system". The unprivileged libvirtd is called the "session" libvirtd, and has the url "qemu:///session".

Just as the session/unprivileged libvirtd has its own list of guests that are in a separate namespace from those defined in the system libvirtd, the session libvirtd can also have its own set of networks, in a separate namespace from those defined in the system libvirtd. So, the error message is correct - the session libvirtd that you have connected to doesn't have any network named "default". It's not really reasonable to expect the session libvirtd to know that you thought you were connecting to the system libvirtd.

If you want to run virsh from a non-privileged user and connect to the system libvirtd, try this:

   virsh -c qemu:///system net-dumpxml default
Comment 2 Amit Saha 2013-06-29 08:02:59 EDT
(In reply to Laine Stump from comment #1)
> (In reply to Amit Saha from comment #0)
> > Description of problem:
> > 
> > Hello, when I try to dump the network configuration as a non-admin user,
> > 'virsh' gives me an error message as follows:
> > 
> > $ virsh net-dumpxml default
> > error: failed to get network 'default'
> > error: Network not found: no network with matching name 'default'
> > 
> > 
> > The default network very well exists. But the error message hardly tells me
> > what's wrong - that I don't have the right permissions.
> 
> That isn't correct. What's wrong is that you are running virsh as a non-root
> user, and are therefore being connected to an unprivileged instance of
> libvirtd that allows non-root users to startup guests without having any
> extra privileges (the facilities available to the guests is limited in some
> ways, of course).
> 
> The libvirtd run as root is often called the "system" libvirtd, and has the
> url (on the local machine) "qemu:///system". The unprivileged libvirtd is
> called the "session" libvirtd, and has the url "qemu:///session".
> 
> Just as the session/unprivileged libvirtd has its own list of guests that
> are in a separate namespace from those defined in the system libvirtd, the
> session libvirtd can also have its own set of networks, in a separate
> namespace from those defined in the system libvirtd. So, the error message
> is correct - the session libvirtd that you have connected to doesn't have
> any network named "default". It's not really reasonable to expect the
> session libvirtd to know that you thought you were connecting to the system
> libvirtd.
> 
> If you want to run virsh from a non-privileged user and connect to the
> system libvirtd, try this:
> 
>    virsh -c qemu:///system net-dumpxml default

Oh i see, Thanks for the detailed explanation. Sorry for reporting without investigating more. (What you explained is also here: http://libvirt.org/drvqemu.html#securitydriver).

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