Bug#1016184: unattended-upgrades: Unattended-upgrades has file lock after completion

2022-08-01 Thread Tim McConnell
Hi Michael,
Ask and ye shall receive:

apt-get dist-upgrade -y -m 
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by
process 629520 (unattended-upgr)
N: Be aware that removing the lock file is not a solution and may break
your system.
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-
frontend), is another process using it?


ps afx | grep /proc/629520/
1263559 pts/0S+ 0:00  |   |   \_ grep /proc/629520/


lsof -p 629520
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system
/run/user/1000/gvfs
  Output information may be incomplete.
lsof: WARNING: can't stat() fuse.portal file system /run/user/1000/doc
  Output information may be incomplete.
COMMAND  PID USER   FD  TYPE DEVICE SIZE/OFF   
NODE NAME
unattende 629520 root  cwd   DIR8,5 4096
2359297 /var/backups
unattende 629520 root  rtd   DIR8,4 4096  
2 /
unattende 629520 root  txt   REG8,4  5900104
3154250 /usr/bin/python3.10
unattende 629520 root  DEL   REG8,5 
7082389 /var/cache/apt/pkgcache.bin
unattende 629520 root  DEL   REG8,5 
7077991 /var/cache/apt/pkgcache.bin
unattende 629520 root  mem   REG8,4  4713720
3152806 /usr/lib/x86_64-linux-gnu/libcrypto.so.3
unattende 629520 root  mem   REG8,4   700448
3152807 /usr/lib/x86_64-linux-gnu/libssl.so.3
unattende 629520 root  mem   REG8,463568
3673413 /usr/lib/python3.10/lib-dynload/_hashlib.cpython-310-x86_64-
linux-gnu.so
unattende 629520 root  mem   REG8,4   212304
3673415 /usr/lib/python3.10/lib-dynload/_ssl.cpython-310-x86_64-linux-
gnu.so
unattende 629520 root  mem   REG8,4   161864
3146718 /usr/lib/x86_64-linux-gnu/libgpg-error.so.0.33.0
unattende 629520 root  mem   REG8,438864
3146762 /usr/lib/x86_64-linux-gnu/libcap.so.2.44
unattende 629520 root  mem   REG8,4  1332480
3146730 /usr/lib/x86_64-linux-gnu/libgcrypt.so.20.4.1
unattende 629520 root  DEL   REG8,4 
3156120 /usr/lib/x86_64-linux-gnu/libsystemd.so.0.34.0
unattende 629520 root  DEL   REG8,4 
3149630 /usr/lib/x86_64-linux-gnu/libudev.so.1.7.4
unattende 629520 root  mem   REG8,4   751840
3145954 /usr/lib/x86_64-linux-gnu/libzstd.so.1.5.2
unattende 629520 root  mem   REG8,4   137568
3146757 /usr/lib/x86_64-linux-gnu/liblz4.so.1.9.3
unattende 629520 root  mem   REG8,4  2190408
3151362 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30
unattende 629520 root  mem   REG8,4   158400
3146118 /usr/lib/x86_64-linux-gnu/liblzma.so.5.2.5
unattende 629520 root  mem   REG8,4   125320
3149167 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
unattende 629520 root  mem   REG8,4  2055472
3149284 /usr/lib/x86_64-linux-gnu/libapt-pkg.so.6.0.0
unattende 629520 root  mem   REG8,422728
3152663 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
unattende 629520 root  mem   REG8,435888
3172444 /usr/lib/x86_64-linux-gnu/librt-2.33.so
unattende 629520 root  mem   REG8,4   351024
3674340 /usr/lib/python3/dist-packages/apt_pkg.cpython-310-x86_64-
linux-gnu.so
unattende 629520 root  mem   REG8,4   206984
3157107 /usr/lib/x86_64-linux-gnu/girepository-1.0/GLib-2.0.typelib
unattende 629520 root  mem   REG8,4   362276
3157110 /usr/lib/x86_64-linux-gnu/girepository-1.0/Gio-2.0.typelib
unattende 629520 root  mem   REG8,4   215704
3675617 /usr/lib/python3/dist-packages/cairo/_cairo.cpython-310-x86_64-
linux-gnu.so
unattende 629520 root  mem   REG8,447312
3169945 /usr/lib/x86_64-linux-gnu/libmd.so.0.0.5
unattende 629520 root  mem   REG8,484840
3150673 /usr/lib/x86_64-linux-gnu/libbsd.so.0.11.6
unattende 629520 root  mem   REG8,4   137376
3167131 /usr/lib/x86_64-linux-gnu/libbrotlicommon.so.1.0.9
unattende 629520 root  mem   REG8,414496
3152661 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
unattende 629520 root  mem   REG8,451360
3167133 /usr/lib/x86_64-linux-gnu/libbrotlidec.so.1.0.9
unattende 629520 root  mem   REG8,430776
3149260 /usr/lib/x86_64-linux-gnu/libuuid.so.1.3.0
unattende 629520 root  mem   REG8,481568
3152672 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
unattende 629520 root  mem   REG8,4  1322504
3152669 /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0
unattende 629520 root  mem   REG8,447608
3167671 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
unattende 629520 root  mem   REG8,4   170936
3152665 

