Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-61882

dnf-automatic does not send email when /usr is full

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Normal Normal
    • rhel-9.6
    • rhel-9.4
    • dnf
    • rhel-sst-cs-software-management
    • ssg_core_services
    • 17
    • 20
    • None
    • False
    • Hide

      None

      Show
      None
    • Yes
    • None
    • Hide

      Backport https://github.com/rpm-software-management/dnf/pull/2005.

      Test that "dnf-automatic" with "apply_updates = yes" and "send_error_messages = yes" set actuates an emitter with en error message if applying updates fail.

      Be ware that dnf-4.14.0-17 already prints the error on a standard error output.
      Be ware that some error conditions (e.g. a disk so full that DNF even does not initialize) might still be unable to emit the error.

      An automated test will be written.

      Show
      Backport https://github.com/rpm-software-management/dnf/pull/2005 . Test that "dnf-automatic" with "apply_updates = yes" and "send_error_messages = yes" set actuates an emitter with en error message if applying updates fail. Be ware that dnf-4.14.0-17 already prints the error on a standard error output. Be ware that some error conditions (e.g. a disk so full that DNF even does not initialize) might still be unable to emit the error. An automated test will be written.
    • None
    • None
    • Enhancement
    • Hide
      Feature, enhancement: Enable dnf-automatic(8) tool to notify a user about a failed update application via emitter configured in dnf-automatic's configuration.

      Reason: Users might be interested in when automatic update application fails.

      Result: New "send_error_messages" boolean option was added to dnf-automatic(8) configuration. If this option is set to "yes", dnf-automatic tool will report update failures in a way which is set in "emit_via" configuration option. This new feature is disabled by default.
      Show
      Feature, enhancement: Enable dnf-automatic(8) tool to notify a user about a failed update application via emitter configured in dnf-automatic's configuration. Reason: Users might be interested in when automatic update application fails. Result: New "send_error_messages" boolean option was added to dnf-automatic(8) configuration. If this option is set to "yes", dnf-automatic tool will report update failures in a way which is set in "emit_via" configuration option. This new feature is disabled by default.
    • Proposed
    • None

      What were you trying to do that didn't work?

      When /usr is full, dnf-automatic does not run properly (as dnf exits prematurely), and no email is sent notifying the user about what happened.

      What is the impact of this issue to you?

      The user has no notification about what why dnf-automatic did not run.

      Please provide the package NVR for which the bug is seen:

      dnf-automatic-4.14.0-9.el9.noarch (the component list in Jira does not list a "dnf-automatic" component).

      How reproducible is this bug?:

      Every time

      Steps to reproduce

      1. Set up a RHEL system where /usr is a separate partition
      2. Ensure there is something for dnf to upgrade
      3. Ensure dnf-automatic is configured to send email, e.g.:
        # cat /etc/dnf/automatic.conf
        [commands]
        upgrade_type = default
        random_sleep = 0
        network_online_timeout = 60
        download_updates = yes
        apply_updates = yes
        [emitters]
        emit_via = stdio
        [email]
        email_from = root@localhost
        email_to = root@localhost
        email_host = localhost
        [command]
        [command_email]
        command_format = "mail -Ssendwait -s {subject} -r {email_from} {email_to}"
        stdin_format = "{body}"email_from = root@localhost
        email_to = root@localhost
        [base]
        debuglevel = 1
         
      4. Fill up /usr, e.g.:
        dd if=/dev/random of=/usr/filler
      5. systemctl start dnf-automatic

      Expected results

      An email (or the configured notification method) should be sent, detailing why dnf did not run.

      Actual results

      No notification about the problem is sent. The only relevant system logs in the journal are:

      Oct 09 10:13:04 r94-dnfauto systemd[1]: Starting dnf automatic...
      Oct 09 10:13:05 r94-dnfauto dnf-automatic[3762]: Updating Subscription Management repositories.
      Oct 09 10:13:09 r94-dnfauto dnf-automatic[3762]: Last metadata expiration check: 0:16:02 ago on Wed 09 Oct 2024 09:57:07 AM CEST.
      Oct 09 10:13:10 r94-dnfauto dnf-automatic[3762]: Running transaction check
      Oct 09 10:13:10 r94-dnfauto dnf-automatic[3762]: Transaction check succeeded.
      Oct 09 10:13:10 r94-dnfauto dnf-automatic[3762]: Running transaction test
      Oct 09 10:13:11 r94-dnfauto dnf-automatic[3762]: The downloaded packages were saved in cache until the next successful transaction.
      Oct 09 10:13:11 r94-dnfauto dnf-automatic[3762]: You can remove cached packages by executing 'dnf clean packages'.
      Oct 09 10:13:11 r94-dnfauto dnf-automatic[3762]: Error: Transaction test error:
      Oct 09 10:13:11 r94-dnfauto dnf-automatic[3762]:   installing package bash-5.1.8-9.el9.x86_64 needs 6MB more space on the /usr filesystem
      Oct 09 10:13:11 r94-dnfauto dnf-automatic[3762]: Error Summary
      Oct 09 10:13:11 r94-dnfauto dnf-automatic[3762]: -------------
      Oct 09 10:13:11 r94-dnfauto dnf-automatic[3762]: Disk Requirements:
      Oct 09 10:13:11 r94-dnfauto dnf-automatic[3762]:    At least 6MB more space needed on the /usr filesystem.
      Oct 09 10:13:11 r94-dnfauto systemd[1]: dnf-automatic.service: Main process exited, code=exited, status=1/FAILURE
      Oct 09 10:13:11 r94-dnfauto systemd[1]: dnf-automatic.service: Failed with result 'exit-code'.
      Oct 09 10:13:11 r94-dnfauto systemd[1]: Failed to start dnf automatic.

              packaging-team-maint packaging-team-maint
              rhn-support-jsantos Juan Santos
              packaging-team-maint packaging-team-maint
              Software Management QE Software Management QE
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: