Bug 856975 - Obscure systemctl error: failed to issue method call: Invalid argument
Obscure systemctl error: failed to issue method call: Invalid argument
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Václav Pavlín
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-13 05:22 EDT by Richard W.M. Jones
Modified: 2012-10-12 12:47 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-10-07 18:42:18 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)
Appends .service when enable/disable... called (2.20 KB, patch)
2012-09-13 10:07 EDT, Václav Pavlín
no flags Details | Diff
Appends .service when enable/disable... called (1.88 KB, patch)
2012-09-13 13:46 EDT, Václav Pavlín
no flags Details | Diff
Appends .service when enable/disable... called (2.30 KB, patch)
2012-09-13 16:03 EDT, Václav Pavlín
no flags Details | Diff

  None (edit)
Description Richard W.M. Jones 2012-09-13 05:22:15 EDT
Description of problem:

If you try to enable/disable a service, but you forget to
put ".service" at the end, you get a very obscure error
which doesn't explain what's going on at all:

$ sudo systemctl disable libvirtd
Failed to issue method call: Invalid argument

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

systemd-188-3.fc18.x86_64

How reproducible:

100%

Steps to Reproduce:
1. See command above.

Expected results:

It should explain that the service "libvirtd" is not known.
For extra points it could suggest adding .service to the end
of the name (or .socket etc).
Comment 1 Václav Pavlín 2012-09-13 10:07:03 EDT
Created attachment 612463 [details]
Appends .service when enable/disable... called

Same thing works for start/stop/... - if you call 'start libvirtd', systemctl will append .service to it. This patch provides the same behaviour for enable/disable/...
Comment 2 Richard W.M. Jones 2012-09-13 10:12:56 EDT
One hunk in that patch adds a blank line, with no
functional change.

The approach seems OK - making it work more like
start/stop.
Comment 3 Václav Pavlín 2012-09-13 13:46:19 EDT
Created attachment 612531 [details]
Appends .service when enable/disable... called

Sorry, I missed that hunk completely. Should by ok now
Comment 4 Lennart Poettering 2012-09-13 14:42:59 EDT
I'd prefer if we'd move that loop into its own function. Also, use strv_free() to free the array afterwards. And you need to check for OOM (this is run from PID 1!). Otherwise looks good.
Comment 5 Václav Pavlín 2012-09-13 16:03:26 EDT
Created attachment 612613 [details]
Appends .service when enable/disable... called

Lennart, thanks for your comment. Changed with respect to it.
Comment 6 Lennart Poettering 2012-09-13 16:42:46 EDT
Applied with minor coding style fixes.
Comment 7 Fedora Update System 2012-09-20 15:54:09 EDT
systemd-190-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/systemd-190-1.fc18
Comment 8 Fedora Update System 2012-09-22 02:35:21 EDT
Package systemd-191-2.fc18, rtkit-0.11-3.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-191-2.fc18 rtkit-0.11-3.fc18'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-14581/rtkit-0.11-3.fc18,systemd-191-2.fc18
then log in and leave karma (feedback).
Comment 9 Steve Grubb 2012-09-24 11:33:18 EDT
This didn't fix the problem, I see this:
#systemctl disable atd.service
Failed to issue method call: Argument 0 is specified to be of type "string", but is really type "array".
Comment 10 Lennart Poettering 2012-09-24 19:42:08 EDT
Steve, that's an unrelated bug, in the SELinux code:

https://bugzilla.redhat.com/show_bug.cgi?id=859614
Comment 11 Fedora Update System 2012-09-27 20:15:47 EDT
Package glibc-2.16-17.fc18, systemd-192-1.fc18, selinux-policy-3.11.1-23.fc18, rtkit-0.11-3.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing glibc-2.16-17.fc18 systemd-192-1.fc18 selinux-policy-3.11.1-23.fc18 rtkit-0.11-3.fc18'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-14581/selinux-policy-3.11.1-23.fc18,rtkit-0.11-3.fc18,systemd-192-1.fc18,glibc-2.16-17.fc18
then log in and leave karma (feedback).
Comment 12 Fedora Update System 2012-10-01 16:07:17 EDT
Package glibc-2.16-17.fc18, rtkit-0.11-3.fc18, systemd-193-1.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing glibc-2.16-17.fc18 rtkit-0.11-3.fc18 systemd-193-1.fc18'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-14581/rtkit-0.11-3.fc18,systemd-193-1.fc18,glibc-2.16-17.fc18
then log in and leave karma (feedback).
Comment 13 Judy Wathen 2012-10-03 14:23:16 EDT
It looks like the same error message is issued for "sytemctl is-enabled foo" (as opposed to "systemctl is-enabled foo.service".
In additon the error message occors for many instances of 
"chroot /chroot_mnt systemctl enable foo"
"chroot /chroot_mnt systemctl disble foo", etc.

I have a fix for these cases.  Can I submit it to this bugzilla, or do I need to raise a new one?
Thanks,
Judy
Comment 14 Lennart Poettering 2012-10-07 18:42:18 EDT
Judy, please file a new bug for this!
Comment 15 Fedora Update System 2012-10-12 12:47:05 EDT
systemd-44-20.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/systemd-44-20.fc17

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