Wrong result/count in update-notifier depending of the python version

Bug #1595154 reported by Hassan El Jacifi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
update-notifier (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hi Guys,

I have seen a strange behavior regarding the update notifier. Our monitoring system isn't able to show missing updates.

After starting looking closer, the script apt-check is not providing the correct result depending the python version. Changing python from 3 to 2 or changing the shebang solve the issue.

Details:

root@xx ~ # ls -al /usr/bin/pytho*
lrwxrwxrwx 1 root root 9 Dec 21 2013 /usr/bin/python -> python2.7
lrwxrwxrwx 1 root root 9 Dec 21 2013 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 3345416 Jun 22 2015 /usr/bin/python2.7
lrwxrwxrwx 1 root root 9 Mar 23 2014 /usr/bin/python3 -> python3.4
-rwxr-xr-x 2 root root 3709944 Oct 14 2015 /usr/bin/python3.4
-rwxr-xr-x 2 root root 3709944 Oct 14 2015 /usr/bin/python3.4m
lrwxrwxrwx 1 root root 10 Mar 23 2014 /usr/bin/python3m -> python3.4m

root@xx ~ # /usr/bin/python3 /usr/lib/update-notifier/apt-check
0;0

root@xx ~ # /usr/bin/python2 /usr/lib/update-notifier/apt-check
4;0

root@xx ~ # head /usr/lib/update-notifier/apt-check
#!/usr/bin/python3

#nice apt-get -s -o Debug::NoLocking=true upgrade | grep ^Inst

import apt
import apt_pkg
import os
import sys
from optparse import OptionParser

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: update-notifier-common 0.154.1ubuntu1
ProcVersionSignature: Ubuntu 3.13.0-53.89-generic 3.13.11-ckt19
Uname: Linux 3.13.0-53-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.21
Architecture: amd64
Date: Wed Jun 22 13:42:22 2016
PackageArchitecture: all
SourcePackage: update-notifier
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Hassan El Jacifi (waver) wrote :
summary: - Wrong result/count in update-notifier depending the python version
+ Wrong result/count in update-notifier depending of the python version
Revision history for this message
Sebastien Bacher (seb128) wrote :

thank you for your bug report, did you forget to include the output for the upgrade command or does it return nothing?

Revision history for this message
Steve Langasek (vorlon) wrote :

It seems very unlikely that this bug would be in update-notifier itself, since the python code there is straightforward and only calls into update-manager and python-apt. So the bug is probably in one of those components.

As Seb mentions, the output of an upgrade would be helpful here; and possibly an apt-clone of the affected system.

Is this problem reproducible in 16.04?

Revision history for this message
Hassan El Jacifi (waver) wrote :

Hi Guys,

I don't know if the bug affect 16.04 too.

The result is shown after the command apt-check. As you can see when you run it with:
- python3 you have 0,0 that means no package to update.
- python2 you have 4,0 that means 4 packages to update.

Start-Date: 2016-06-22 15:03:38
Commandline: apt dist-upgrade -uV
Upgrade: grub-common:amd64 (2.02~beta2-9ubuntu1.7, 2.02~beta2-9ubuntu1.8), grub2-common:amd64 (2.02~beta2-9ubuntu1.7, 2.02~beta2-9ubuntu1.8), grub-pc-bin:amd64 (2.02~beta2-9ubuntu1.7, 2.02~beta2-9ubuntu1.8), grub-pc:amd64 (2.02~beta2-9ubuntu1.7, 2.02~beta2-9ubuntu1.8)
End-Date: 2016-06-22 15:03:49

Revision history for this message
Hassan El Jacifi (waver) wrote :

Hi,

I can reproduce the behavior on xenial.

root@yy:~# /usr/bin/python3 /usr/lib/update-notifier/apt-check
0;0root@yy:~#
root@yy:~# /usr/bin/python2 /usr/lib/update-notifier/apt-check
2;0root@yy:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04 LTS
Release: 16.04
Codename: xenial

The following packages will be upgraded:
   linux-firmware (1.157 => 1.157.1)
   lshw (02.17-1.1ubuntu3.1 => 02.17-1.1ubuntu3.2)
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 32.8 MB of archives.

Hassan El Jacifi (waver)
tags: added: xenial
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.