<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'version'

Bug #896689 reported by Vladimir Scherbaev
176
This bug affects 31 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
High
Unassigned
aptdaemon (Ubuntu)
Invalid
High
Unassigned
python-apt (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Description: Ubuntu precise (development branch)
Release: 12.04
aptdaemon:
  Installed: 0.43+bzr712-0ubuntu1
  Candidate: 0.43+bzr712-0ubuntu1
  Version table:
 *** 0.43+bzr712-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status

ProblemType: Crash
DistroRelease: Ubuntu 12.04
Package: aptdaemon 0.43+bzr712-0ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-1.3-generic 3.2.0-rc2
Uname: Linux 3.2.0-1-generic x86_64
NonfreeKernelModules: nvidia
Annotation: Upgrading the system failed
ApportVersion: 1.90-0ubuntu1
Architecture: amd64
Date: Sat Nov 26 15:29:44 2011
DesktopFile: /usr/share/aptdaemon/aptdaemon.desktop
ExecutablePath: /usr/sbin/aptd
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427.1)
PackageArchitecture: all
SourcePackage: aptdaemon
SysLog:

Title: <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'version'
TransactionDepends: [[], [], [], [], [], [], []]
TransactionErrorCode: error-unknown
TransactionKwargs: {'safe_mode': dbus.Boolean(True)}
TransactionLocale:

TransactionOutput:

TransactionPackages: [[], [], [], [], [], []]
TransactionRole: role-upgrade-system
UpgradeStatus: Upgraded to precise on 2011-11-22 (4 days ago)

Related branches

Revision history for this message
Vladimir Scherbaev (zemik) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in aptdaemon (Ubuntu):
status: New → Confirmed
Revision history for this message
Sebastian Heinlein (glatzor) wrote :

It seems that the python-apt assumption (apt.package.Package.is_upgradable and apt.package.Package.candidate is not None) seems to be not true in all cases. But why gets a package reported as upgradable but hasn't got a valid candidate at all?

Changed in aptdaemon (Ubuntu):
importance: Undecided → High
visibility: private → public
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-apt (Ubuntu):
status: New → Confirmed
Revision history for this message
Julian Andres Klode (juliank) wrote :

Especially every package without a candidate version seems to have this property set:

apt's depcache.cc around line 1500:
   if (Pkg->CurrentVer == 0 || Pkg->VersionList == 0 || CandidateVer == 0)
     Status = 2;

and
  inline bool Upgradable() const {return Status >= 1;};

which should probably be
  inline bool Upgradable() const {return Status >= 2 && CandidateVersion ;};

this would of course requires a rebuild of reverse dependencies and is probably not entirely correct either.

Revision history for this message
Julian Andres Klode (juliank) wrote :

We could work around this in python-apt by checking that a candidate version exists for now, but this should be fixed in APT - if it's still broken, my local branch is not totally up-to-date.

Revision history for this message
Barry Drake (b-drake) wrote :

I'm on i386 ver on precise and just got this problem after today's update.

Changed in apt (Ubuntu):
importance: Undecided → High
status: New → Confirmed
Changed in python-apt (Ubuntu):
importance: Undecided → High
Revision history for this message
Barry Drake (b-drake) wrote :

Occurred only for the second time immediately after today's updates.

Revision history for this message
Sebastian Heinlein (glatzor) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "fix-upgradable.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Sebastian Heinlein (glatzor) wrote :

Fixed in python-apt 0.8.3-ubuntu6

Changed in python-apt (Ubuntu):
status: Confirmed → Fix Released
Changed in aptdaemon (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Julian Andres Klode (juliank) wrote :

Fix committed upstream in debian/experimental. Expect that to hit Ubuntu 16.04.

Changed in apt (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 1.1.4

---------------
apt (1.1.4) unstable; urgency=medium

  [ Julian Andres Klode ]
  * defaults.mak: Set LC_COLLATE=C.UTF-8 for reproducible sort order
  * Avoid overflow when summing up file sizes

  [ David Kalnischkies ]
  * add a apt breaks (apt-utils << 1.1.3) for partial-upgrades (Closes: 806765)
  * require explicit paths to dsc/control as we do for deb files
    (Closes: 806693)
  * use @CHANGEPATH@ as placeholder in changelog URI templates
  * replace "which" with "command -v" for portability.
    Thanks to Mingye Wang for the suggestion. (Closes: 807144)
  * replace run-parts with find|sort to avoid debianutils usage
  * part revert, part redo 'which' replacement.
    Thanks to Jakub Wilk for pointing out #747320

  [ Fredrik Fornwall ]
  * apt-helper.cc: include <stdlib.h> for atoi (Closes: 807031)

 -- Julian Andres Klode <email address hidden> Mon, 07 Dec 2015 15:31:31 +0100

Changed in apt (Ubuntu):
status: Fix Committed → Fix Released
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.