Bug#1016184: unattended-upgrades: Unattended-upgrades has file lock after completion

2022-07-31 Thread Michael Vogt
Thanks for your bugreport.

On Thu, Jul 28, 2022, at 19:34, Tim McConnell wrote:
> Package: unattended-upgrades
> Version: 2.9.1
> Severity: normal
> X-Debbugs-Cc: tmcconnell...@gmail.com
[..]
> Unattended-Upgrades runs successfully, but if I try to run `apt-get dist-
> upgrades' when packages are held back I get a message stating unattended
> upgrades has the file locked (I also get this with Gnome Software center). If 
> I
> search `ps -ux' for that PID it isn't there. Sometimes I can run `sudo
> unattended-upgrade --debug --dry-run' and the lock is released other times I
> have to reboot the computer. It seems it's completed but hasn't let go of the
> lock.
[..]

The log in /var/log/unattended-upgrades/unattended-upgrades.log might be
interesting here. However what you describe sounds quite puzzling, the lock
should only be held if there is an active PID of unattended-upgrades, If you
see this again, could you please open a new terminal and type:
$ ps afx | grep /proc//
$ sudo lsof -p 
$ date
$ tail /var/log/unattended-upgrades/unattended-upgrades.log

Also "--dry-run" should not influence the lock file. It might be the issue goes
away after some time and running --dry-run also takes some time so when
it finishes the lock is gone. Or some hidden bug of course.

Thanks,
 Michael



Bug#1016184: unattended-upgrades: Unattended-upgrades has file lock after completion

2022-07-28 Thread Tim McConnell
Package: unattended-upgrades
Version: 2.9.1
Severity: normal
X-Debbugs-Cc: tmcconnell...@gmail.com

Dear Maintainer,

What led up to the situation? no idea I've been getting this for a awhile now.

What exactly did you do (or not do) that was effective (or ineffective)? No
idea. I configured it to run daily.

What was the outcome of this action?
Unattended-Upgrades runs successfully, but if I try to run `apt-get dist-
upgrades' when packages are held back I get a message stating unattended
upgrades has the file locked (I also get this with Gnome Software center). If I
search `ps -ux' for that PID it isn't there. Sometimes I can run `sudo
unattended-upgrade --debug --dry-run' and the lock is released other times I
have to reboot the computer. It seems it's completed but hasn't let go of the
lock.

What outcome did you expect instead? To be able to upgrade held back packages.

*** End of the template - remove these template lines ***


