Subject: fwupd: fwupd-refresh.service failed to start Refresh fwupd metadata and update motd.

From: Jean-Marc <[email-masked]>
Date: Wed, 23 Oct 2019 18:36:32 +0200

Package: fwupd
Version: 1.3.2-2
Severity: normal

Dear Maintainer,

On my PC, fwupd-refresh.service failed to start.

$ systemctl status fwupd-refresh.service
● fwupd-refresh.service - Refresh fwupd metadata and update motd
   Loaded: loaded (/lib/systemd/system/fwupd-refresh.service; static; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2019-10-23 16:06:35 CEST; 2h 13min ago
     Docs: man:fwupdmgr(1)
  Process: 4608 ExecStart=/usr/bin/fwupdmgr refresh (code=exited, status=0/SUCCESS)
  Process: 4624 ExecStart=/usr/bin/fwupdmgr get-updates --log 85-fwupd (code=exited, status=1/FAILURE)
 Main PID: 4624 (code=exited, status=1/FAILURE)

oct 23 16:06:35 svrname systemd[1]: Starting Refresh fwupd metadata and update motd...
oct 23 16:06:35 svrname fwupdmgr[4608]: Fetching metadata https://cdn.fwupd.org/downloads/firmware.xml.gz
oct 23 16:06:35 svrname fwupdmgr[4608]: Fetching signature https://cdn.fwupd.org/downloads/firmware.xml.gz.asc
oct 23 16:06:35 svrname systemd[1]: fwupd-refresh.service: Main process exited, code=exited, status=1/FAILURE
oct 23 16:06:35 svrname systemd[1]: fwupd-refresh.service: Failed with result 'exit-code'.
oct 23 16:06:35 svrname systemd[1]: Failed to start Refresh fwupd metadata and update motd.

That's the service definition:
$ systemctl cat fwupd-refresh.service
# /lib/systemd/system/fwupd-refresh.service
[Unit]
Description=Refresh fwupd metadata and update motd
Documentation=man:fwupdmgr(1)
After=network.target network-online.target systemd-networkd.service NetworkManager.service connman.service

[Service]
Type=oneshot
RuntimeDirectory=motd.d
CacheDirectory=fwupdmgr
RuntimeDirectoryPreserve=yes
StandardError=null
ExecStart=/usr/bin/fwupdmgr refresh
ExecStart=/usr/bin/fwupdmgr get-updates --log 85-fwupd
DynamicUser=yes
RestrictAddressFamilies=AF_NETLINK AF_UNIX AF_INET AF_INET6
SystemCallFilter=~@mount
ProtectKernelModules=yes
ProtectControlGroups=yes
RestrictRealtime=yes

And about the runtime directory:
$ ls -ld /run/motd.d
lrwxrwxrwx 1 root root 14 oct 23 16:06 /run/motd.d -> private/motd.d
$ ls -ld /run/private/
drwx------ 3 root root 60 oct 23 16:06 /run/private/
$ sudo ls -ld /run/private/motd.d
drwxr-xr-x 2 62803 62803 40 oct 23 16:06 /run/private/motd.d
$ sudo ls -l /run/private/motd.d
total 0

Kind Regards,

Jean-Marc

-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (500, 'testing'), (100, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.2.0-3-amd64 (SMP w/8 CPU cores)
Locale: LANG=fr_BE.UTF-8, LC_CTYPE=fr_BE.UTF-8 (charmap=UTF-8), LANGUAGE=fr_BE:fr (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages fwupd depends on:
ii  libarchive13           3.4.0-1
ii  libc6                  2.29-2
ii  libefiboot1            37-2
ii  libefivar1             37-2
ii  libelf1                0.176-1.1
ii  libfwupd2              1.3.2-2
ii  libgcab-1.0-0          1.3-1
ii  libglib2.0-0           2.62.1-1
ii  libgnutls30            3.6.9-5
ii  libgpg-error0          1.36-7
ii  libgpgme11             1.13.1-1
ii  libgudev-1.0-0         233-1
ii  libgusb2               0.3.0-1
ii  libjson-glib-1.0-0     1.4.4-2
ii  libpolkit-gobject-1-0  0.105-26
ii  libsmbios-c2           2.4.1-1
ii  libsoup2.4-1           2.68.2-1
ii  libsqlite3-0           3.30.1-1
ii  libtss2-esys0          2.1.0-4+b1
ii  libxmlb1               0.1.13-1
ii  shared-mime-info       1.10-1

Versions of packages fwupd recommends:
ii  bolt                               0.8-4
ii  fwupd-amd64-signed [fwupd-signed]  1.3.2+2
ii  python3                            3.7.5-1

fwupd suggests no packages.

-- no debconf information

---

From: <[email-masked]>
Date: Wed, 23 Oct 2019 16:40:37 +0000

Internal Use - Confidential

In 1.3.2-5 the service is disabled by default (and also this issue should be fixed).

> -----Original Message-----
> From: Jean-Marc <[email-masked]>
> Sent: Wednesday, October 23, 2019 11:37 AM
> To: Debian Bug Tracking System
> Subject: Bug#943343: fwupd: fwupd-refresh.service failed to start Refresh
> fwupd metadata and update motd.
> 
> 
> [EXTERNAL EMAIL]
> 
> Package: fwupd
> Version: 1.3.2-2
> Severity: normal
> 
> Dear Maintainer,
> 
> $ systemctl status fwupd-refresh.service ● fwupd-refresh.service - Refresh
> fwupd metadata and update motd
>   Process: 4624 ExecStart=/usr/bin/fwupdmgr get-updates --log 85-fwupd
> (code=exited, status=1/FAILURE)  Main PID: 4624 (code=exited,
> status=1/FAILURE)
> 
> oct 23 16:06:35 svrname fwupdmgr[4608]: Fetching metadata
> https://cdn.fwupd.org/downloads/firmware.xml.gz
> oct 23 16:06:35 svrname fwupdmgr[4608]: Fetching signature
> https://cdn.fwupd.org/downloads/firmware.xml.gz.asc
> oct 23 16:06:35 svrname systemd[1]: fwupd-refresh.service: Main process
> exited, code=exited, status=1/FAILURE oct 23 16:06:35 svrname systemd[1]:
> fwupd-refresh.service: Failed with result 'exit-code'.
> ExecStart=/usr/bin/fwupdmgr get-updates --log 85-fwupd DynamicUser=yes
> SystemCallFilter=~@mount ProtectKernelModules=yes
> ProtectControlGroups=yes RestrictRealtime=yes
> 
> lrwxrwxrwx 1 root root 14 oct 23 16:06 /run/motd.d -> private/motd.d $ ls -ld
> /run/private/
> drwx------ 3 root root 60 oct 23 16:06 /run/private/ $ sudo ls -ld
> /run/private/motd.d drwxr-xr-x 2 62803 62803 40 oct 23 16:06
> /run/private/motd.d $ sudo ls -l /run/private/motd.d total 0
> 
> 
> Kind Regards,
> 
> Jean-Marc
> 
> 
> -- System Information:

---

From: Jean-Marc <[email-masked]>
Date: Wed, 23 Oct 2019 21:34:01 +0200

Wed, 23 Oct 2019 16:40:37 +0000
<[email-masked]> wrote :

Hi Mario,

> In 1.3.2-5 the service is disabled by default (and also this issue should be fixed).

Okay.  So, the bug can be closed, I guess.

Jean-Marc <[email-masked]>
https://6jf.be/keys/ED863AD1.txt

---

From: Werner Mahr <[email-masked]>
Date: Tue, 03 Dec 2019 13:52:22 +0100

> Okay.  So, the bug can be closed, I guess.

I'm sorry, but it seems that it at least was reintroduced somewhen. I have 
1.3.4-1 installed on testing and it fails to start. Unfortunately is is not 
that verbose on the logs.

$ service fwupd-refresh status
● fwupd-refresh.service - Refresh fwupd metadata and update motd
Loaded: loaded (/lib/systemd/system/fwupd-refresh.service; static; vendor 
preset: disabled)
Active: failed (Result: exit-code) since Mon 2019-12-02 09:16:34 CET; 2h 8min 
ago
Docs: man:fwupdmgr(1)
Process: 144751 ExecStart=/usr/bin/fwupdmgr refresh --no-metadata-check 
(code=exited, status=1/FAILURE)
Main PID: 144751 (code=exited, status=1/FAILURE)
Dez 02 09:16:34 werner1 systemd[1]: Starting Refresh fwupd metadata and update 
motd...
Dez 02 09:16:34 werner1 systemd[1]: fwupd-refresh.service: Main process 
exited, code=exited, status=1/FAILURE
Dez 02 09:16:34 werner1 systemd[1]: fwupd-refresh.service: Failed with result 
'exit-code'.
Dez 02 09:16:34 werner1 systemd[1]: Failed to start Refresh fwupd metadata and 
update motd.

Called from cmdline directly it still works.

-- 
MfG usw.

Werner Mahr

---

From: <[email-masked]>
Date: Tue, 3 Dec 2019 15:16:59 +0000

> From: Werner Mahr <[email-masked]>
> Sent: Tuesday, December 3, 2019 6:52 AM
> To: [email-masked]
> Subject: Bug#943343: fwupd: fwupd-refresh.service failed to start Refresh fwupd
> metadata and update motd.
> 
> 
> [EXTERNAL EMAIL]
> 

What version of systemd are you running on your local system?  Did you bring that back
from unstable as well?

---

From: Diederik de Haas <[email-masked]>
Date: Sat, 14 Mar 2020 13:25:38 +0100

Package: fwupd
Version: 1.3.9-2
Followup-For: Bug #943343

Essentially the same issue as initially reported, but just got version
1.3.9-2 and it's still happening.
Running the 'ExecStart' line manually succeeded successfully.

root@bagend:~# systemctl status fwupd-refresh.service
● fwupd-refresh.service - Refresh fwupd metadata and update motd
     Loaded: loaded (/lib/systemd/system/fwupd-refresh.service; static; vendor preset: disabled)
     Active: failed (Result: exit-code) since Sat 2020-03-14 09:37:54 CET; 3h 32min ago
TriggeredBy: ● fwupd-refresh.timer
       Docs: man:fwupdmgr(1)
   Main PID: 13148 (code=exited, status=1/FAILURE)

mrt 14 09:37:54 bagend systemd[1]: Starting Refresh fwupd metadata and update motd...
mrt 14 09:37:54 bagend systemd[1]: fwupd-refresh.service: Main process exited, code=exited, status=1/FAILURE
mrt 14 09:37:54 bagend systemd[1]: fwupd-refresh.service: Failed with result 'exit-code'.
mrt 14 09:37:54 bagend systemd[1]: Failed to start Refresh fwupd metadata and update motd.
root@bagend:~# systemctl restart fwupd-refresh.service
Job for fwupd-refresh.service failed because the control process exited with error code.
See "systemctl status fwupd-refresh.service" and "journalctl -xe" for details.
root@bagend:~# journalctl -xe
-- A start job for unit fwupd-refresh.timer has finished successfully.
--
-- The job identifier is 5651.
mrt 14 13:08:51 bagend systemd[1]: Reloading.
mrt 14 13:08:51 bagend systemd[1]: /lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/d>
mrt 14 13:08:52 bagend systemd[1]: Reloading.
mrt 14 13:08:52 bagend systemd[1]: /lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/d>
mrt 14 13:08:55 bagend dbus-daemon[828]: [system] Reloaded configuration
mrt 14 13:10:24 bagend systemd[1]: Starting Refresh fwupd metadata and update motd...
-- Subject: A start job for unit fwupd-refresh.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit fwupd-refresh.service has begun execution.
--
-- The job identifier is 5965.
mrt 14 13:10:24 bagend systemd[1]: fwupd-refresh.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- An ExecStart= process belonging to unit fwupd-refresh.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
mrt 14 13:10:24 bagend systemd[1]: fwupd-refresh.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit fwupd-refresh.service has entered the 'failed' state with result 'exit-code'.
mrt 14 13:10:24 bagend systemd[1]: Failed to start Refresh fwupd metadata and update motd.
-- Subject: A start job for unit fwupd-refresh.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit fwupd-refresh.service has finished with a failure.
--
-- The job identifier is 5965 and the job result is failed.
root@bagend:~# cat $(locate fwupd-refresh.service)
[Unit]
Description=Refresh fwupd metadata and update motd
Documentation=man:fwupdmgr(1)
After=network.target network-online.target systemd-networkd.service NetworkManager.service connman.service

[Service]
Type=oneshot
CacheDirectory=fwupdmgr
StandardError=null
DynamicUser=yes
RestrictAddressFamilies=AF_NETLINK AF_UNIX AF_INET AF_INET6
SystemCallFilter=~@mount
ProtectKernelModules=yes
ProtectControlGroups=yes
RestrictRealtime=yes
SuccessExitStatus=2
ExecStart=/usr/bin/fwupdmgr refresh --no-metadata-check
root@bagend:~# /usr/bin/fwupdmgr refresh --no-metadata-check
Fetching metadata https://cdn.fwupd.org/downloads/firmware.xml.gz
Downloading…             [***************************************]
Fetching signature https://cdn.fwupd.org/downloads/firmware.xml.gz.asc

Successfully downloaded new metadata: 1 local device supported

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (500, 'testing'), (101, 'experimental'), (1, 'experimental-debug')
Architecture: amd64 (x86_64)

Kernel: Linux 5.4.0-4-amd64 (SMP w/16 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

ii  libc6                  2.30-2
ii  libflashrom1           1.2-5
ii  libfwupd2              1.3.9-2
ii  libfwupdplugin1        1.3.9-2
ii  libglib2.0-0           2.64.0-2
ii  libgnutls30            3.6.12-2
ii  libgpg-error0          1.37-1
ii  libgpgme11             1.13.1-7
ii  libsmbios-c2           2.4.3-1
ii  libsoup2.4-1           2.70.0-1
ii  libsqlite3-0           3.31.1-4
ii  libtss2-esys0          2.3.3-1
ii  libxmlb1               0.1.15-1

Versions of packages fwupd recommends:
ii  bolt                               0.8-4
ii  fwupd-amd64-signed [fwupd-signed]  1.3.9+2
ii  python3                            3.8.2-1

---

From: <[email-masked]>
Date: Wed, 18 Mar 2020 21:40:22 +0000

I suspect this is related to an upgrade from the intermediary version that had problematic objects/permissions created.

Can you please try to check whether there are broken symlinks in /var/lib/private or /var/cache/private?

Thanks,

> From: Diederik de Haas <[email-masked]>
> Sent: Saturday, March 14, 2020 7:26 AM
> root@bagend:~# systemctl status fwupd-refresh.service ● fwupd-
> refresh.service - Refresh fwupd metadata and update motd
> mrt 14 09:37:54 bagend systemd[1]: fwupd-refresh.service: Main process exited,
> code=exited, status=1/FAILURE mrt 14 09:37:54 bagend systemd[1]: fwupd-
> refresh.service: Failed with result 'exit-code'.
> root@bagend:~# systemctl restart fwupd-refresh.service Job for fwupd-
> refresh.service failed because the control process exited with error code.
> mrt 14 13:08:51 bagend systemd[1]: /lib/systemd/system/dbus.socket:5:
> ListenStream= references a path below legacy directory /var/run/, updating
> /var/run/d> mrt 14 13:08:52 bagend systemd[1]: Reloading.
> mrt 14 13:08:52 bagend systemd[1]: /lib/systemd/system/dbus.socket:5:
> ListenStream= references a path below legacy directory /var/run/, updating
> /var/run/d> mrt 14 13:08:55 bagend dbus-daemon[828]: [system] Reloaded
> configuration mrt 14 13:10:24 bagend systemd[1]: Starting Refresh fwupd
> metadata and update motd...
> root@bagend:~# cat $(locate fwupd-refresh.service) [Unit] Description=Refresh
> ExecStart=/usr/bin/fwupdmgr refresh --no-metadata-check root@bagend:~#
> /usr/bin/fwupdmgr refresh --no-metadata-check Fetching metadata
>   APT policy: (500, 'unstable-debug'), (500, 'unstable'), (500, 'testing'), (101,
> 'experimental'), (1, 'experimental-debug')

---

From: Diederik de Haas <[email-masked]>
Date: Thu, 19 Mar 2020 13:56:47 +0100

On woensdag 18 maart 2020 22:40:22 CET [email-masked] wrote:
> I suspect this is related to an upgrade from the intermediary version that
> had problematic objects/permissions created.
 
> /var/lib/private or /var/cache/private?

It seems there are no symlinks, so also not broken symlinks. 

root@bagend:~# ls -la /var/lib/private/
total 12
drwx------  3 root root 4096 mei  3  2018 .
drwxr-xr-x 82 root root 4096 mrt 19 08:47 ..
drwxr-xr-x  2 root root 4096 jan 10  2019 systemd
root@bagend:~# ls -la /var/lib/private/systemd/
total 8
drwxr-xr-x 2 root root 4096 jan 10  2019 .
drwx------ 3 root root 4096 mei  3  2018 ..
root@bagend:~# ls -la /var/cache/private/
total 16
drwx------  4 root  root  4096 okt  9 21:36 .
drwxr-xr-x 22 root  root  4096 mrt  9 11:56 ..
drwxr-xr-x  2 62803 62803 4096 jul 30  2019 fwupd
drwxr-xr-x  2 62803 62803 4096 okt  9 21:36 fwupdmgr
root@bagend:~# ls -la /var/cache/private/fwupd/
total 720
drwxr-xr-x 2 62803 62803   4096 jul 30  2019 .
drwx------ 4 root  root    4096 okt  9 21:36 ..
-rw-r--r-- 1 62803 62803 722862 jul 30  2019 metadata.xmlb
-rw-r--r-- 1 62803 62803   1471 jul 30  2019 metainfo.xmlb
root@bagend:~# ls -la /var/cache/private/fwupdmgr/
total 8
drwxr-xr-x 2 62803 62803 4096 okt  9 21:36 .
drwx------ 4 root  root  4096 okt  9 21:36 ..

FTR: My system is a fully up-to-date Sid system 
# systemd --version
systemd 245 (245.2-1)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP 
+GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN 
+PCRE2 default-hierarchy=hybrid

---

From: <[email-masked]>
Date: Thu, 19 Mar 2020 13:42:56 +0000

> Sent: Thursday, March 19, 2020 7:57 AM
> To: Limonciello, Mario
> Cc: [email-masked]
> Subject: Re: Bug#943343: fwupd: fwupd-refresh.service failed to start
> Refresh fwupd metadata and update motd.
> 
> > I suspect this is related to an upgrade from the intermediary version
> > that had problematic objects/permissions created.
> 
> drwxr-xr-x  2 root root 4096 jan 10  2019 systemd root@bagend:~# ls -la
> /var/lib/private/systemd/ total 8 drwxr-xr-x 2 root root 4096 jan 10  2019 .
> root@bagend:~# ls -la /var/cache/private/ total 16
> drwxr-xr-x  2 62803 62803 4096 jul 30  2019 fwupd drwxr-xr-x  2 62803 62803
> 4096 okt  9 21:36 fwupdmgr root@bagend:~# ls -la
> /var/cache/private/fwupd/ total 720
> root@bagend:~# ls -la /var/cache/private/fwupdmgr/ total 8 drwxr-xr-x 2
> 62803 62803 4096 okt  9 21:36 .
> FTR: My system is a fully up-to-date Sid system # systemd --version systemd
> 245 (245.2-1)
> +PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP
> ++LIBCRYPTSETUP GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID
> +ELFUTILS
> ++KMOD +IDN2 -IDN

Has your system been rebooted recently?  
I check on my (working) system and I don't have /run/motd.d as a symlink to /run/private/motd.d.
For my system /run/motd.d is a real directory with a subdirectory "fwupd".

I have a suspicion this is related to the issue.

---

From: Diederik de Haas <[email-masked]>
Date: Thu, 19 Mar 2020 14:53:10 +0100

> Has your system been rebooted recently?

Yes. I usually shutdown my system at night.

> I check on my (working) system and I don't have /run/motd.d as a symlink to
> /run/private/motd.d. For my system /run/motd.d is a real directory with a
> subdirectory "fwupd".
> 

I don't have a /run/private directory and also no /run/motd.d.
I do have /run/motd.dynamic which is the same as "uname -nrsvm" (uname -a 
minus the GNU/Linux part)

---

From: <[email-masked]>
Date: Thu, 19 Mar 2020 13:57:30 +0000

> Sent: Thursday, March 19, 2020 8:53 AM
> To: Limonciello, Mario
> > I check on my (working) system and I don't have /run/motd.d as a
> > symlink to /run/private/motd.d. For my system /run/motd.d is a real
> > directory with a subdirectory "fwupd".
> >
> I do have /run/motd.dynamic which is the same as "uname -nrsvm" (uname -
> a minus the GNU/Linux part)

In your first post you had:

---

From: <[email-masked]>
Date: Thu, 19 Mar 2020 13:59:56 +0000

> From: Limonciello, Mario
> Sent: Thursday, March 19, 2020 8:58 AM
> To: Diederik de Haas
> Subject: RE: Bug#943343: fwupd: fwupd-refresh.service failed to start
> > I do have /run/motd.dynamic which is the same as "uname -nrsvm"
> (uname
> > - a minus the GNU/Linux part)
> 

Sorry - I see now that was from a while back.

---

From: Diederik de Haas <[email-masked]>
Date: Thu, 19 Mar 2020 15:02:13 +0100

> Sorry - I see now that was from a while back.

And also a different user (OP).

---

From: Thomas Stewart <[email-masked]>
Date: Wed, 27 Jan 2021 11:42:26 +0000

Hi,

I'm running testing/sid and have fwupd-1.5.5-2 installed. I have found
that when fwupd-refresh.service restarts either with the timer or
manually that if DynamicUser=yes is enabled then the service fails to
start[0]. When I remove DynamicUser from the unit it restarts fine.

I noticed that the unit has: CacheDirectory=fwupdmgr but the
metadata seems to live in /var/cache/fwupd[1].

After purging the package and removing /var/cache/fwup* /var/lib/fwupd
/var/cache/private/fwupd and reinstalling I can see the /var/cache dirs
created[2] but the service does not start.

When removing the "StandardError=null" directive from the unit I get an
additional error[3], which seems to indicate it's having trouble
talking to dbus.

Kind Regards
--
Tom

[0]
$ sudo systemctl restart fwupd-refresh.service
Job for fwupd-refresh.service failed because the control process exited with error code.
See "systemctl status fwupd-refresh.service" and "journalctl -xe" for details.
$

$ sudo journalctl -f 
Jan 27 10:09:30 systemd[1]: Starting Refresh fwupd metadata and update motd...
Jan 27 10:09:31 fwupdmgr[176638]: (fwupdmgr:176638): GLib-DEBUG: 10:09:31.089: setenv()/putenv() are not thread-safe and should not be used after threads are created
Jan 27 10:09:31 systemd[1]: fwupd-refresh.service: Main process exited, code=exited, status=1/FAILURE
Jan 27 10:09:31 systemd[1]: fwupd-refresh.service: Failed with result 'exit-code'.
Jan 27 10:09:31 systemd[1]: Failed to start Refresh fwupd metadata and update motd.
$

[1]
$ find /var/cache/fw*
/var/cache/fwupd
/var/cache/fwupd/metadata.xmlb
/var/cache/fwupd/quirks.xmlb
/var/cache/fwupd/metainfo.xmlb
/var/cache/fwupdmgr
$

[2]
$ sudo ls -la /var/cache/fwupdmgr /var/cache/private/fwupdmgr
lrwxrwxrwx 1 root  root    16 Jan 27 10:57 /var/cache/fwupdmgr -> private/fwupdmgr

/var/cache/private/fwupdmgr:
total 8
drwxr-xr-x 2 62803 62803 4096 Jan 27 10:57 .
drwx------ 3 root  root  4096 Jan 27 10:57 ..
$

[3]
Jan 27 11:09:30 fwupdmgr[189035]: Failed to connect to daemon: Exhausted all available authentication mechanisms (tried: EXTERNAL) (available: EXTERNAL)

---

From: Thomas Stewart <[email-masked]>
Date: Wed, 27 Jan 2021 14:32:32 +0000

On 27 Jan 2021, at 14:18, Limonciello, Mario wrote:
> Can you check if fwupdmgr works as a standard user to talk to the daemon for you?

As a normal user I can run "fwupdmgr --version" fine[0].

However if I amend the unit to run the above[1] the output stops before
daemon version[2].

Kind Regards
--
Tom

[0]
$ id
uid=1000(thomas) gid=1000(thomas) groups=1000(thomas),20(dialout),27(sudo),128(docker)
$
$ /usr/bin/fwupdmgr --version
client version: 1.5.5
compile-time dependency versions
        gusb:   0.3.5

        daemon version: 1.5.5
$

[1]
ExecStart=/usr/bin/fwupdmgr --version

[2]
Jan 27 14:24:38 systemd[1]: Starting Refresh fwupd metadata and update motd...
Jan 27 14:24:38 fwupdmgr[199579]: client version:        1.5.5
Jan 27 14:24:38 fwupdmgr[199579]: compile-time dependency versions
Jan 27 14:24:38 fwupdmgr[199579]:         gusb:        0.3.5
Jan 27 14:24:38 fwupdmgr[199579]: Failed to connect to daemon: Exhausted all available authentication mechanisms (tried: EXTERNAL) (available: EXTERNAL)
Jan 27 14:24:38 systemd[1]: fwupd-refresh.service: Main process exited, code=exited, status=1/FAILURE
Jan 27 14:24:38 systemd[1]: fwupd-refresh.service: Failed with result 'exit-code'.
Jan 27 14:24:38 systemd[1]: Failed to start Refresh fwupd metadata and update motd.

---

From: "Limonciello, Mario" <[email-masked]>
Date: Wed, 27 Jan 2021 14:17:56 +0000

> From: Thomas Stewart <[email-masked]>
> Sent: Wednesday, January 27, 2021 5:42
> Jan 27 10:09:31 fwupdmgr[176638]: (fwupdmgr:176638): GLib-DEBUG: 10:09:31.089:
> setenv()/putenv() are not thread-safe and should not be used after threads are
> created
> Jan 27 11:09:30 fwupdmgr[189035]: Failed to connect to daemon: Exhausted all
> available authentication mechanisms (tried: EXTERNAL) (available: EXTERNAL)

---

From: "Limonciello, Mario" <[email-masked]>
Date: Thu, 28 Jan 2021 02:12:11 +0000

Are you by chance using NFS mounted directories?  Or external entity for authentication such as LDAP or SSSD?

> Sent: Wednesday, January 27, 2021 8:33
> To: Limonciello, Mario
> Subject: Re: Bug#943343: fwupd: fwupd-refresh.service failed to start Refresh
> uid=1000(thomas) gid=1000(thomas)
> groups=1000(thomas),20(dialout),27(sudo),128(docker)
> $
> Jan 27 14:24:38 fwupdmgr[199579]: Failed to connect to daemon: Exhausted all

---

From: Thomas Stewart <[email-masked]>
Date: Thu, 28 Jan 2021 07:35:32 +0000

Yes, I'm using sssd against FreeIPA.

Tom

---

From: "Limonciello, Mario" <[email-masked]>
Date: Fri, 29 Jan 2021 03:28:51 +0000

I'm unsure what to do here, it seems to me that there is a problem with systemd using DynamicUser and sssd when the service uses dbus.
Perhaps this should be re-assigned to systemd.

> Sent: Thursday, January 28, 2021 1:36
> To: Limonciello, Mario
> Subject: RE: Bug#943343: fwupd: fwupd-refresh.service failed to start Refresh

---

From: Thomas Stewart <[email-masked]>
Date: Fri, 29 Jan 2021 09:33:03 +0000

> Perhaps this should be re-assigned to systemd.

I will attempt to reproduce on a non freeipa joined machine.

Kind Regards
--
Tom