[BUG] 'DebianOSBaseUtil' is not defined Kali Linux 2020.2
See original GitHub issueDescribe the bug: A clear and concise description of what the bug is. After Azure Marketplace install of Kali Linux. apt-get dist-upgrade or only upgrade of waagent receive the following stack trace when running waagent (-deprovision, -version, etc.): Traceback (most recent call last): File “/usr/sbin/waagent”, line 11, in <module> load_entry_point(‘WALinuxAgent==2.2.47’, ‘console_scripts’, ‘waagent’)() File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 490, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 2859, in load_entry_point return ep.load() File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 2450, in load return self.resolve() File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 2456, in resolve module = import(self.module_name, fromlist=[‘name’], level=0) File “/usr/lib/python3/dist-packages/azurelinuxagent/agent.py”, line 34, in <module> import azurelinuxagent.common.event as event File “/usr/lib/python3/dist-packages/azurelinuxagent/common/event.py”, line 632, in <module> event_logger = EventLogger() File “/usr/lib/python3/dist-packages/azurelinuxagent/common/event.py”, line 304, in init osutil = get_osutil() File “/usr/lib/python3/dist-packages/azurelinuxagent/common/osutil/factory.py”, line 50, in get_osutil return _get_osutil(distro_name, distro_code_name, distro_version, distro_full_name) File “/usr/lib/python3/dist-packages/azurelinuxagent/common/osutil/factory.py”, line 79, in _get_osutil return DebianOSBaseUtil() NameError: name ‘DebianOSBaseUtil’ is not defined
waagent version: 2
Note: Please add some context which would help us understand the problem better
- Section of the log where the error occurs.
- Serial console output
- Steps to reproduce the behavior. a) Install Kali from Marketplace (currently version 2019.2). b) upgrade distribution (2020.2) or only upgrade waagent (upgrades from 2.2.34 -> 2.2.47) c) check walinuxagent.service status and run waagent --version
Distro and WALinuxAgent details (please complete the following information):
-
Distro and Version: [e.g. Ubuntu 16.04] PRETTY_NAME=“Kali GNU/Linux Rolling” NAME=“Kali GNU/Linux” ID=kali VERSION=“2020.2” VERSION_ID=“2020.2” VERSION_CODENAME=“kali-rolling” ID_LIKE=debian ANSI_COLOR=“1;31” HOME_URL=“https://www.kali.org/” SUPPORT_URL=“https://forums.kali.org/” BUG_REPORT_URL=“https://bugs.kali.org/”
-
WALinuxAgent version [e.g. 2.2.40, you can copy the output of
waagent --version
, more info here ] 2.2.47
Additional context Add any other context about the problem here. python3 version: Python 3.8.3 systemctl status walinuxagent.service ● walinuxagent.service - Microsft Azure Linux Agent Loaded: loaded (/lib/systemd/system/walinuxagent.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Fri 2020-06-05 22:12:08 EDT; 28min ago Process: 690 ExecStart=/usr/sbin/waagent -daemon (code=exited, status=1/FAILURE) Main PID: 690 (code=exited, status=1/FAILURE)
Jun 05 22:12:08 <hostname> waagent[690]: event_logger = EventLogger() Jun 05 22:12:08 <hostname> waagent[690]: File “/usr/lib/python3/dist-packages/azurelinuxagent/common/event.py”, line 304, in init Jun 05 22:12:08 <hostname> waagent[690]: osutil = get_osutil() Jun 05 22:12:08 <hostname> waagent[690]: File “/usr/lib/python3/dist-packages/azurelinuxagent/common/osutil/factory.py”, line 50, in get_osutil Jun 05 22:12:08 <hostname> waagent[690]: return _get_osutil(distro_name, distro_code_name, distro_version, distro_full_name) Jun 05 22:12:08 <hostname> waagent[690]: File “/usr/lib/python3/dist-packages/azurelinuxagent/common/osutil/factory.py”, line 79, in _get_osutil Jun 05 22:12:08 <hostname> waagent[690]: return DebianOSBaseUtil() Jun 05 22:12:08 <hostname> waagent[690]: NameError: name ‘DebianOSBaseUtil’ is not defined Jun 05 22:12:08 <hostname> systemd[1]: walinuxagent.service: Main process exited, code=exited, status=1/FAILURE Jun 05 22:12:08 <hostname> systemd[1]: walinuxagent.service: Failed with result ‘exit-code’.
Log file attached If possible, please provide the full /var/log/waagent.log file to help us understand the problem better and get the context of the issue.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (2 by maintainers)
Top GitHub Comments
@richjjoh and @Javy26 Below are the steps: Step 1: sudo nano /usr/lib/python3/dist-packages/azurelinuxagent/common/osutil/factory.py Step 2: Find the line:
from .debian import DebianOSModernUtil
Step 3: Replace with:from .debian import DebianOSModernUtil,DebianOSBaseUtil
Step 4: CTRL+O and Enter Step 5: CTRL +X and EnterAre you using the version in the Kali apt repository?
I am seeing the same problem and it looks to be an issue with the Kali package. It is probably an old version of WALinux. The version of common/osutil/factory.py in Kali does not import DebianOSBaseUtil