Azure / Azure/WALinuxAgent

[BUG] deprovision cause exception on RHEL 9.0 Beta

Open
#2,593 14 comments 0 reactions 1 assignee Claimed by @nagworld9 View on GitHub
triaged
Dominant language
Python
Stars
581
Forks
397
Avg merge
2d 15h
Merged PRs (30d)
9

Description

Working on an image for RHEL9, when I try to deprovision I get an expection:

```
# cat /etc/redhat-release
Red Hat Enterprise Linux release 9.0 Beta (Plow)

# waagent --version
WALinuxAgent-2.3.0.2 running on rhel 9.0
Python: 3.9.6
Goal state agent: 2.3.0.2

# /usr/sbin/waagent -force -deprovision
WARNING! The waagent service will be stopped.
WARNING! All SSH host key pairs will be deleted.
WARNING! Cached DHCP leases will be deleted.
WARNING! root password will be disabled. You will not be able to login as root.
WARNING! /etc/resolv.conf will be deleted.
2022-05-19T09:18:42.791639Z INFO MainThread Examine /proc/net/route for primary interface
2022-05-19T09:18:42.796461Z INFO MainThread Primary interface is [eth0]
2022-05-19T09:18:42.804226Z ERROR MainThread Failed to run 'deprovision': Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/azurelinuxagent/agent.py", line 247, in main
agent.deprovision(force, deluser=False)
File "/usr/lib/python3.9/site-packages/azurelinuxagent/agent.py", line 153, in deprovision
deprovision_handler.run(force=force, deluser=deluser)
File "/usr/lib/python3.9/site-packages/azurelinuxagent/pa/deprovision/default.py", line 221, in run
self.do_actions(actions)
File "/usr/lib/python3.9/site-packages/azurelinuxagent/pa/deprovision/default.py", line 241, in do_actions
action.invoke()
File "/usr/lib/python3.9/site-packages/azurelinuxagent/pa/deprovision/default.py", line 57, in invoke
self.func(*self.args, **self.kwargs)
File "/usr/lib/python3.9/site-packages/azurelinuxagent/common/osutil/redhat.py", line 89, in set_dhcp_hostname
fileutil.update_conf_file(filepath,
File "/usr/lib/python3.9/site-packages/azurelinuxagent/common/utils/fileutil.py", line 162, in update_conf_file
conf = read_file(path).split('\n')
File "/usr/lib/python3.9/site-packages/azurelinuxagent/common/utils/fileutil.py", line 53, in read_file
with open(filepath, mode) as in_file:
FileNotFoundError: [Errno 2] No such file or directory: '/etc/sysconfig/network-scripts/ifcfg-eth0'
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.