Traceback (most recent call last):
File "/usr/sbin/waagent", line 31, in
import azurelinuxagent.agent as agent
ImportError: No module named 'azurelinuxagent'
service walinuxagent status
● walinuxagent.service - Azure Linux Agent
Loaded: loaded (/lib/systemd/system/walinuxagent.service; enabled; vendor pre
Active: active (running) since Mon 2019-03-25 08:17:56 UTC; 1 weeks 0 days ag
Main PID: 10691 (python3)
Tasks: 2 (limit: 4915)
CGroup: /system.slice/walinuxagent.service
└─10691 /usr/bin/python3 -u /usr/sbin/waagent -daemon
if name == 'main' :
import azurelinuxagent.agent as agent
"""
Invoke main method of agent
"""
agent.main()
if name == 'waagent':
"""
Load waagent2.0 to support old version of extensions
"""
if sys.version_info[0] == 3:
raise ImportError("waagent2.0 doesn't support python3")
bin_path = os.path.dirname(os.path.abspath(file))
agent20_path = os.path.join(bin_path, "waagent2.0")
if not os.path.isfile(agent20_path):
raise ImportError("Can't load waagent")
agent20 = imp.load_source('waagent', agent20_path)
all = dir(agent20)
root@NeuralClassifier:~# dpkg -l walinuxagent*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-====================================-=======================-=======================-=============================================================================
ii walinuxagent 2.2.32-0ubuntu1~18.04.2 amd64 Windows Azure Linux Agent
root@NeuralClassifier:~# lsof -p 30439
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
python3 30439 root cwd DIR 8,1 4096 2 /
python3 30439 root rtd DIR 8,1 4096 2 /
python3 30439 root txt REG 8,1 4522328 4236 /usr/bin/python3.6
python3 30439 root mem REG 8,1 39208 2082 /lib/x86_64-linux-gnu/libcrypt-2.27.so
python3 30439 root mem REG 8,1 6664 7160 /usr/lib/python3.6/lib-dynload/_crypt.cpython-36m-x86_64-linux-gnu.so
python3 30439 root mem REG 8,1 153984 2097 /lib/x86_64-linux-gnu/liblzma.so.5.2.2
python3 30439 root mem REG 8,1 33592 7170 /usr/lib/python3.6/lib-dynload/_lzma.cpython-36m-x86_64-linux-gnu.so
python3 30439 root mem REG 8,1 66800 2178 /lib/x86_64-linux-gnu/libbz2.so.1.0.4
python3 30439 root mem REG 8,1 22040 7153 /usr/lib/python3.6/lib-dynload/_bz2.cpython-36m-x86_64-linux-gnu.so
python3 30439 root mem REG 8,1 74664 7168 /usr/lib/python3.6/lib-dynload/_json.cpython-36m-x86_64-linux-gnu.so
python3 30439 root mem REG 8,1 433760 3631 /usr/lib/x86_64-linux-gnu/libssl.so.1.1
python3 30439 root mem REG 8,1 120184 7151 /usr/lib/python3.6/lib-dynload/_ssl.cpython-36m-x86_64-linux-gnu.so
python3 30439 root mem REG 8,1 2575848 3630 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
python3 30439 root mem REG 8,1 29752 7149 /usr/lib/python3.6/lib-dynload/_hashlib.cpython-36m-x86_64-linux-gnu.so
python3 30439 root mem REG 8,1 47568 2090 /lib/x86_64-linux-gnu/libnss_files-2.27.so
python3 30439 root mem REG 8,1 97176 2087 /lib/x86_64-linux-gnu/libnsl-2.27.so
python3 30439 root mem REG 8,1 47576 2092 /lib/x86_64-linux-gnu/libnss_nis-2.27.so
python3 30439 root mem REG 8,1 39744 2088 /lib/x86_64-linux-gnu/libnss_compat-2.27.so
python3 30439 root mem REG 8,1 1516558 7808 /usr/lib/locale/C.UTF-8/LC_COLLATE
python3 30439 root mem REG 8,1 1700792 2084 /lib/x86_64-linux-gnu/libm-2.27.so
python3 30439 root mem REG 8,1 116960 2188 /lib/x86_64-linux-gnu/libz.so.1.2.11
python3 30439 root mem REG 8,1 202880 2060 /lib/x86_64-linux-gnu/libexpat.so.1.6.7
python3 30439 root mem REG 8,1 10592 2187 /lib/x86_64-linux-gnu/libutil-2.27.so
python3 30439 root mem REG 8,1 14560 2083 /lib/x86_64-linux-gnu/libdl-2.27.so
python3 30439 root mem REG 8,1 144976 2183 /lib/x86_64-linux-gnu/libpthread-2.27.so
python3 30439 root mem REG 8,1 2030544 2080 /lib/x86_64-linux-gnu/libc-2.27.so
python3 30439 root mem REG 8,1 170960 2076 /lib/x86_64-linux-gnu/ld-2.27.so
python3 30439 root mem REG 8,1 199772 7809 /usr/lib/locale/C.UTF-8/LC_CTYPE
python3 30439 root mem REG 8,1 50 7814 /usr/lib/locale/C.UTF-8/LC_NUMERIC
python3 30439 root mem REG 8,1 3360 7817 /usr/lib/locale/C.UTF-8/LC_TIME
python3 30439 root mem REG 8,1 270 7812 /usr/lib/locale/C.UTF-8/LC_MONETARY
python3 30439 root mem REG 8,1 48 7806 /usr/lib/locale/C.UTF-8/LC_MESSAGES/SYS_LC_MESSAGES
python3 30439 root mem REG 8,1 34 7815 /usr/lib/locale/C.UTF-8/LC_PAPER
python3 30439 root mem REG 8,1 62 7813 /usr/lib/locale/C.UTF-8/LC_NAME
python3 30439 root mem REG 8,1 131 7807 /usr/lib/locale/C.UTF-8/LC_ADDRESS
python3 30439 root mem REG 8,1 47 7816 /usr/lib/locale/C.UTF-8/LC_TELEPHONE
python3 30439 root mem REG 8,1 23 7811 /usr/lib/locale/C.UTF-8/LC_MEASUREMENT
python3 30439 root mem REG 8,1 1683056 7803 /usr/lib/locale/locale-archive
python3 30439 root mem REG 8,1 26376 5022 /usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache
python3 30439 root mem REG 8,1 252 7810 /usr/lib/locale/C.UTF-8/LC_IDENTIFICATION
python3 30439 root 0r CHR 1,3 0t0 6 /dev/null
python3 30439 root 1u unix 0xffff8e2d33ef3400 0t0 21576016 type=STREAM
python3 30439 root 2u unix 0xffff8e2d33ef3400 0t0 21576016 type=STREAM
root@NeuralClassifier:~#
we have tried reinstalling the package cleanly but still we are getting the same error.
the directory exists
/usr/lib/python3/dist-packages/azurelinuxagent
and the files are also there as well
but still we are getting the same error.
Hello All, we have customer using ubuntu18.04 VM and he is facing issues with starting walinuxagent service and viewing waagent version PFB outputs
cat /etc/*release
DISTRIB_ID=Ubuntu DISTRIB_RELEASE=18.04 DISTRIB_CODENAME=bionic DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS" NAME="Ubuntu" VERSION="18.04.1 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 18.04.1 LTS" VERSION_ID="18.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic
uname –r
4.18.0-1011-azure
waagent –version
Traceback (most recent call last): File "/usr/sbin/waagent", line 31, in
import azurelinuxagent.agent as agent
ImportError: No module named 'azurelinuxagent'
service walinuxagent status ● walinuxagent.service - Azure Linux Agent Loaded: loaded (/lib/systemd/system/walinuxagent.service; enabled; vendor pre Active: active (running) since Mon 2019-03-25 08:17:56 UTC; 1 weeks 0 days ag Main PID: 10691 (python3) Tasks: 2 (limit: 4915) CGroup: /system.slice/walinuxagent.service └─10691 /usr/bin/python3 -u /usr/sbin/waagent -daemon
Apr 01 09:29:14 NeuralClassifier python3[10691]: 2019/04/01 09:29:14.688508 WARN Apr 01 09:29:14 NeuralClassifier python3[10691]: 2019/04/01 09:29:14.690874 ERRO Apr 01 09:29:14 NeuralClassifier python3[10691]: 2019/04/01 09:29:14.692655 WARN Apr 01 09:29:14 NeuralClassifier python3[10691]: 2019/04/01 09:29:14.693416 WARN Apr 01 09:29:14 NeuralClassifier python3[10691]: 2019/04/01 09:29:14.695341 WARN Apr 01 09:29:14 NeuralClassifier python3[10691]: 2019/04/01 09:29:14.695693 INFO Apr 01 09:29:14 NeuralClassifier python3[10691]: Traceback (most recent call las Apr 01 09:29:14 NeuralClassifier python3[10691]: File "/usr/sbin/waagent", lin Apr 01 09:29:14 NeuralClassifier python3[10691]: import azurelinuxagent.agen Apr 01 09:29:14 NeuralClassifier python3[10691]: ImportError: No module named 'a lines 1-18/18 (END)...skipping... ● walinuxagent.service - Azure Linux Agent Loaded: loaded (/lib/systemd/system/walinuxagent.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2019-03-25 08:17:56 UTC; 1 weeks 0 days ago Main PID: 10691 (python3) Tasks: 2 (limit: 4915) CGroup: /system.slice/walinuxagent.service └─10691 /usr/bin/python3 -u /usr/sbin/waagent -daemon
Apr 01 09:29:14 NeuralClassifier python3[10691]: 2019/04/01 09:29:14.688508 WARNING Daemon Agent WALinuxAgent-2.2.32.2 launched with command 'python3 -u /usr/sbin/waage Apr 01 09:29:14 NeuralClassifier python3[10691]: 2019/04/01 09:29:14.690874 ERROR Daemon Event: name=WALinuxAgent, op=Enable, message=eJw1zLEOgzAMRdFf8cYUImDrlr17Z0PcJl Apr 01 09:29:14 NeuralClassifier python3[10691]: 2019/04/01 09:29:14.692655 WARNING Daemon Too many files under: /var/lib/waagent/events, removing oldest Apr 01 09:29:14 NeuralClassifier python3[10691]: 2019/04/01 09:29:14.693416 WARNING Daemon Agent WALinuxAgent-2.2.32.2 launched with command 'python3 -u /usr/sbin/waage Apr 01 09:29:14 NeuralClassifier python3[10691]: 2019/04/01 09:29:14.695341 WARNING Daemon Exception occurred loading available agents: Expecting value: line 1 column 1 Apr 01 09:29:14 NeuralClassifier python3[10691]: 2019/04/01 09:29:14.695693 INFO Daemon Installed Agent WALinuxAgent-2.2.32.2 is the most current agent Apr 01 09:29:14 NeuralClassifier python3[10691]: Traceback (most recent call last): Apr 01 09:29:14 NeuralClassifier python3[10691]: File "/usr/sbin/waagent", line 31, in
Apr 01 09:29:14 NeuralClassifier python3[10691]: import azurelinuxagent.agent as agent
Apr 01 09:29:14 NeuralClassifier python3[10691]: ImportError: No module named 'azurelinuxagent'
which python
/usr/bin/python
python –version
Python 2.7.15rc1
ls -lh /usr/bin/python*
lrwxrwxrwx 1 root root 9 Apr 16 2018 /usr/bin/python -> python2.7 lrwxrwxrwx 1 root root 16 Apr 16 2018 /usr/bin/python-config -> python2.7-config lrwxrwxrwx 1 root root 9 Apr 16 2018 /usr/bin/python2 -> python2.7 lrwxrwxrwx 1 root root 16 Apr 16 2018 /usr/bin/python2-config -> python2.7-config -rwxr-xr-x 1 root root 3.6M Nov 12 14:31 /usr/bin/python2.7 lrwxrwxrwx 1 root root 33 Nov 12 14:31 /usr/bin/python2.7-config -> x86_64-linux-gnu-python2.7-config lrwxrwxrwx 1 root root 9 Oct 25 11:11 /usr/bin/python3 -> python3.6 -rwxr-xr-x 1 root root 1018 Oct 28 2017 /usr/bin/python3-jsondiff -rwxr-xr-x 1 root root 3.6K Oct 28 2017 /usr/bin/python3-jsonpatch -rwxr-xr-x 1 root root 1.4K May 1 2016 /usr/bin/python3-jsonpointer -rwxr-xr-x 1 root root 398 Nov 15 2017 /usr/bin/python3-jsonschema -rwxr-xr-x 2 root root 4.4M Oct 22 11:32 /usr/bin/python3.6 -rwxr-xr-x 2 root root 4.4M Oct 22 11:32 /usr/bin/python3.6m lrwxrwxrwx 1 root root 10 Oct 25 11:11 /usr/bin/python3m -> python3.6m
which waagent
/usr/sbin/waagent
cat
! /usr/bin/env python3
#
Azure Linux Agent
#
Copyright 2015 Microsoft Corporation
#
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
#
http://www.apache.org/licenses/LICENSE-2.0
#
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#
Requires Python 2.6 and Openssl 1.0+
#
Implements parts of RFC 2131, 1541, 1497 and
http://msdn.microsoft.com/en-us/library/cc227282%28PROT.10%29.aspx
http://msdn.microsoft.com/en-us/library/cc227259%28PROT.13%29.aspx
#
import os import imp import sys
if name == 'main' : import azurelinuxagent.agent as agent """ Invoke main method of agent """ agent.main()
if name == 'waagent': """ Load waagent2.0 to support old version of extensions """ if sys.version_info[0] == 3: raise ImportError("waagent2.0 doesn't support python3") bin_path = os.path.dirname(os.path.abspath(file)) agent20_path = os.path.join(bin_path, "waagent2.0") if not os.path.isfile(agent20_path): raise ImportError("Can't load waagent") agent20 = imp.load_source('waagent', agent20_path) all = dir(agent20)
root@NeuralClassifier:~# dpkg -l walinuxagent* Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-====================================-=======================-=======================-============================================================================= ii walinuxagent 2.2.32-0ubuntu1~18.04.2 amd64 Windows Azure Linux Agent root@NeuralClassifier:~# lsof -p 30439 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME python3 30439 root cwd DIR 8,1 4096 2 / python3 30439 root rtd DIR 8,1 4096 2 / python3 30439 root txt REG 8,1 4522328 4236 /usr/bin/python3.6 python3 30439 root mem REG 8,1 39208 2082 /lib/x86_64-linux-gnu/libcrypt-2.27.so python3 30439 root mem REG 8,1 6664 7160 /usr/lib/python3.6/lib-dynload/_crypt.cpython-36m-x86_64-linux-gnu.so python3 30439 root mem REG 8,1 153984 2097 /lib/x86_64-linux-gnu/liblzma.so.5.2.2 python3 30439 root mem REG 8,1 33592 7170 /usr/lib/python3.6/lib-dynload/_lzma.cpython-36m-x86_64-linux-gnu.so python3 30439 root mem REG 8,1 66800 2178 /lib/x86_64-linux-gnu/libbz2.so.1.0.4 python3 30439 root mem REG 8,1 22040 7153 /usr/lib/python3.6/lib-dynload/_bz2.cpython-36m-x86_64-linux-gnu.so python3 30439 root mem REG 8,1 74664 7168 /usr/lib/python3.6/lib-dynload/_json.cpython-36m-x86_64-linux-gnu.so python3 30439 root mem REG 8,1 433760 3631 /usr/lib/x86_64-linux-gnu/libssl.so.1.1 python3 30439 root mem REG 8,1 120184 7151 /usr/lib/python3.6/lib-dynload/_ssl.cpython-36m-x86_64-linux-gnu.so python3 30439 root mem REG 8,1 2575848 3630 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 python3 30439 root mem REG 8,1 29752 7149 /usr/lib/python3.6/lib-dynload/_hashlib.cpython-36m-x86_64-linux-gnu.so python3 30439 root mem REG 8,1 47568 2090 /lib/x86_64-linux-gnu/libnss_files-2.27.so python3 30439 root mem REG 8,1 97176 2087 /lib/x86_64-linux-gnu/libnsl-2.27.so python3 30439 root mem REG 8,1 47576 2092 /lib/x86_64-linux-gnu/libnss_nis-2.27.so python3 30439 root mem REG 8,1 39744 2088 /lib/x86_64-linux-gnu/libnss_compat-2.27.so python3 30439 root mem REG 8,1 1516558 7808 /usr/lib/locale/C.UTF-8/LC_COLLATE python3 30439 root mem REG 8,1 1700792 2084 /lib/x86_64-linux-gnu/libm-2.27.so python3 30439 root mem REG 8,1 116960 2188 /lib/x86_64-linux-gnu/libz.so.1.2.11 python3 30439 root mem REG 8,1 202880 2060 /lib/x86_64-linux-gnu/libexpat.so.1.6.7 python3 30439 root mem REG 8,1 10592 2187 /lib/x86_64-linux-gnu/libutil-2.27.so python3 30439 root mem REG 8,1 14560 2083 /lib/x86_64-linux-gnu/libdl-2.27.so python3 30439 root mem REG 8,1 144976 2183 /lib/x86_64-linux-gnu/libpthread-2.27.so python3 30439 root mem REG 8,1 2030544 2080 /lib/x86_64-linux-gnu/libc-2.27.so python3 30439 root mem REG 8,1 170960 2076 /lib/x86_64-linux-gnu/ld-2.27.so python3 30439 root mem REG 8,1 199772 7809 /usr/lib/locale/C.UTF-8/LC_CTYPE python3 30439 root mem REG 8,1 50 7814 /usr/lib/locale/C.UTF-8/LC_NUMERIC python3 30439 root mem REG 8,1 3360 7817 /usr/lib/locale/C.UTF-8/LC_TIME python3 30439 root mem REG 8,1 270 7812 /usr/lib/locale/C.UTF-8/LC_MONETARY python3 30439 root mem REG 8,1 48 7806 /usr/lib/locale/C.UTF-8/LC_MESSAGES/SYS_LC_MESSAGES python3 30439 root mem REG 8,1 34 7815 /usr/lib/locale/C.UTF-8/LC_PAPER python3 30439 root mem REG 8,1 62 7813 /usr/lib/locale/C.UTF-8/LC_NAME python3 30439 root mem REG 8,1 131 7807 /usr/lib/locale/C.UTF-8/LC_ADDRESS python3 30439 root mem REG 8,1 47 7816 /usr/lib/locale/C.UTF-8/LC_TELEPHONE python3 30439 root mem REG 8,1 23 7811 /usr/lib/locale/C.UTF-8/LC_MEASUREMENT python3 30439 root mem REG 8,1 1683056 7803 /usr/lib/locale/locale-archive python3 30439 root mem REG 8,1 26376 5022 /usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache python3 30439 root mem REG 8,1 252 7810 /usr/lib/locale/C.UTF-8/LC_IDENTIFICATION python3 30439 root 0r CHR 1,3 0t0 6 /dev/null python3 30439 root 1u unix 0xffff8e2d33ef3400 0t0 21576016 type=STREAM python3 30439 root 2u unix 0xffff8e2d33ef3400 0t0 21576016 type=STREAM root@NeuralClassifier:~#
we have tried reinstalling the package cleanly but still we are getting the same error. the directory exists /usr/lib/python3/dist-packages/azurelinuxagent and the files are also there as well but still we are getting the same error.
As per the cx it was working fine till 13Th March
Let us know how we can overcome this issue