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
Summary: systemd prints errors: "Failed to load environment files: No such file or dir...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf-plugins-extras
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-13 01:00 UTC by Christian Stadelmann
Modified: 2017-04-19 11:11 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-04-19 11:11:37 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Update logs machine 1 - raman (2.88 MB, text/plain)
2016-11-06 23:52 UTC, Raman Gupta
no flags Details
Update logs machine 2 - raman (1.68 MB, text/plain)
2016-11-06 23:54 UTC, Raman Gupta
no flags Details

Description Christian Stadelmann 2016-03-13 01:00:58 UTC
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 06:47:28 UTC
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 19:59:33 UTC
Can one of you paste the whole logs for the upgrade? I cannot reproduce this error.

Comment 3 Will Woods 2016-06-24 20:15:42 UTC
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 17:09:16 UTC
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 14:12:20 UTC
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 14:15:57 UTC
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 14:27:42 UTC
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 Vokál 2016-06-27 10:47:23 UTC
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 17:52:35 UTC
(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 Vokál 2016-06-30 11:42:12 UTC
(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 20:17:24 UTC
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 23:52:42 UTC
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 23:54:31 UTC
Created attachment 1217839 [details]
Update logs machine 2 - raman

Logs from second machine with same problem

Comment 14 Will Woods 2016-11-07 21:54:43 UTC
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 22:25:45 UTC
(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 18:46:20 UTC
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 11:11:37 UTC
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.