aptd crashed with AttributeError in _inline_callbacks(): 'NoneType' object has no attribute 'send'

Bug #971748 reported by sirianni on 2012-04-02
This bug affects 78 people
Affects Status Importance Assigned to Milestone
aptdaemon (Ubuntu)
Sebastian Heinlein

Bug Description

1. use a system without network manager running
2. open update-manager and click check
3. verify that there is a error dialog opening
4. install the version from precise-proposed
5. reboot
6. repeat (2) and verify that there is no error anymore

Happened upon Gnome startup.

ProblemType: Crash
DistroRelease: Ubuntu 12.04
Package: aptdaemon 0.43+bzr784-0ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-21.34-generic 3.2.13
Uname: Linux 3.2.0-21-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.0-0ubuntu2
Architecture: amd64
Date: Mon Apr 2 12:42:19 2012
DesktopFile: /usr/share/aptdaemon/aptdaemon.desktop
ExecutablePath: /usr/sbin/aptd
ExecutableTimestamp: 1331728907
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Beta amd64 (20120301)
InterpreterPath: /usr/bin/python2.7
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/sbin/aptd
ProcCwd: /

PythonArgs: ['/usr/sbin/aptd']
SourcePackage: aptdaemon
Title: aptd crashed with AttributeError in _inline_callbacks(): 'NoneType' object has no attribute 'send'
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: engr http mailman nisrcs radadmin sysadmin wheel xelus

Related branches

sirianni (eric-sirianni) wrote :

This crash has the same stack trace characteristics as bug #639616. However, the latter was already fixed in an earlier package version than the one in this report. This might be a regression or because the problem is in a dependent package.

tags: removed: need-duplicate-check
tags: added: regression-retracer
Launchpad Janitor (janitor) wrote :

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

Changed in aptdaemon (Ubuntu):
status: New → Confirmed
visibility: private → public
Fabien Tassin (fta) wrote :

happens to me daily and after/during each upgrade, since Mar 15.
Most likely a regression of aptdaemon 0.43+bzr784-0ubuntu1

dino99 (9d9) on 2012-04-11
tags: added: i386
Christian Reis (kiko) wrote :

Daily for me as well, upgraded today.

dino99 (9d9) wrote :

Still getting it on Precise i386 with aptdaemon 0.43+bzr805-0ubuntu1
But i cant report it as apport identify it as a #639616 duplicate, even if this one is marked "fix released" . Seems that apport take care only of the beginning of the error message :

it identify:
- aptdaemon crashed with AttributeError in _inline_callbacks()
- but ignore the end of the error : 'NoneType' object has no attribute 'send'

and does not care about "fix released" field (at least for this package)

dino99 (9d9) wrote :

I get this traceback:

File "/usrlib/python2.7/dist-packages/defer/__init__.py", line 475, in _inline_callbacks result=gen.send(result)
AttributeError: 'NoneType' object has no attribute 'send'

Fabien Tassin (fta) wrote :

so now we have an LTS with this daily crasher *sigh*

tentatively linking python-defer to this bug, as it seems it's the new home of this code.

Fabien Tassin (fta) wrote :

I checked the py stack leading to this AttributeError, it happens the fault really is in aptdaemon after all.

[(<frame object at 0x3005200>, '/usr/lib/python2.7/dist-packages/defer/__init__.py', 473, '_inline_callbacks', [' print >> fd, inspect.stack()\n'], 0),
 (<frame object at 0x30115e0>, '/usr/lib/python2.7/dist-packages/defer/__init__.py', 592, 'unwind_generator', [' return _inline_callbacks(None, func(*args, **kwargs), Deferred())\n'], 0),
 (<frame object at 0x300a550>, '/usr/lib/python2.7/dist-packages/aptdaemon/pkcompat.py', 306, '__init__', [' self.netmon.get_network_state()\n'], 0),
 (<frame object at 0x2e37280>, '/usr/lib/python2.7/dist-packages/aptdaemon/core.py', 1406, '__init__', [' self.packagekit = pkcompat.PackageKit(self.queue, connect, bus)\n'], 0),
 (<frame object at 0x2e317f0>, '/usr/lib/python2.7/dist-packages/aptdaemon/core.py', 2191, 'main', [' daemon = AptDaemon(options, bus=bus)\n'], 0),
 (<frame object at 0x28e7ef0>, '/usr/sbin/aptd', 28, '<module>', [' aptdaemon.core.main()\n'], 0)]

i'm not using network-manager on this box so it's probably the least tested path (if not the totally untested path). That may explain why there's only a few dupes, not millions.

