fwupd-refresh.service failed

8,418

Solution 1

In some cases this error can be safely ignored. fwupd-refresh.service just executes /usr/bin/fwupdmgr refresh command and treats exit status 2 as success (see last 2 lines of fwupd-refresh.service). But fwupdmgr can also successfully exit with status 0, which will be wrongfully interpreted by systemd as an error.

  • systemctl cat fwupd-refresh:

    # /lib/systemd/system/fwupd-refresh.service
    [Unit]
    Description=Refresh fwupd metadata and update motd
    Documentation=man:fwupdmgr(1)
    After=network.target
    
    [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
    
  • sudo /usr/bin/fwupdmgr refresh:

    ...
    Successfully downloaded new metadata: 0 local devices supported
    
  • echo $?: 0

  • man fwupdmgr:

    EXIT STATUS
          Commands that successfully execute will return "0", but commands that have no actions but successfully execute will return "2".
    

Solution 2

fwupd-refresh.service Loaded: masked

A service that is masked is disabled and can't be activated by an other unit (timers, targets, services...) that needs it or manually. It's the stronger version of disabling a service.

fwupd-refresh.timer: ...failed...unit fwupd-refresh is masked.

To change this:

sudo systemctl unmask fwupd-refresh

Then this:

sudo systemctl daemon-reload && systemctl start fwupd-refresh.service
systemctl list-units --failed

If fwupd-refresh is listed as failed then:

Uncomment #DynamicUser=yes in /lib/systemd/system/fwupd-refresh.service

https://www.freedesktop.org/software/systemd/man/systemd.exec.html#DynamicUser=

Share:
8,418
Pablo Bianchi
Author by

Pablo Bianchi

Cypherpunks write code. There is no bug, only happy accidents.

Updated on January 04, 2023

Comments

  • Pablo Bianchi
    Pablo Bianchi over 1 year

    I have VPS, and after checking systemctl, I noticed that my fwupd-refresh.service failed.

    terminal

    Can you explain the problem, and could you help to fix it?

  • Admin
    Admin almost 2 years
    Any idea why I'd get the following after /usr/bin/fwupdmgr refresh: Failed to connect to daemon: Error calling StartServiceByName for org.freedesktop.fwupd: Timeout was reached
  • Admin
    Admin almost 2 years
    @MikeCiffone no, but these might be relevant: github.com/fwupd/fwupd/issues/1805 github.com/fwupd/fwupd/issues/4242
  • Admin
    Admin almost 2 years
    For anyone that experiences that timeout error: apt upgrade fwupd.service followed by /usr/bin/fwupdmgr refresh resolved it.