New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
systemd disable returns 'Failed to disable unit: Invalid argument' #26568
Comments
Could you run the offending |
In the mean time, interface changed name.
|
This is interesting. After an unsuccessful battle with my old rPi I got my hands on a F36 armv7hl machine, and after rebuilding the Rawhide systemd RPM I can reproduce the issue there as well. Further digging revealed that this reproducible on the latest main, as well as that it seems to be caused by something going wrong during optimization, because: Build with -O0 (
Build with -O1 (
Turns out "parsing" diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
index 9719f97c02..8d982b3fca 100644
--- a/src/libsystemd/sd-bus/bus-message.c
+++ b/src/libsystemd/sd-bus/bus-message.c
@@ -1931,6 +1931,7 @@ _public_ int sd_bus_message_appendv(
uint64_t x;
x = va_arg(ap, uint64_t);
+ printf("%s: Got uint64_t: %llu\n", __func__, x);
r = sd_bus_message_append_basic(m, *t, &x);
break;
}
diff --git a/src/systemctl/systemctl-enable.c b/src/systemctl/systemctl-enable.c
index 4ebe5888ac..55ddf5ab0f 100644
--- a/src/systemctl/systemctl-enable.c
+++ b/src/systemctl/systemctl-enable.c
@@ -211,7 +211,7 @@ int verb_enable(int argc, char *argv[], void *userdata) {
if (send_runtime) {
if (streq(method, "DisableUnitFilesWithFlagsAndInstallInfo"))
- r = sd_bus_message_append(m, "t", arg_runtime ? UNIT_FILE_RUNTIME : 0);
+ r = sd_bus_message_append(m, "t", 0);
else
r = sd_bus_message_append(m, "b", arg_runtime);
if (r < 0)
Casting the argument to diff --git a/src/systemctl/systemctl-enable.c b/src/systemctl/systemctl-enable.c
index 4ebe5888ac..e17ed6239c 100644
--- a/src/systemctl/systemctl-enable.c
+++ b/src/systemctl/systemctl-enable.c
@@ -211,7 +211,7 @@ int verb_enable(int argc, char *argv[], void *userdata) {
if (send_runtime) {
if (streq(method, "DisableUnitFilesWithFlagsAndInstallInfo"))
- r = sd_bus_message_append(m, "t", arg_runtime ? UNIT_FILE_RUNTIME : 0);
+ r = sd_bus_message_append(m, "t", arg_runtime ? (uint64_t)UNIT_FILE_RUNTIME : 0LL);
else
r = sd_bus_message_append(m, "b", arg_runtime);
if (r < 0)
This reminds me of a similar issue we had regarding @poettering is the casting solution enough or there is some other (and more elegant) way to fix this? |
Otherwise under certain conditions `va_arg()` might get garbage instead of the expected value, i.e.: $ sudo build-o0/systemctl disable asdfasfaf sd_bus_message_appendv: Got uint64_t: 0 Failed to disable unit: Unit file asdfasfaf.service does not exist. $ sudo build-o1/systemctl disable asdfasfaf sd_bus_message_appendv: Got uint64_t: 7954875719681572864 Failed to disable unit: Invalid argument Resolves: systemd#26568 Follow-up to: bf1bea4 Related issue: systemd#14470 (comment)
Otherwise under certain conditions `va_arg()` might get garbage instead of the expected value, i.e.: $ sudo build-o0/systemctl disable asdfasfaf sd_bus_message_appendv: Got uint64_t: 0 Failed to disable unit: Unit file asdfasfaf.service does not exist. $ sudo build-o1/systemctl disable asdfasfaf sd_bus_message_appendv: Got uint64_t: 7954875719681572864 Failed to disable unit: Invalid argument (reproduced on an armv7hl machine) Resolves: systemd#26568 Follow-up to: bf1bea4 Related issue: systemd#14470 (comment)
Otherwise under certain conditions `va_arg()` might get garbage instead of the expected value, i.e.: $ sudo build-o0/systemctl disable asdfasfaf sd_bus_message_appendv: Got uint64_t: 0 Failed to disable unit: Unit file asdfasfaf.service does not exist. $ sudo build-o1/systemctl disable asdfasfaf sd_bus_message_appendv: Got uint64_t: 7954875719681572864 Failed to disable unit: Invalid argument (reproduced on an armv7hl machine) Resolves: systemd#26568 Follow-up to: bf1bea4 Related issue: systemd#14470 (comment)
Otherwise under certain conditions `va_arg()` might get garbage instead of the expected value, i.e.: $ sudo build-o0/systemctl disable asdfasfaf sd_bus_message_appendv: Got uint64_t: 0 Failed to disable unit: Unit file asdfasfaf.service does not exist. $ sudo build-o1/systemctl disable asdfasfaf sd_bus_message_appendv: Got uint64_t: 7954875719681572864 Failed to disable unit: Invalid argument (reproduced on an armv7hl machine) Resolves: #26568 Follow-up to: bf1bea4 Related issue: #14470 (comment)
Yeah i got same isue here trying to disable systemd-networkd.service. Using Arch Linux - ARM on a RPI3B. |
me too, also archlinuxarm, just updated to linux-armv7-6.2.8-1-armv7h |
Yeah, see my versions:
And the issue happens in any system unit:
I think the fix will need a time to arrive in Archlinux ARM mainstream repository... |
Otherwise under certain conditions `va_arg()` might get garbage instead of the expected value, i.e.: $ sudo build-o0/systemctl disable asdfasfaf sd_bus_message_appendv: Got uint64_t: 0 Failed to disable unit: Unit file asdfasfaf.service does not exist. $ sudo build-o1/systemctl disable asdfasfaf sd_bus_message_appendv: Got uint64_t: 7954875719681572864 Failed to disable unit: Invalid argument (reproduced on an armv7hl machine) Resolves: systemd#26568 Follow-up to: bf1bea4 Related issue: systemd#14470 (comment) (cherry picked from commit c63bfd0)
systemd version the issue has been seen with
253
Used distribution
ARchlinux ARM
Linux kernel version used
6.1.12-1-rpi-ARCH
CPU architectures issue was seen on
arm
Component
systemctl
Expected behaviour you didn't see
After running
systemctl enable wpa_supplicant@wlu1u2
, I would have expect the command to return successfully and that it removed the symlinkwpa_supplicant@wlu1u2.service
in/etc/systemd/system/multi-user.target.wants/
But the command returns an error without removing the symlink
Unexpected behaviour you saw
The command returns 'Failed to disable unit: Invalid argument' and did not remove the symlink
Steps to reproduce the problem
Additional program output to the terminal or log subsystem illustrating the issue
No response
This is on a rpi2b running archlinuxARM for armv7
The text was updated successfully, but these errors were encountered: