Bug 1816308 - dnf-automatic.timer runs before the computer can connect to the internet
Summary: dnf-automatic.timer runs before the computer can connect to the internet
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 31
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: ---
Assignee: Marek Blaha
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-23 19:02 UTC by Carmen Bianca Bakker
Modified: 2020-10-27 01:20 UTC (History)
9 users (show)

Fixed In Version: dnf-4.4.0-1.fc32
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-18 15:49:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
System journal of session with failed dnf-automatic.service (776.60 KB, text/plain)
2020-04-03 10:00 UTC, Carmen Bianca Bakker
no flags Details

Description Carmen Bianca Bakker 2020-03-23 19:02:16 UTC
Description of problem:

dnf-automatic.timer is supposed to automatically update the system. When I resume from suspend after the scheduled update time, dnf-automatic.timer expectedly runs. However, because NetworkManager is still busy to connect to the wifi, the service/timer fails:

● dnf-automatic.service - dnf automatic
   Loaded: loaded (/usr/lib/systemd/system/dnf-automatic.service; static; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2020-03-23 18:52:26 GMT; 6min ago
  Process: 519426 ExecStart=/usr/bin/dnf-automatic /etc/dnf/automatic.conf --timer (code=exited, status=1/FAILURE)
 Main PID: 519426 (code=exited, status=1/FAILURE)
      CPU: 1.744s

Mar 23 18:52:24 carmenbianca-thinkpad systemd[1]: Starting dnf automatic...
Mar 23 18:52:26 carmenbianca-thinkpad dnf-automatic[519426]: Errors during downloading metadata for repository 'updates-modular':
Mar 23 18:52:26 carmenbianca-thinkpad dnf-automatic[519426]:   - Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metal>
Mar 23 18:52:26 carmenbianca-thinkpad dnf-automatic[519426]: Eraro: Failed to download metadata for repo 'updates-modular': Cannot prepare internal mir>
Mar 23 18:52:26 carmenbianca-thinkpad systemd[1]: dnf-automatic.service: Main process exited, code=exited, status=1/FAILURE
Mar 23 18:52:26 carmenbianca-thinkpad systemd[1]: dnf-automatic.service: Failed with result 'exit-code'.
Mar 23 18:52:26 carmenbianca-thinkpad systemd[1]: Failed to start dnf automatic.
Mar 23 18:52:26 carmenbianca-thinkpad systemd[1]: dnf-automatic.service: Consumed 1.744s CPU time.




Version-Release number of selected component (if applicable):

dnf-4.2.18-1.fc31.rpm


How reproducible:


Steps to Reproduce:
1. systemctl enable --now dnf-automatic.timer
2. suspend the system until after the scheduled update
3. resume from suspend
4. systemctl status dnf-automatic.service

Actual results:

The update failed because of a lack of internet connectivity.


Expected results:

The timer waits for internet connectivity to become available.


Additional info:

Comment 1 Marek Blaha 2020-04-03 09:52:05 UTC
Hi,
dnf-automatic waits until system reach network-online.target. This should assure that network connection is available and dnf can proceed with downloading updates. For some reason it looks like in your case this target is reached before the network connectivity is available. If you are able to reproduce the bug please can you check / post here system journal with unsuccessful dnf-automatic run? Do you have some special network configuration?

Comment 2 Carmen Bianca Bakker 2020-04-03 09:59:39 UTC
There is no special network configuration. Just Fedora Workstation 31 running on a laptop with wifi connectivity. The only "special" thing is that I have told NetworkManager to automatically connect to a VPN. But on my work laptop, of which I don't think I can share the logs, the same thing happens, and there is no VPN.

Attaching logs of a boot with an unsuccessful run.

Comment 3 Carmen Bianca Bakker 2020-04-03 10:00:22 UTC
Created attachment 1675973 [details]
System journal of session with failed dnf-automatic.service

Comment 4 Marek Blaha 2020-04-08 07:30:57 UTC
It turned out that dnf-automatic should not rely on network-online.target as reaching it does not guarantee network availability (it's more like the network configuration is finished). I'm working on the fix, but meanwhile you can try workaround - there is an option 'random_sleep' in /etc/dnf/automatic.conf. If you change it to some reasonable value (like 600 for 10 minutes), dnf-automatic will pause for random time in interval <0, random_sleep). This could give the NetworkManager some time to resume network connection.
Sorry for inconvenience.

Comment 5 Marek Blaha 2020-04-14 06:09:28 UTC
PR https://github.com/rpm-software-management/dnf/pull/1616 introduces waiting for functional internet connection before dnf-automatic starts to download repositories and updates.

Comment 6 Fedora Update System 2020-10-08 11:59:09 UTC
FEDORA-2020-b40fc174b5 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-b40fc174b5

Comment 7 Fedora Update System 2020-10-08 12:00:10 UTC
FEDORA-2020-5d9f0ce2b3 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-5d9f0ce2b3

Comment 8 Fedora Update System 2020-10-08 22:19:35 UTC
FEDORA-2020-b40fc174b5 has been pushed to the Fedora 33 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-b40fc174b5`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-b40fc174b5

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2020-10-12 21:15:43 UTC
FEDORA-2020-b40fc174b5 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-b40fc174b5

Comment 10 Fedora Update System 2020-10-12 21:23:20 UTC
FEDORA-2020-5d9f0ce2b3 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-5d9f0ce2b3

Comment 11 Fedora Update System 2020-10-12 22:45:07 UTC
FEDORA-2020-b40fc174b5 has been pushed to the Fedora 33 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-b40fc174b5`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-b40fc174b5

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2020-10-13 20:18:03 UTC
FEDORA-2020-5d9f0ce2b3 has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-5d9f0ce2b3`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-5d9f0ce2b3

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 13 Fedora Update System 2020-10-18 15:49:06 UTC
FEDORA-2020-5d9f0ce2b3 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Fedora Update System 2020-10-19 16:53:20 UTC
FEDORA-2020-b40fc174b5 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-b40fc174b5

Comment 15 Fedora Update System 2020-10-20 14:22:39 UTC
FEDORA-2020-b40fc174b5 has been pushed to the Fedora 33 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-b40fc174b5`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-b40fc174b5

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 16 Fedora Update System 2020-10-27 01:20:39 UTC
FEDORA-2020-b40fc174b5 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.


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