Bug 1317215 - systemd prints errors: "Failed to load environment files: No such file or directory" and "Failed to run 'stop-post' task: No such file or directory
systemd prints errors: "Failed to load environment files: No such file or dir...
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: dnf-plugins-extras (Show other bugs)
24
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: rpm-software-management
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-12 20:00 EST by Christian Stadelmann
Modified: 2017-04-19 07:11 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-04-19 07:11:37 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)
Update logs machine 1 - raman (2.88 MB, text/plain)
2016-11-06 18:52 EST, Raman Gupta
no flags Details
Update logs machine 2 - raman (1.68 MB, text/plain)
2016-11-06 18:54 EST, Raman Gupta
no flags Details

  None (edit)
Description Christian Stadelmann 2016-03-12 20:00:58 EST
Description of problem:
I went through the logs of dnf-system-upgrade.service and found these errors printed by systemd after a successful system upgrade. 

Version-Release number of selected component (if applicable):
dnf-plugin-system-upgrade 0.7.1-1.fc23

How reproducible:
unclear

Actual results:
(relevant syslog entries after dnf successfully finished a system upgrade)

dnf[931]: DDEBUG:dnf:Cleaning up.
[…]
systemd-logind[1105]: System is rebooting.
[…]
systemd[1]: dnf-system-upgrade.service: Failed to load environment files: No such file or directory
systemd[1]: dnf-system-upgrade.service: Failed to load 'stop-post' task: No such file or directory
systemd[1]: Stopped System Upgrade.
systemd[1]: dnf-system-upgrade.service: Unit entered failed state.
systemd[1]: dnf-system-upgrade.service: Failed with result 'resources'.
systemd[1]: Rebooting as result of failure.

This block of systemd error messages repeates once.

Expected results:
No errors on rebooting
Comment 1 Hashem Nasarat 2016-06-24 02:47:28 EDT
dnf-system-upgrade service deletes /system-upgrade/ when it starts which is why the systemd errors about "No such file or directory" get printed. The actual error is probably right before that line but it's not printed in this log snippet.

I had this problem and dnf system-upgrade log -1 led to me to check /var/log/dnf.log to find the actual issue.

It would help to have dnf-system-upgrade could print better error messages when things fail.
Comment 2 Zbigniew Jędrzejewski-Szmek 2016-06-24 15:59:33 EDT
Can one of you paste the whole logs for the upgrade? I cannot reproduce this error.
Comment 3 Will Woods 2016-06-24 16:15:42 EDT
This would be pretty simple to fix - just make it so it's not an error if the EnvironmentFile  is missing.

diff --git a/dnf-system-upgrade.service b/dnf-system-upgrade.service
index 32d8951..4720a31 100644
--- a/dnf-system-upgrade.service
+++ b/dnf-system-upgrade.service
@@ -6,7 +6,7 @@ Documentation=http://www.freedesktop.org/wiki/Software/systemd/SystemUpdates
 [Service]
 # We need the --releasever junk because there's no way for DNF plugins to
 # change $releasever - see https://bugzilla.redhat.com/show_bug.cgi?id=1212341
-EnvironmentFile=/system-update/.dnf-system-upgrade
+EnvironmentFile=-/system-update/.dnf-system-upgrade
 ExecStart=/usr/bin/dnf --releasever=${RELEASEVER} system-upgrade upgrade
 
 ExecStopPost=/usr/bin/rm -fv /system-update

Patch proposed here: https://github.com/rpm-software-management/dnf-plugin-system-upgrade/pull/51
Comment 4 Hashem Nasarat 2016-06-25 13:09:16 EDT
Here's the error I had in my dnf.log https://github.com/drenninghoff/infinality-ultimate-fedora/issues/13