-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.18.0-2-amd64 (SMP w/1 CPU thread; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages unattended-upgrades depends on:
ii  debconf [debconf-2.0]  1.5.79
ii  lsb-base   11.2
ii  lsb-release11.2
ii  python33.10.5-3
ii  python3-apt2.3.0+b2
ii  python3-dbus   1.2.18-3+b2
ii  python3-distro-info1.1
ii  ucf3.0043
ii  xz-utils   5.2.5-2.1

Versions of packages unattended-upgrades recommends:
ii  anacron 2.3-33
ii  cron [cron-daemon]  3.0pl1-149
ii  systemd-sysv251.2-7

Versions of packages unattended-upgrades suggests:
ii  bsd-mailx  8.1.2-0.20220412cvs-1
ii  exim4-daemon-light [mail-transport-agent]  4.96-3
pn  needrestart
ii  powermgmt-base 1.36
ii  python3-gi 3.42.1-1+b1

-- debconf information:
* unattended-upgrades/enable_auto_updates: true
Enabled logging to syslog via daemon facility 
Starting unattended upgrades script
Allowed origins are: origin=Debian,codename=bookworm-updates, 
origin=Debian,codename=bookworm-proposed-updates, 
origin=Debian,codename=bookworm,label=Debian, 
origin=Debian,codename=bookworm,label=Debian-Security, 
origin=Debian,codename=bookworm-security,label=Debian-Security
Initial blacklist: 
Initial whitelist (not strict): 
Marking not allowed  with -32768 pin
Marking not allowed  with -32768 pin
Marking not allowed  with 
-32768 pin
Marking not allowed  with -32768 pin
Applying pinning: PkgFilePin(id=12, priority=-32768)
Applying pin -32768 to package_file: 
Applying pinning: PkgFilePin(id=11, priority=-32768)
Applying pin -32768 to package_file: 
Applying pinning: PkgFilePin(id=10, priority=-32768)
Applying pin -32768 to package_file: 
Applying pinning: PkgFilePin(id=9, priority=-32768)
Applying pin -32768 to package_file: 
Using 
(^linux-.*-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^kfreebsd-.*-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^gnumach-.*-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^.*-modules-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^.*-kernel-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^linux-.*-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^kfreebsd-.*-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^gnumach-.*-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^.*-modules-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$|^.*-kernel-[1-9][0-9]*\.[0-9]+\.[0-9]+-[0-9]+(-.+)?$)
 regexp to find kernel packages
Using 
(^linux-.*-5\.18\.0\-2\-amd64$|^linux-.*-5\.18\.0\-2$|^kfreebsd-.*-5\.18\.0\-2\-amd64$|^kfreebsd-.*-5\.18\.0\-2$|^gnumach-.*-5\.18\.0\-2\-amd64$|^gnumach-.*-5\.18\.0\-2$|^.*-modules-5\.18\.0\-2\-amd64$|^.*-modules-5\.18\.0\-2$|^.*-kernel-5\.18\.0\-2\-amd64$|^.*-kernel-5\.18\.0\-2$|^linux-.*-5\.18\.0\-2\-amd64$|^linux-.*-5\.18\.0\-2$|^kfreebsd-.*-5\.18\.0\-2\-amd64$|^kfreebsd-.*-5\.18\.0\-2$|^gnumach-.*-5\.18\.0\-2\-amd64$|^gnumach-.*-5\.18\.0\-2$|^.*-modules-5\.18\.0\-2\-amd64$|^.*-modules-5\.18\.0\-2$|^.*-kernel-5\.18\.0\-2\-amd64$|^.*-kernel-5\.18\.0\-2$)
 regexp to find running kernel packages
pkgs that look like they should be upgraded: 

Fetched 0 B in 0s (0 B/s)   
fetch.run() result: 0
Packages blacklist due to conffile prompts: []
No packages found that can be upgraded unattended and no pending auto-removals
The list of kept packages can't be calculated in dry-run mode.
APT "";
APT::Architecture "amd64";
APT::Build-Essential "";
APT::Build-Essential:: "build-essential";
APT::Install-Recommends "true";
APT::Install-Suggests "0";
APT::Sandbox "";
APT::Sandbox::User "_apt";
APT::Sandbox::seccomp "";
APT::Sandbox::seccomp::allow "";