/usr/bin/unattended-upgrade:FileNotFoundError:/usr/bin/unattended-upgrade@1468:main:get_dpkg_log_content
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
unattended-upgrades (Ubuntu) |
Fix Released
|
Undecided
|
Brian Murray | ||
Xenial |
Fix Released
|
Undecided
|
Brian Murray | ||
Yakkety |
Fix Released
|
Undecided
|
Brian Murray | ||
Zesty |
Fix Released
|
Undecided
|
Brian Murray |
Bug Description
Test Case
---------
1) edit /etc/apt/
2) sudo apt-get update
3) sudo /usr/bin/
4) sudo /usr/bin/
5) sudo rm /var/log/
6) sudo /usr/bin/
Observe the following crash:
Traceback (most recent call last):
File "/usr/bin/
main(options)
File "/usr/bin/
log_content = get_dpkg_
File "/usr/bin/
with io.open(
FileNotFoundError: [Errno 2] No such file or directory: '/var/log/
With the version of the package from -proposed you won't receive the crash in step 6 and /var/log/
Regression Potential
-------
This patch just ends up creating a file if it does not exist. Potential regressions would be a result of the patch being typo'ed e.g. typo'ing os.path.exits instead of os.path.exists and the code failing when a logfile does exist. So read the patch carefully!
Original Description
-------
The Ubuntu Error Tracker has been receiving reports about a problem regarding unattended-
Changed in unattended-upgrades (Ubuntu Xenial): | |
status: | New → In Progress |
assignee: | nobody → Brian Murray (brian-murray) |
Changed in unattended-upgrades (Ubuntu Yakkety): | |
assignee: | nobody → Brian Murray (brian-murray) |
Changed in unattended-upgrades (Ubuntu Zesty): | |
assignee: | nobody → Brian Murray (brian-murray) |
Changed in unattended-upgrades (Ubuntu Yakkety): | |
status: | New → In Progress |
Changed in unattended-upgrades (Ubuntu Zesty): | |
status: | New → In Progress |
description: | updated |
description: | updated |
description: | updated |
I was able to recreate this by performing the following:
bdmurray@ clean-xenial- amd64:~ $ sudo rm /var/log/ unattended- upgrades/ unattended- upgrades- dpkg.log unattended- upgrades/ unattended- upgrades- dpkg.log' : No such file or directory clean-xenial- amd64:~ $ sudo /usr/bin/ unattended- upgrade unattended- upgrade" , line 1468, in <module> unattended- upgrade" , line 1406, in main log_content( logfile_ dpkg, install_start_time) unattended- upgrade" , line 1075, in get_dpkg_ log_content logfile_ dpkg, encoding='utf-8') as fp: unattended- upgrades/ unattended- upgrades- dpkg.log'
rm: cannot remove '/var/log/
bdmurray@
Traceback (most recent call last):
File "/usr/bin/
main(options)
File "/usr/bin/
log_content = get_dpkg_
File "/usr/bin/
with io.open(
FileNotFoundError: [Errno 2] No such file or directory: '/var/log/
I did this after installing all updates and enabling options in /etc/apt/ apt.conf. d/20auto- upgrades.