and the truncated log (there's just my whole list of packages before):

 nss                       x86_64 3.24.0-1.2.fc24            @commandline 863 k
 nss-devel                 x86_64 3.24.0-1.2.fc24            @commandline 216 k
 nss-sysinit               x86_64 3.24.0-1.2.fc24            @commandline  58 k
 nss-tools                 x86_64 3.24.0-1.2.fc24            @commandline 496 k

Transaction Summary
================================================================================
Install     218 Packages
Upgrade    2603 Packages
Remove        8 Packages
Downgrade     9 Packages

Jun 23 23:28:43 INFO Total size: 1.9 G
Jun 23 23:28:43 INFO Downloading Packages:
Jun 23 23:28:43 INFO Running transaction check
Jun 23 23:28:48 INFO Transaction check succeeded.
Jun 23 23:28:48 INFO Running transaction test
Jun 23 23:28:51 DDEBUG Cleaning up.
Jun 23 23:28:51 SUBDEBUG 
Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 60, in main
    return _main(base, args)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 120, in _main
    ret = resolving(cli, base)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 149, in resolving
    base.do_transaction(display=displays)
  File "/usr/lib/python3.4/site-packages/dnf/cli/cli.py", line 228, in do_transaction
    super(BaseCli, self).do_transaction(display)
  File "/usr/lib/python3.4/site-packages/dnf/base.py", line 591, in do_transaction
    self._trans_error_summary(errstring))
dnf.exceptions.Error: Transaction check error:
  file /etc/fonts/conf.d/README from install of fontconfig-2.11.94-6.fc24.x86_64 conflicts with file from package fontconfig-infinality-ultimate-2.11.94-4.fc23.i686
  file /etc/fonts/conf.d/49-sansserif.conf from install of fontconfig-2.11.94-6.fc24.x86_64 conflicts with file from package fontconfig-infinality-ultimate-2.11.94-4.fc23.i686

Error Summary
-------------

Jun 23 23:28:51 CRITICAL Error: Transaction check error:
  file /etc/fonts/conf.d/README from install of fontconfig-2.11.94-6.fc24.x86_64 conflicts with file from package fontconfig-infinality-ultimate-2.11.94-4.fc23.i686
  file /etc/fonts/conf.d/49-sansserif.conf from install of fontconfig-2.11.94-6.fc24.x86_64 conflicts with file from package fontconfig-infinality-ultimate-2.11.94-4.fc23.i686

Error Summary
-------------

Jun 23 23:29:46 INFO --- logging initialized ---
Jun 23 23:29:46 DDEBUG timer: config: 9 ms
Jun 23 23:29:46 DEBUG cachedir: /var/cache/dnf
Jun 23 23:29:46 DEBUG Loaded plugins: reposync, noroot, generate_completion_cache, debuginfo-install, copr, system-upgrade, needs-restarting, playground, config-manager, protected_packages, builddep, download, Query
Jun 23 23:29:46 DEBUG DNF version: 1.1.9
Jun 23 23:29:46 DDEBUG Command: dnf system-upgrade reboot 
Jun 23 23:29:46 DDEBUG Installroot: /
Jun 23 23:29:46 DDEBUG Releasever: 23
Jun 23 23:29:46 DDEBUG Base command: system-upgrade
Jun 23 23:29:46 DDEBUG Extra commands: ['reboot']
Comment 5 Zbigniew Jędrzejewski-Szmek 2016-06-26 10:12:20 EDT
Like it says, fontconfig-infinality-ultimate-2.11.94-4.fc23.i686 stops the upgrade from happening. Uninstalling it by hand like you did is the proper solution. There isn't much that we can do, please work with the authors of the external package to resolve this.
Comment 6 Zbigniew Jędrzejewski-Szmek 2016-06-26 10:15:57 EDT
OK, reopening, because the error that Hashem Nasarat had was unrelated to the original report. The original report is a different issue.
Comment 7 Hashem Nasarat 2016-06-26 10:27:42 EDT
Zbigniew, yes the correct solution was to uninstall the infinality package, but dnf-system-upgrade ought to print out why it fails to upgrade (even something like, "dnf encountered an error check /var/log/dnf.log"), so the user is less confused by the upgrade silently failing.
Comment 8 Radek Vokal 2016-06-27 06:47:23 EDT
Same issue, my log is here .. https://paste.fedoraproject.org/385415/02438814/

caused by 

