Bug 2020415 - Error in /usr/lib/systemd/systemd-update-helper: undefined variable "unit"
Summary: Error in /usr/lib/systemd/systemd-update-helper: undefined variable "unit"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 35
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2020374 2020980 2021771 2022122 (view as bug list)
Depends On: 2023332
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-04 19:27 UTC by Christian Stadelmann
Modified: 2021-11-20 09:33 UTC (History)
31 users (show)

Fixed In Version: systemd-249.6-2.fc35 systemd-249.7-2.fc35
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-18 01:14:01 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github systemd systemd pull 21228 0 None Merged update-helper: add missing loop over user units 2021-11-04 19:27:57 UTC

Description Christian Stadelmann 2021-11-04 19:27:57 UTC
Description of problem:

During dnf update of other packages, I get this error message a lot:
> /usr/lib/systemd/systemd-update-helper: line 54: unit: unbound variable


Version-Release number of selected component (if applicable):
systemd-249.4-2.fc35.x86_64

How reproducible:
Unclear, but happens more than once

Steps to Reproduce:
1. run `dnf upgrade` with some packages to upgrade

Actual results:
I get the error message above.

Expected results:
No error message.

Additional info:
Upstream has already fixed this issue: https://github.com/systemd/systemd/pull/21228

Comment 1 Fedora Update System 2021-11-05 07:00:03 UTC
FEDORA-2021-bfbf6cb70b has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-bfbf6cb70b

Comment 2 Zbigniew Jędrzejewski-Szmek 2021-11-05 08:19:46 UTC
*** Bug 2020374 has been marked as a duplicate of this bug. ***

Comment 3 Fedora Update System 2021-11-06 01:27:26 UTC
FEDORA-2021-bfbf6cb70b has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 4 Maxwell G 2021-11-07 00:32:35 UTC
Hi,

---

The rpm scriptlet now produces a different error:

$ sudo dnf reinstall https://kojipkgs.fedoraproject.org//packages/syncthing/1.18.4/1.fc35/x86_64/syncthing-1.18.4-1.fc35.x86_64.rpm
[...]
  Running scriptlet: syncthing-1.18.4-1.fc35.x86_64                                                              2/2 
Failed to connect to bus: Invalid argument

Failed to connect to bus: Invalid argument
Failed to connect to bus: Invalid argument

Failed to connect to bus: Invalid argument

Failed to connect to bus: Invalid argument
[...]

---

I initially left this comment on the Bodhi page [1], but I am reproducing it here.

[1]: https://bodhi.fedoraproject.org/updates/FEDORA-2021-bfbf6cb70b

Thanks,
Maxwell

Comment 5 Villy Kruse 2021-11-07 07:30:28 UTC
(In reply to Maxwell G from comment #4)
> Hi,
> 
> ---
> 
> The rpm scriptlet now produces a different error:
> 
> $ sudo dnf reinstall
> https://kojipkgs.fedoraproject.org//packages/syncthing/1.18.4/1.fc35/x86_64/
> syncthing-1.18.4-1.fc35.x86_64.rpm
> [...]
>   Running scriptlet: syncthing-1.18.4-1.fc35.x86_64                         
> 2/2 
> Failed to connect to bus: Invalid argument
> 
> Failed to connect to bus: Invalid argument
> Failed to connect to bus: Invalid argument
> 
> Failed to connect to bus: Invalid argument
> 
> Failed to connect to bus: Invalid argument
> [...]
> 
> ---
> 
> I initially left this comment on the Bodhi page [1], but I am reproducing it
> here.
> 
> [1]: https://bodhi.fedoraproject.org/updates/FEDORA-2021-bfbf6cb70b
> 
> Thanks,
> Maxwell

The -M option for systemctl wants a user name instead of numeric user id.

[root@mybox ~]# sh -x /usr/lib/systemd/systemd-update-helper user-restart
+ set -eu
+ set -o pipefail
+ command=user-restart
+ shift
+ command -v systemctl
+ case "$command" in
+ '[' -n '' ']'
+ '[' -d /run/systemd/system ']'
++ systemctl list-units 'user@*' --legend=no
++ sed -n -r 's/.*user@([0-9]+).service.*/\1/p'
+ users=1000
+ [[ user-restart =~ reexec ]]
+ [[ user-restart =~ reload ]]
+ [[ user-restart =~ restart ]]
+ for user in $users
+ wait
+ SYSTEMD_BUS_TIMEOUT=15s
+ systemctl --user -M 1000@ reload-or-restart --marked
Failed to connect to bus: Invalid argument
[root@mybox ~]#

Comment 6 Fabio Valentini 2021-11-07 10:58:48 UTC
Can confirm, the "fixed" version is still broken.

Comment 7 Zbigniew Jędrzejewski-Szmek 2021-11-08 08:30:42 UTC
I let the update go in because it has other fixes, and doesn't make this bug any worse. I'll fix it separately.

Comment 8 Zbigniew Jędrzejewski-Szmek 2021-11-08 09:27:39 UTC
Argh, one patch was not backported.

Comment 9 Zbigniew Jędrzejewski-Szmek 2021-11-08 09:30:09 UTC
*** Bug 2020980 has been marked as a duplicate of this bug. ***

Comment 10 Michael 2021-11-10 20:53:28 UTC
Possible duplicate: https://bugzilla.redhat.com/show_bug.cgi?id=2021771

Comment 11 Maxwell G 2021-11-11 22:13:52 UTC
*** Bug 2021771 has been marked as a duplicate of this bug. ***

Comment 12 Tomas Smetana 2021-11-12 09:57:45 UTC
*** Bug 2022122 has been marked as a duplicate of this bug. ***

Comment 13 Fedora Update System 2021-11-14 16:11:44 UTC
FEDORA-2021-a77b44ab13 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-a77b44ab13

Comment 14 daniil velvet 2021-11-14 16:16:15 UTC
I also have this error. Is it dangerous?

Comment 15 Zbigniew Jędrzejewski-Szmek 2021-11-14 16:18:57 UTC
(In reply to daniil velvet from comment #14)
> I also have this error. Is it dangerous?

It means that some user services that were supposed to be restarted after a package upgrade were not.
It's generally not a big issue, unless you need the restart to fix some bug. You can always log out
and back in, it should be enough to restart those services.

Comment 16 e-blokos 2021-11-15 12:31:48 UTC
same problem here on all our 4 nodes...
we noticed also some compilation failing with

/usr/bin/ld: ./.libs/libfreeswitch.so: undefined reference to `pthread_mutexattr_setrobust_np

Comment 17 Fedora Update System 2021-11-15 13:45:18 UTC
FEDORA-2021-a77b44ab13 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-a77b44ab13

Comment 18 Fedora Update System 2021-11-16 15:51:35 UTC
FEDORA-2021-a77b44ab13 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-a77b44ab13`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-a77b44ab13

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 19 Fedora Update System 2021-11-18 01:14:01 UTC
FEDORA-2021-a77b44ab13 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.


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