question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] 'DebianOSBaseUtil' is not defined Kali Linux 2020.2

See original GitHub issue

Describe 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

  1. Section of the log where the error occurs.
  2. Serial console output
  3. 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:closed
  • Created 3 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
manishrana2016commented, Mar 17, 2021

@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 Enter

1reaction
jaarkcommented, Jul 25, 2020

Are 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

Read more comments on GitHub >

github_iconTop Results From Across the Web

'DebianOSBaseUtil' is not defined Kali Linux 2021.1
Hello, I have a kali 2021.1 image trying to prepare before uploading to Azure. The documentation on preparing the image is here:
Read more >
"E: Unable to locate package" Error in Kali Linux (Solved)
... Linux user get the Error as " Unable to locate package" so here is the solution of that error and the installation...
Read more >
How to Fix E : "Unable to Locate Package" Error in Kali Linux
How to Fix "E : Unable to Locate Package" Error in Kali Linux -2019?Note: Right click on the Desktop, and then Click on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found