$ dnf clean all && dnf system-upgrade download --setopt=keepcache=1 --releasever=24 && dnf system-upgrade reboot
Comment 9 Will Woods 2016-06-27 13:52:35 EDT
(In reply to Radek Vokal from comment #8)
> Same issue, my log is here ..
> https://paste.fedoraproject.org/385415/02438814/
> 
> caused by 
> 
> $ dnf clean all && dnf system-upgrade download --setopt=keepcache=1
> --releasever=24 && dnf system-upgrade reboot

Notice this bit in your logs:

  systemd[1]: fwupd-offline-update.service: Main process exited, code=exited, status=1/FAILURE
  systemd[1]: fwupd-offline-update.service: Unit entered failed state.
  systemd[1]: fwupd-offline-update.service: Triggering OnFailure= dependencies.

So fwupd-offline-update.service failed, and then it rebooted your system. That's a fwupd bug - it shouldn't be running during a system upgrade. (See bug 1350120.)

I'm fairly sure the "dnf-system-upgrade.service: Failed to load environment files" error is irrelevant in your case, and it's probably harmless during a normal system upgrade, since all it does is cause the system to reboot (which it was trying to do anyway).
Comment 10 Radek Vokal 2016-06-30 07:42:12 EDT
(In reply to Will Woods from comment #9)
> (In reply to Radek Vokal from comment #8)
> > Same issue, my log is here ..
> > https://paste.fedoraproject.org/385415/02438814/
> > 
> > caused by 
> > 
> > $ dnf clean all && dnf system-upgrade download --setopt=keepcache=1
> > --releasever=24 && dnf system-upgrade reboot
> 
> Notice this bit in your logs:
> 
>   systemd[1]: fwupd-offline-update.service: Main process exited,
> code=exited, status=1/FAILURE
>   systemd[1]: fwupd-offline-update.service: Unit entered failed state.
>   systemd[1]: fwupd-offline-update.service: Triggering OnFailure=
> dependencies.
> 
> So fwupd-offline-update.service failed, and then it rebooted your system.
> That's a fwupd bug - it shouldn't be running during a system upgrade. (See
> bug 1350120.)
> 
> I'm fairly sure the "dnf-system-upgrade.service: Failed to load environment
> files" error is irrelevant in your case, and it's probably harmless during a
> normal system upgrade, since all it does is cause the system to reboot
> (which it was trying to do anyway).

And you're right. I've simple removed fwupd service before running the upgrade and whole upgrade went smoothly. 

Radek
Comment 11 Christian Stadelmann 2016-08-31 16:17:24 EDT
Same issue as described in comment #0 is still present on a F24 → F25 upgrade using dnf system-upgrade plugin. Not related to fwupd in any way I think.
Comment 12 Raman Gupta 2016-11-06 18:52 EST
Created attachment 1217838 [details]
Update logs machine 1 - raman

I had the same issue on two separate machines, when updating from Fedora 23 to Fedora 24. There is no reference in the logs to fwupd.
Comment 13 Raman Gupta 2016-11-06 18:54 EST
Created attachment 1217839 [details]
Update logs machine 2 - raman

Logs from second machine with same problem
Comment 14 Will Woods 2016-11-07 16:54:43 EST
The "systemd[1]: dnf-system-upgrade.service: Failed with result 'resources'" messages are harmless. They're caused by a known bug in dnf-plugin-system-upgrade-0.7.1, which should be fixed by this commit in git: https://github.com/rpm-software-management/dnf-plugin-system-upgrade/commit/430454b

The next build of the plugin should fix this problem. Unfortunately it's not clear who's the maintainer of the plugin anymore, so nobody's built a new version yet.
Comment 15 Raman Gupta 2017-04-16 18:25:45 EDT
(In reply to Will Woods from comment #14)
> The next build of the plugin should fix this problem. Unfortunately it's not
> clear who's the maintainer of the plugin anymore, so nobody's built a new
> version yet.

Same issue when updating Fedora 24 to Fedora 25. This seems like a pretty critical component to not have a maintainer?
Comment 16 Will Woods 2017-04-17 14:46:20 EDT
The system-upgrade plugin is now maintained by the DNF team, and has been moved into the dnf-plugins-extras package in F26.

The fix for the harmless "Failed with result 'resources' ... " message is present in that package:

  https://github.com/rpm-software-management/dnf-plugins-extras/blob/master/etc/systemd/dnf-system-upgrade.service

I'll leave it to the DNF team to decide how to handle this in F25 and F24.
Comment 17 Igor Gnatenko 2017-04-19 07:11:37 EDT
Next release of dnf-plugins-extras will be released next week and will be available for F26+. Unfortunately, F24/F25 will not get a fix since it's just harmless.

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