package-data-downloader crashed with AttributeError in process_download_requests(): 'Deb822' object has no attribute 'has_key'

Bug #1040380 reported by jerrylamos
300
This bug affects 51 people
Affects Status Importance Assigned to Milestone
update-notifier (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Doing an update after install Quantal daily live dated 22 August.

ProblemType: Crash
DistroRelease: Ubuntu 12.10
Package: update-notifier-common 0.120ubuntu2
ProcVersionSignature: Ubuntu 3.5.0-11.11-generic 3.5.2
Uname: Linux 3.5.0-11-generic i686
ApportVersion: 2.5.1-0ubuntu1
Architecture: i386
Date: Wed Aug 22 22:17:46 2012
ExecutablePath: /usr/lib/update-notifier/package-data-downloader
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Alpha i386 (20120822)
InterpreterPath: /usr/bin/python2.7
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/lib/update-notifier/package-data-downloader
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
PythonArgs: ['/usr/lib/update-notifier/package-data-downloader']
SourcePackage: update-notifier
Title: package-data-downloader crashed with AttributeError in process_download_requests(): 'Deb822' object has no attribute 'has_key'
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:

modified.conffile..etc.apt.apt.conf.d.10periodic:
 APT::Periodic::Update-Package-Lists "0";
 APT::Periodic::Download-Upgradeable-Packages "0";
 APT::Periodic::AutocleanInterval "0";
mtime.conffile..etc.apt.apt.conf.d.10periodic: 2012-08-22T22:09:27.309790

Related branches

Revision history for this message
jerrylamos (jerrylamos) wrote :
visibility: private → public
tags: removed: need-duplicate-check
Changed in update-notifier (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in update-notifier (Ubuntu):
status: New → Confirmed
Revision history for this message
joshiss (joshiss) wrote :

Could not calculate upgrade

An unresolvable problem occurred while calculating the upgrade.

Please report this bug against the 'update-manager' package and include the following error message:
E:Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

Revision history for this message
Karma Dorje (taaroa) wrote :

E:Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

# LANG=C apt-get -f upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
  gnome-control-center gnome-control-center-data gnome-settings-daemon
  metacity unity-lens-files
The following packages will be upgraded:
  apport apport-gtk apport-retrace compiz compiz-core compiz-gnome
  compiz-plugins compiz-plugins-default compiz-plugins-main
  compiz-plugins-main-default compizconfig-backend-gconf
  compizconfig-settings-manager fonts-opensymbol foomatic-db-compressed-ppds
  gir1.2-gnomekeyring-1.0 gir1.2-nautilus-3.0 gnome-icon-theme
  gnome-icon-theme-full gnome-icon-theme-symbolic gnome-keyring gvfs gvfs:i386
  gvfs-backends gvfs-bin gvfs-common gvfs-daemons gvfs-fuse gvfs-libs
  gvfs-libs:i386 htop indicator-appmenu indicator-session libcompizconfig0
  libdecoration0 libgnome-control-center1 libgnome-keyring-common
  libgnome-keyring0 libgnome-keyring0:i386 libgssdp-1.0-3 libgupnp-1.0-4
  libjson0 libjson0:i386 libnautilus-extension1a libpam-gnome-keyring
  libreoffice-base-core libreoffice-calc libreoffice-common libreoffice-core
  libreoffice-draw libreoffice-help-ru libreoffice-impress libreoffice-l10n-ru
  libreoffice-ogltrans libreoffice-pdfimport
  libreoffice-presentation-minimizer libreoffice-presenter-console
  libreoffice-style-human libreoffice-writer libsecret-1-0 libsecret-common
  libunity-2d-private0 libunity-core-6.0-5 metacity-common nautilus
  nautilus-data openprinting-ppds powertop python-apport python-compizconfig
  python-cupshelpers python-problem-report python-ubuntuone-client
  python-ubuntuone-control-panel python3-apport python3-problem-report
  software-center system-config-printer-common system-config-printer-gnome
  system-config-printer-udev transmission-common transmission-gtk
  ubuntuone-client ubuntuone-control-panel ubuntuone-control-panel-common
  ubuntuone-control-panel-qt unity unity-2d unity-2d-common unity-2d-panel
  unity-2d-shell unity-2d-spread unity-common unity-lens-music unity-services
  uno-libs3 ure x11-common xorg xserver-common xserver-xorg xserver-xorg-core
  xserver-xorg-input-all xserver-xorg-video-all
103 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
Need to get 129 MB of archives.
After this operation, 9 379 kB disk space will be freed.
Do you want to continue [Y/n]?

Revision history for this message
Karma Dorje (taaroa) wrote :

# LANG=C apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
  gnome-control-center gnome-control-center-data gnome-settings-daemon
  metacity unity-lens-files
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

Revision history for this message
Karma Dorje (taaroa) wrote :

after the next run the command `apt-get update & & apt-get upgrade` I have no problems.
therefore, we can say that this is a temporary problem and it is solved.

% date
Fri Aug 24 12:51:08 UTC 2012

% sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
  compiz compiz-core compiz-gnome compiz-plugins compiz-plugins-default
  gnome-control-center gnome-control-center-data gnome-settings-daemon
  libcompizconfig0 libdecoration0 metacity unity-lens-files
0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded.

Revision history for this message
Julian Taylor (jtaylor) wrote :

the fix is very simple, just replace all
x.has_key('key')
with
'key' in x

probably fallout from the py3 transition

Changed in update-notifier (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/1040380

tags: added: iso-testing
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-notifier - 0.121ubuntu1

---------------
update-notifier (0.121ubuntu1) quantal; urgency=low

  [ Michael Vogt ]
  * lp:~nathwill/update-notifier/lp-934517:
    - improve wording (LP: #934517), thanks to Nathan Williams

  [ Julian Taylor ]
  * replace dict.has_key with key in dict (LP: #1040380)
 -- Dmitrijs Ledkovs <email address hidden> Sat, 25 Aug 2012 15:16:34 +0100

Changed in update-notifier (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Rocko (rockorequin) wrote :

The update wouldn't apply for me, either with apt-get upgrade or apt-get --reinstall, because it tries to configure update-notifier-common (and fails) before updating it.

But manually editing /usr/lib/update-notifier/package-data-downloader to replace lines like "if para.has_key('should-download'):" with "if 'should-download' in para:", as Julian said above, allowed the update to apply. (I didn't want to try removing it because apt-get was going to remove other packages.)

Revision history for this message
Julian Taylor (jtaylor) wrote :

you should also be able to download the fixed deb from launchpad and install it manually with:
dpkg -i file.deb
apt-get install -f

Revision history for this message
Jecha (jecha666) wrote :

all work! thanks!
easier to do so:

#under root user
apt-get update
apt-get upgrade

#you see this error, "AttributeError: 'Deb822' object has no attribute 'has_key'" etc...

dpkg --remove update-notifier-common
apt-get install -f

#update-notifier installed, all works!

Revision history for this message
Charles Norrie (norriecb) wrote : Re: [Bug 1040380] Re: package-data-downloader crashed with AttributeError in process_download_requests(): 'Deb822' object has no attribute 'has_key'

Thanks for fixing it. I'll rinstall 12.10 but keep 12.04 going as well.

Charles

On 27 August 2012 12:54, Jecha <email address hidden> wrote:

> all work! thanks!
> easier to do so:
>
> #under root user
> apt-get update
> apt-get upgrade
>
> #you see this error, "AttributeError: 'Deb822' object has no attribute
> 'has_key'" etc...
>
> dpkg --remove update-notifier-common
> apt-get install -f
>
> #update-notifier installed, all works!
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1041843).
> https://bugs.launchpad.net/bugs/1040380
>
> Title:
> package-data-downloader crashed with AttributeError in
> process_download_requests(): 'Deb822' object has no attribute
> 'has_key'
>
> Status in “update-notifier” package in Ubuntu:
> Fix Released
>
> Bug description:
> Doing an update after install Quantal daily live dated 22 August.
>
> ProblemType: Crash
> DistroRelease: Ubuntu 12.10
> Package: update-notifier-common 0.120ubuntu2
> ProcVersionSignature: Ubuntu 3.5.0-11.11-generic 3.5.2
> Uname: Linux 3.5.0-11-generic i686
> ApportVersion: 2.5.1-0ubuntu1
> Architecture: i386
> Date: Wed Aug 22 22:17:46 2012
> ExecutablePath: /usr/lib/update-notifier/package-data-downloader
> InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Alpha i386 (20120822)
> InterpreterPath: /usr/bin/python2.7
> PackageArchitecture: all
> ProcCmdline: /usr/bin/python
> /usr/lib/update-notifier/package-data-downloader
> ProcEnviron:
> TERM=xterm
> PATH=(custom, no user)
> LANG=en_US.UTF-8
> SHELL=/bin/bash
> PythonArgs: ['/usr/lib/update-notifier/package-data-downloader']
> SourcePackage: update-notifier
> Title: package-data-downloader crashed with AttributeError in
> process_download_requests(): 'Deb822' object has no attribute 'has_key'
> UpgradeStatus: No upgrade log present (probably fresh install)
> UserGroups:
>
> modified.conffile..etc.apt.apt.conf.d.10periodic:
> APT::Periodic::Update-Package-Lists "0";
> APT::Periodic::Download-Upgradeable-Packages "0";
> APT::Periodic::AutocleanInterval "0";
> mtime.conffile..etc.apt.apt.conf.d.10periodic: 2012-08-22T22:09:27.309790
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/1040380/+subscriptions
>

Revision history for this message
jerrylamos (jerrylamos) wrote :

This bug happened again with Beta 1.

Revision history for this message
Julian Taylor (jtaylor) wrote :

I don't see how, there is no has_key in the source anymore
are you sure it was the up to date update-notifier?

Revision history for this message
Andy Braben (abraben) wrote :

And it has happened again with beta 2 during upgrade

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.