While exploring that path, I found the bug:
In aptdaemon, self.netmon is a ProcNetworkMonitor() instance, which is good in my case, and when called, it properly finds 'online'. The problem seems to be the missing return value in ProcNetworkMonitor.get_network_state().
it sure fixes this AttributeError for me, but then i'm getting a cryptic _DefGen_Return raise from the defer module. So more work is needed.

anyway, python-defer should not die the way it does anyway, so its task here is probably also valid.

sirianni (eric-sirianni) wrote :

I am also not using NetworkManager, and I see this bug daily as well.

Ralf (ralf-kaestner) wrote :

I think this is a dup of #639616

Sebastian Heinlein (glatzor) wrote :

Fabien, thanks for your good analysis. I fixed the bug in trunk. Indeed python-defer should give a better hint of a wrong use.

Changed in python-defer:
status: New → Invalid
Launchpad Janitor (janitor) wrote :

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

Changed in aptdaemon (Ubuntu Precise):
status: New → Confirmed
Changed in aptdaemon (Ubuntu):
importance: Undecided → Medium
avejidah (avejidah) wrote :

Thanks for your hard work guys. I have this crash on every login, too, since I upgraded to 12.04 in April. Is there anything helpful that I could add (logs, etc)? As with Fabien, I am not using Network Manager.

Sebastian Heinlein (glatzor) wrote :

Actually this is already fixed. I will try to get an updated version to precise

Changed in aptdaemon (Ubuntu Precise):
importance: Undecided → Medium
wilburdg (forum-dgel) wrote :

Also affected by this on every start-up. 12.04 clean install, not using Network Manager.

Changed in aptdaemon (Ubuntu):
status: Confirmed → Fix Committed
Changed in aptdaemon (Ubuntu Precise):
importance: Medium → High
milestone: none → ubuntu-12.04.1
Changed in aptdaemon (Ubuntu Precise):
assignee: nobody → Sebastian Heinlein (glatzor)
Simon Rijk (s-p-rijk) wrote :

Also affected by this one every start-up. 12.04, not using Network Manager. Thanks for the fix!

Michael Vogt (mvo) on 2012-06-14
description: updated

Hello sirianni, or anyone else affected,

Accepted aptdaemon into precise-proposed. The package will build now and be available in a few hours. Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users. If this package fixes the bug for you please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case details of your testing will help us make a better decision. Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in aptdaemon (Ubuntu Precise):
status: Confirmed → Fix Committed
tags: added: verification-needed
Bogdan Harjoc (harjoc-gmail) wrote :

Thanks! I was getting the same stack trace (no 'send' attr for NoneType in _inline_callbacks) every new reboot (ubuntu-12.04-i386).

Just enabled -proposed, upgraded and the startup crash is gone.

tags: added: verification-done
removed: verification-needed
dino99 (9d9) wrote :

Works on Quantal i386 logged as gnome-classic (proposed activated, package aptdaemon 0.45+bzr846, python-defer 1.06-2)

avejidah (avejidah) wrote :

Seems to have fixed the problem for me as well. Thanks!

avejidah (avejidah) wrote :

Since I did this -proposed aptdaemon update, update-manager crashes any time I try to install updates. I'm not sure if it's related, but update-manager seemed to work fine before this update (see attached screenshot).

Ashley (chippyash) wrote :

Still a problem - occurring daily - every time I log in. system fully up to date 12.04. aptdaemon version 0.43+bzr805-0ubuntu1

Michael Vogt (mvo) wrote :

Fwiw, I can reproduce the fix here too.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package aptdaemon - 0.43+bzr805-0ubuntu2

aptdaemon (0.43+bzr805-0ubuntu2) precise-proposed; urgency=low

  * debian/patches:
    - Add fix-lp-971748: Fixes to the /proc/net based network monitor to
      not fail on systems without NetworkManager running (fixes LP: #971748))
    - Add fix-lp-932581: Fix GetUpdates on system with broken dependencies
      (fixes LP: #932581)
    - Add fix-lp-981124: Fix type mismatches in the client signals to not
      fail on very large packages (fixes LP: #981124)
    - Add fix-lp-900982: Fix return type of get_package_status_from_enum
      (fixes LP: #900982)
 -- Sebastian Heinlein <email address hidden> Tue, 12 Jun 2012 09:38:14 +0200

Changed in aptdaemon (Ubuntu Precise):
status: Fix Committed → Fix Released
dino99 (9d9) on 2015-02-12
Changed in aptdaemon (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers