package ubuntu-advantage-tools 27.0.2~18.04.1 - ModuleNotFoundError: No module named 'uaclient'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-advantage-tools (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Hirsute |
Fix Released
|
Undecided
|
Unassigned | ||
Impish |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Did a release upgrade to 20.04 LTS from 18
ProblemType: Package
DistroRelease: Ubuntu 18.04
Package: ubuntu-
ProcVersionSign
Uname: Linux 4.15.0-143-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.24
Architecture: amd64
Date: Sat May 29 07:05:08 2021
ErrorMessage: installed ubuntu-
InstallationDate: Installed on 2017-12-14 (1261 days ago)
InstallationMedia: Ubuntu-Server 16.04.3 LTS "Xenial Xerus" - Release amd64 (20170801)
Python3Details: /usr/local/
PythonDetails: /usr/local/
RelatedPackageV
dpkg 1.19.0.5ubuntu2.3
apt 1.6.13
SourcePackage: ubuntu-
Title: package ubuntu-
UpgradeStatus: Upgraded to bionic on 2021-05-29 (0 days ago)
Peter Helenefors (peterhel) wrote : | #1 |
- AptOrdering.txt Edit (460 bytes, text/plain; charset="utf-8")
- Dependencies.txt Edit (2.5 KiB, text/plain; charset="utf-8")
- Df.txt Edit (644 bytes, text/plain; charset="utf-8")
- Dmesg.txt Edit (42.9 KiB, text/plain; charset="utf-8")
- DpkgHistoryLog.txt Edit (49.3 KiB, text/plain; charset="utf-8")
- DpkgTerminalLog.txt Edit (1.1 KiB, text/plain; charset="utf-8")
- DuplicateSignature.txt Edit (399 bytes, text/plain; charset="utf-8")
- ProcCpuinfoMinimal.txt Edit (757 bytes, text/plain; charset="utf-8")
tags: | removed: need-duplicate-check |
Utkarsh Gupta (utkarsh) wrote : | #2 |
Changed in ubuntu-advantage-tools (Ubuntu): | |
status: | New → Incomplete |
Grant Orndorff (orndorffgrant) wrote : | #3 |
Hi I noticed something and thought to chime in.
It appears this may involve a non-standard python installation: Python 3.9 is not in the archives for Bionic of Focal AFAIK. And python3.9 is installed in /usr/local/bin which is not the normal installation location. It is the location that python is installed when building from source and running `make altinstall`.
I was able to reproduce this issue by building python3.9 from source on bionic and installing with `make altinstall`. By default it doesn't appear that /usr/lib/
So the quick fix is hopefully to just set PYTHONPATH=
PYTHONPATH=
and then try to `import uaclient` in the python shell.
There may be a way for us to handle this situation in the ubuntu-
Christian Ehrhardt (paelzer) wrote : | #4 |
Tanks Grant for spotting this!
Thereby I'll set this one to confirmed (while it isn't an issue of the PKG in the archive you said we might be able to help with it still).
We have three more bugs that might be the same, but their report didn't include the python3 details that made you spot it here. I've asked on those bugs to check and making them a dup of this one here if they indeed have custom python3 on the systems:
- bug 1927348
- bug 1927905
- bug 1934077
summary: |
- package ubuntu-advantage-tools 27.0.2~18.04.1 failed to install/upgrade: - installed ubuntu-advantage-tools package post-installation script - subprocess returned error exit status 1 + package ubuntu-advantage-tools 27.0.2~18.04.1 - ModuleNotFoundError: No + module named 'uaclient' |
Changed in ubuntu-advantage-tools (Ubuntu): | |
status: | Incomplete → Confirmed |
H Geerts (hgeerts) wrote : | #5 |
This bug can also be triggered if the user has a virtual python env active. The post install script uses the python version from the callers environment instead of the system version for which ubuntu-
# python -m venv test
# . test/bin/activate
(test) # apt install --force-
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/686 kB of archives.
After this operation, 0 B of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 130029 files and directories currently installed.)
Preparing to unpack .../ubuntu-
Unpacking ubuntu-
Setting up ubuntu-
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundE
dpkg: error processing package ubuntu-
installed ubuntu-
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Errors were encountered while processing:
ubuntu-
E: Sub-process /usr/bin/dpkg returned an error code (1)
Fagner (fagner128) wrote : | #7 |
Hello, I set PYTHONPATH=
I have installed Python2.7 Python3 and Python3.5
Grant Orndorff (orndorffgrant) wrote : | #8 |
Hello fagner128,
Before we debug farther I just want to make sure we have all the details: Exactly what command is failing?
And for example, if "apt upgrade" is failing, does the following work?
env PYTHONPATH=
If that doesn't work, please provide the output of the following commands:
which python3
python3 -c "import uaclient"
env PYTHONPATH=
ua version
apt policy ubuntu-
And hopefully we'll be able to figure it out :)
Also, we will be releasing a fix to this issue in the coming weeks (expect it in version 27.4 of ubuntu-
Fagner (fagner128) wrote : | #9 |
Hello Grant Orndorff,
This is happening when I try to upgrade with apt upgrade
I already reported in another post but was doubled and I posted here, I reported on this:
https:/
I tried to run command: env PYTHONPATH=
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "/usr/lib/
from typing import Dict, List, Type, cast # noqa: F401
ImportError: cannot import name 'Type'
dpkg: error processing ubuntu-
sub-process script post-installation installed returned error output status 1
Errors were found during the processing of:
ubuntu-
E: Sub-process/
I tried to update again but the error persisted as:
Enable UA Infra: ESM to receive additional future security updates.
See https:/
0 updated packages, 0 new packages installed, 0 to be removed and 0 not updated.
1 packages not fully installed or removed.
After this operation, additional 0B of disk space will be used.
Do you want to continue? [Y / n] y
Configuring ubuntu-
TraceBack (most recent call last):
File "<string>", line 2, in <module>
ImportError: No module named 'uaclient'
dpkg: error processing ubuntu-
sub-process script post-installation installed returned error output status 1
Errors were found during the processing of:
ubuntu-
E: Sub-process/
So I run the commands that resulted in the following exits:
which python3
/usr/local/
python3 -c "import uaclient"
nothing
env PYTHONPATH=
nothing
ua version
27.3 ~ 16.04.2
apt policy ubuntu-
ubuntu-
Installed: 27.3 ~ 16.04.2
Candidate: 27.3 ~ 16.04.2
Version table:
*** 27.3 ~ 16.04.2 500
500 http://
100 /var/lib/
27.3 ~ 16.04.1 500
500 http://
Well I hope this problem can be solved, I'm looking forward to it.
Grant Orndorff (orndorffgrant) wrote : | #10 |
Thank you for the additional information fagner128!
The error you posted here is actually slightly different in the details. The python error is "ImportError: cannot import name 'Type'".
And it looks like you have a non standard python install in /usr/local/
My guess is that the specific version installed at /usr/local/
This should be fixed when ubuntu-
In the mean time try the following:
env PATH=/usr/bin:$PATH apt upgrade
Hopefully that will cause the ubuntu-
Launchpad Janitor (janitor) wrote : | #11 |
This bug was fixed in the package ubuntu-
---------------
ubuntu-
* d/rules:
- Remove conftest file from the package
* d/tools.postinst:
- hardcode python binary to run python scripts (LP: #1930121)
- undo unnecessary log file creation
* d/tools.prerm:
- hardcode python binary to run python scripts (LP: #1930121)
* New upstream release 27.4 (LP: #1949634)
- cc-eal: remove beta flag
- cli:
+ attach will save machine-id during operation
+ detach won't ask unnecessary questions
+ new security-status subcommand lists potentially available
security and ESM updates (beta)
- fix:
+ exit 0 when fix is successfully applied and completed
+ exit 1 when fix cannot be applied
+ exit 2 when fix requires a reboot to complete
+ check reboot-
- livepatch: allow livepatch and fips-updates at the same time
- metering:
+ update how activity info is parsed
+ update contract response structure
+ enable job by default
- proxy: no_proxy defaults for link-local IMDS routes
- util:
+ cache get_platform_info calls
+ fix machine-id fallback path on get_machine_id
-- Lucas Moura <email address hidden> Fri, 29 Oct 2021 15:35:57 -0300
Changed in ubuntu-advantage-tools (Ubuntu): | |
status: | Confirmed → Fix Released |
Robie Basak (racb) wrote : Please test proposed package | #12 |
Hello Peter, or anyone else affected,
Accepted ubuntu-
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-
Further information regarding the verification process can be found at https:/
N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.
Changed in ubuntu-advantage-tools (Ubuntu Impish): | |
status: | New → Fix Committed |
tags: | added: verification-needed verification-needed-impish |
Changed in ubuntu-advantage-tools (Ubuntu Hirsute): | |
status: | New → Fix Committed |
tags: | added: verification-needed-hirsute |
Robie Basak (racb) wrote : | #13 |
Hello Peter, or anyone else affected,
Accepted ubuntu-
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-
Further information regarding the verification process can be found at https:/
N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.
Changed in ubuntu-advantage-tools (Ubuntu Focal): | |
status: | New → Fix Committed |
tags: | added: verification-needed-focal |
Robie Basak (racb) wrote : | #14 |
Hello Peter, or anyone else affected,
Accepted ubuntu-
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-
Further information regarding the verification process can be found at https:/
N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.
Changed in ubuntu-advantage-tools (Ubuntu Bionic): | |
status: | New → Fix Committed |
tags: | added: verification-needed-bionic |
Robie Basak (racb) wrote : | #15 |
Hello Peter, or anyone else affected,
Accepted ubuntu-
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-
Further information regarding the verification process can be found at https:/
N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.
Robie Basak (racb) wrote : | #16 |
Hello Peter, or anyone else affected,
Accepted ubuntu-
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-
Further information regarding the verification process can be found at https:/
N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.
Changed in ubuntu-advantage-tools (Ubuntu Xenial): | |
status: | New → Fix Committed |
tags: | added: verification-needed-xenial |
Robie Basak (racb) wrote : | #17 |
Hello Peter, or anyone else affected,
Accepted ubuntu-
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-
Further information regarding the verification process can be found at https:/
N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.
Robie Basak (racb) wrote : | #18 |
Hello Peter, or anyone else affected,
Accepted ubuntu-
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-
Further information regarding the verification process can be found at https:/
N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.
Robie Basak (racb) wrote : | #19 |
Hello Peter, or anyone else affected,
Accepted ubuntu-
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-
Further information regarding the verification process can be found at https:/
N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.
Robie Basak (racb) wrote : | #20 |
Hello Peter, or anyone else affected,
Accepted ubuntu-
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-
Further information regarding the verification process can be found at https:/
N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.
Robie Basak (racb) wrote : | #21 |
Hello Peter, or anyone else affected,
Accepted ubuntu-
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-
Further information regarding the verification process can be found at https:/
N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.
Grant Orndorff (orndorffgrant) wrote : | #22 |
- 1930121-ua27.4.1-verification.tar.xz Edit (1.1 KiB, application/x-tar)
I've tested that ubuntu-
I'm attaching the test script I used and the output for each release here.
Tagging verification-done
tags: |
added: verification-done verification-done-bionic verification-done-focal verification-done-hirsute verification-done-impish verification-done-xenial removed: verification-needed verification-needed-bionic verification-needed-focal verification-needed-hirsute verification-needed-impish verification-needed-xenial |
Robie Basak (racb) wrote : Update Released | #23 |
The verification of the Stable Release Update for ubuntu-
Launchpad Janitor (janitor) wrote : | #24 |
This bug was fixed in the package ubuntu-
---------------
ubuntu-
* Backport new upstream release: (LP: #1949634) to hirsute
ubuntu-
* jobs: do not run the status job for unattached users
ubuntu-
* d/rules:
- Remove conftest file from the package
* d/tools.postinst:
- hardcode python binary to run python scripts (LP: #1930121)
- undo unnecessary log file creation
* d/tools.prerm:
- hardcode python binary to run python scripts (LP: #1930121)
* New upstream release 27.4 (LP: #1949634)
- cc-eal: remove beta flag
- cli:
+ attach will save machine-id during operation
+ detach won't ask unnecessary questions
+ new security-status subcommand lists potentially available
security and ESM updates (beta)
- fix:
+ exit 0 when fix is successfully applied and completed
+ exit 1 when fix cannot be applied
+ exit 2 when fix requires a reboot to complete
+ check reboot-
- livepatch: allow livepatch and fips-updates at the same time
- metering:
+ update how activity info is parsed
+ update contract response structure
+ enable job by default
- proxy: no_proxy defaults for link-local IMDS routes
- util:
+ cache get_platform_info calls
+ fix machine-id fallback path on get_machine_id
-- Lucas Moura <email address hidden> Thu, 11 Nov 2021 17:58:12 -0300
Changed in ubuntu-advantage-tools (Ubuntu Hirsute): | |
status: | Fix Committed → Fix Released |
Launchpad Janitor (janitor) wrote : | #25 |
This bug was fixed in the package ubuntu-
---------------
ubuntu-
* Backport new upstream release: (LP: #1949634) to focal
ubuntu-
* jobs: do not run the status job for unattached users
ubuntu-
* d/rules:
- Remove conftest file from the package
* d/tools.postinst:
- hardcode python binary to run python scripts (LP: #1930121)
- undo unnecessary log file creation
* d/tools.prerm:
- hardcode python binary to run python scripts (LP: #1930121)
* New upstream release 27.4 (LP: #1949634)
- cc-eal: remove beta flag
- cli:
+ attach will save machine-id during operation
+ detach won't ask unnecessary questions
+ new security-status subcommand lists potentially available
security and ESM updates (beta)
- fix:
+ exit 0 when fix is successfully applied and completed
+ exit 1 when fix cannot be applied
+ exit 2 when fix requires a reboot to complete
+ check reboot-
- livepatch: allow livepatch and fips-updates at the same time
- metering:
+ update how activity info is parsed
+ update contract response structure
+ enable job by default
- proxy: no_proxy defaults for link-local IMDS routes
- util:
+ cache get_platform_info calls
+ fix machine-id fallback path on get_machine_id
-- Lucas Moura <email address hidden> Thu, 11 Nov 2021 17:57:22 -0300
Changed in ubuntu-advantage-tools (Ubuntu Focal): | |
status: | Fix Committed → Fix Released |
Launchpad Janitor (janitor) wrote : | #26 |
This bug was fixed in the package ubuntu-
---------------
ubuntu-
* Backport new upstream release: (LP: #1949634) to bionic
ubuntu-
* jobs: do not run the status job for unattached users
ubuntu-
* d/rules:
- Remove conftest file from the package
* d/tools.postinst:
- hardcode python binary to run python scripts (LP: #1930121)
- undo unnecessary log file creation
* d/tools.prerm:
- hardcode python binary to run python scripts (LP: #1930121)
* New upstream release 27.4 (LP: #1949634)
- cc-eal: remove beta flag
- cli:
+ attach will save machine-id during operation
+ detach won't ask unnecessary questions
+ new security-status subcommand lists potentially available
security and ESM updates (beta)
- fix:
+ exit 0 when fix is successfully applied and completed
+ exit 1 when fix cannot be applied
+ exit 2 when fix requires a reboot to complete
+ check reboot-
- livepatch: allow livepatch and fips-updates at the same time
- metering:
+ update how activity info is parsed
+ update contract response structure
+ enable job by default
- proxy: no_proxy defaults for link-local IMDS routes
- util:
+ cache get_platform_info calls
+ fix machine-id fallback path on get_machine_id
-- Lucas Moura <email address hidden> Thu, 11 Nov 2021 17:56:08 -0300
Changed in ubuntu-advantage-tools (Ubuntu Bionic): | |
status: | Fix Committed → Fix Released |
Launchpad Janitor (janitor) wrote : | #27 |
This bug was fixed in the package ubuntu-
---------------
ubuntu-
* Backport new upstream release: (LP: #1949634) to xenial
ubuntu-
* jobs: do not run the status job for unattached users
ubuntu-
* d/rules:
- Remove conftest file from the package
* d/tools.postinst:
- hardcode python binary to run python scripts (LP: #1930121)
- undo unnecessary log file creation
* d/tools.prerm:
- hardcode python binary to run python scripts (LP: #1930121)
* New upstream release 27.4 (LP: #1949634)
- cc-eal: remove beta flag
- cli:
+ attach will save machine-id during operation
+ detach won't ask unnecessary questions
+ new security-status subcommand lists potentially available
security and ESM updates (beta)
- fix:
+ exit 0 when fix is successfully applied and completed
+ exit 1 when fix cannot be applied
+ exit 2 when fix requires a reboot to complete
+ check reboot-
- livepatch: allow livepatch and fips-updates at the same time
- metering:
+ update how activity info is parsed
+ update contract response structure
+ enable job by default
- proxy: no_proxy defaults for link-local IMDS routes
- util:
+ cache get_platform_info calls
+ fix machine-id fallback path on get_machine_id
-- Lucas Moura <email address hidden> Thu, 11 Nov 2021 17:55:08 -0300
Changed in ubuntu-advantage-tools (Ubuntu Xenial): | |
status: | Fix Committed → Fix Released |
Launchpad Janitor (janitor) wrote : | #28 |
This bug was fixed in the package ubuntu-
---------------
ubuntu-
* Backport new upstream release: (LP: #1949634) to impish
ubuntu-
* jobs: do not run the status job for unattached users
ubuntu-
* d/rules:
- Remove conftest file from the package
* d/tools.postinst:
- hardcode python binary to run python scripts (LP: #1930121)
- undo unnecessary log file creation
* d/tools.prerm:
- hardcode python binary to run python scripts (LP: #1930121)
* New upstream release 27.4 (LP: #1949634)
- cc-eal: remove beta flag
- cli:
+ attach will save machine-id during operation
+ detach won't ask unnecessary questions
+ new security-status subcommand lists potentially available
security and ESM updates (beta)
- fix:
+ exit 0 when fix is successfully applied and completed
+ exit 1 when fix cannot be applied
+ exit 2 when fix requires a reboot to complete
+ check reboot-
- livepatch: allow livepatch and fips-updates at the same time
- metering:
+ update how activity info is parsed
+ update contract response structure
+ enable job by default
- proxy: no_proxy defaults for link-local IMDS routes
- util:
+ cache get_platform_info calls
+ fix machine-id fallback path on get_machine_id
-- Lucas Moura <email address hidden> Thu, 11 Nov 2021 17:59:42 -0300
Changed in ubuntu-advantage-tools (Ubuntu Impish): | |
status: | Fix Committed → Fix Released |
Hello,
Thanks for taking the time to file the bug and help make Ubuntu server better.
From your logs: advantage- tools (27.0.2~18.04.1) ... rror: No module named 'uaclient'
> Setting up ubuntu-
> Traceback (most recent call last):
> File "<string>", line 2, in <module>
> ModuleNotFoundE
Unfortunately, I can't seem to reproduce this in a fresh Bionic container. I can even "import uaclient" and it all seems OK. I wonder if it's due to a local issue or something. Also, interestingly, you say you did a release upgrade to 20.04? But the package version shows Bionic. I am not sure how's that? Did you set anything up manually, et al?
Can you reproduce this in a container or a VM as well? Let me know if you do and please also post the steps to reproduce. Thanks!