Bug 1897616

Summary: [rhel-7]cloud-final.service fails if NetworkManager not installed.
Product: Red Hat Enterprise Linux 7 Reporter: Scott Moser <smoser>
Component: cloud-initAssignee: Emanuele Giuseppe Esposito <eesposit>
Status: CLOSED ERRATA QA Contact: xiachen
Severity: medium Docs Contact:
Priority: medium    
Version: 7.9CC: eterrell, giedrius, huzhao, jgreguske, joerg.lehmann, jreznik, jukka.nousiainen, martin, ribarry, schandle, smoser, tormod.macleod, yacao
Target Milestone: rcKeywords: Reopened, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: cloud-init-19.4-7.el7_9.5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1898943 (view as bug list) Environment:
Last Closed: 2021-07-21 01:10:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1898943    
Attachments:
Description Flags
Proposed fix for issue. none

Description Scott Moser 2020-11-13 16:17:17 UTC
Created attachment 1729145 [details]
Proposed fix for issue.

Description of problem:

cloud-final.service wil fail if NetworkManager is not installed.

journal -u cloud-final.service would show:

   cloud-init[5328]: Cloud-init v. 19.4 finished at ...
   echo[5346]: try restart NetworkManager.service
   systemctl[5349]: Failed to reload-or-try-restart
       NetworkManager.service: Unit not found.
   systemd[1]: cloud-final.service: control process exited,
       code=exited status=5
   systemd[1]: Failed to start Execute cloud user/final scripts.
   systemd[1]: Unit cloud-final.service entered failed state.
   systemd[1]: cloud-final.service failed.

Note that both of 'try-reload-or-restart' and 'reload-or-try-restart'
will fail if the service is not present.  So this would also
affect rhel 8 systems that do not use NetworkManager.

Version-Release number of selected component (if applicable): cloud-init-19.4-7.el7_7

How reproducible: Always

Comment 2 Scott Moser 2020-11-16 13:27:44 UTC
Just for the record, the same problem will occur in rhel 8.
Both both of 'try-reload-or-restart' and 'reload-or-try-restart'
will exit non-zero if the service provided is not present.

Comment 3 Eduardo Otubo 2020-11-18 11:09:29 UTC
For the record, as we already agreed on IRC on that, this is a very specific corner case as RHEL is always shipped with NetworkManager. The chance of having a customer running into this problem if very unlikely. This won't be fixed for RHEL-7.9 but I'll add as a lower priority for RHEL-8.

Thanks for reporting that!

Comment 4 Joerg Lehmann 2020-11-19 14:57:41 UTC
Just experienced this same problem when updating to CentOS 7.9.2009 on a Hetzner Cloud Server. This is not really a "specific corner case", IMHO :-)

Comment 5 Eduardo Otubo 2020-11-20 10:45:57 UTC
(In reply to Joerg Lehmann from comment #4)
> Just experienced this same problem when updating to CentOS 7.9.2009 on a
> Hetzner Cloud Server. This is not really a "specific corner case", IMHO :-)

Sure we can reopen this BZ in this case. As you mentioned on BZ#1829713, you do have NM installed and you're still facing this issue. Can you post the logs?

Comment 7 Joerg Lehmann 2020-11-20 11:02:51 UTC
I do not have NM installed. This explains the error, not sure why there is no RPM-dependency to NM if it is required though. It's not a big deal, but to have failed services after a normal update is just not so nice.

Comment 8 Eduardo Otubo 2020-11-20 11:07:33 UTC
(In reply to Joerg Lehmann from comment #7)
> I do not have NM installed. This explains the error, not sure why there is
> no RPM-dependency to NM if it is required though. It's not a big deal, but
> to have failed services after a normal update is just not so nice.

Agreed. I'll raise the priority on this one and will fix on the coming week.

Thanks for sharing the bug!

Comment 10 Giedrius Tuminauskas 2020-12-20 11:10:18 UTC
(In reply to Eduardo Otubo from comment #3)
> For the record, as we already agreed on IRC on that, this is a very specific
> corner case as RHEL is always shipped with NetworkManager. The chance of
> having a customer running into this problem if very unlikely. This won't be
> fixed for RHEL-7.9 but I'll add as a lower priority for RHEL-8.
> 
> Thanks for reporting that!

FYI: CentOS-7-x86_64-GenericCloud-yymm.qcow2 images have been shifted without NetworkManager.
There are hundreds of such VMs in the cloud infrastructure, and suddenly after upgrading from 7.x to 7.9, somebody decided to add dependency for NM, which was not present all the time. Does not sound fair

Comment 13 Jukka Nousiainen 2021-05-12 12:27:30 UTC
Also impacted by this issue.

Comment 30 errata-xmlrpc 2021-07-21 01:10:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (cloud-init bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:2810