Apport unable to report crash - urlopen error timed out

Bug #314212 reported by Matt Walker on 2009-01-05
140
This bug affects 15 people
Affects Status Importance Assigned to Milestone
Apport
Undecided
Unassigned
python-launchpad-bugs
Undecided
Unassigned
apport (Ubuntu)
High
Unassigned
Nominated for Lucid by nascentmind
Jaunty
High
Unassigned
python-apt (Ubuntu)
Medium
Michael Vogt
Nominated for Lucid by nascentmind
Jaunty
Medium
Michael Vogt

Bug Description

Binary package hint: apport

I enabled apport in Jaunty and a crash occurred and apport was unable to report bug to launchpad database. This has been occurring for about 2 weeks now, and it seems to only give an error message when i choose to submit a complete report. And with a minimum report it is unable to process that neither.

I get the error: Network problem
could not upload report data to crash database:
<urlopen error The write operation timed out>

Matt Walker (matthaeus123) wrote :
Changed in apport:
status: New → Confirmed
Changed in launchpad-integration:
status: Confirmed → New
Daniel Hahler (blueyed) wrote :

Confirming, also because of duplicate.

It says in the bug 311082 that it's related only to xserver reports.
I'm getting this quite often, too. do not know if it's related to a particular package - it might be a kopete report, but "ubuntu-bug kopete" opens firefox correctly.

I can reproduce a "<urlopen error The write operation timed out>" error with a _usr_bin_kopete.1000.crash file ("/usr/share/apport/apport-{gtk,qt} -c /var/crash/_usr_bin_kopete.1000.crash"). Please let me know, if you need it to debug this.

It probably depends on the size of the crash file/data to be submitted?! (the sample crash file is ~10MB)

This is with apport 0.126.

Changed in apport:
importance: Undecided → Medium
status: New → Triaged
Jean.c.h (slug71) wrote :

Have gotten this about 3 times now too all relating to the same bug but i cant get it reported because of this one.

Jean.c.h (slug71) wrote :

Using Jaunty BTW

Åsmund Hjulstad (asmund) wrote :

Experiencing same problem (fresh jaunty), trying to report a bug after a vlc crash.

Jean.c.h (slug71) on 2009-01-12
Changed in apport:
status: New → Confirmed
André Gondim (andregondim) wrote :

I have this problem when try preview in "Notification Settings".

When I try report the problem, receve this problem with apport.

I'm using Jaunty Alpha 2

Cheers.

lilbudda (cory-meisch-gmail) wrote :

Same here. Haven't been able to report any error reports due to this problem.

Jean.c.h (slug71) wrote :

Had some Apport updates this morning but still have this bug.

Charlie Kravetz (charlie-tca) wrote :

I've seen this also, but not against any one package. It has surfaced reporting against firefox, gedit, ubiquity, debian-installer at least. Most of the time, hitting try again in a couple of minutes lets it go through.

Daniel Queirolo (danf-1979) wrote :

Same here, this makes apport completely unusable for me in jaunty.

Angel Guzman Maeso (shakaran) wrote :

Same here, I lost five different reports until now. Please fix this bug with priority critical. This bug prevents sending any bug reports and many are being lost, with serious consequences for development.

Daniel Hahler (blueyed) wrote :

Raising prio to "High".

Changed in apport:
importance: Medium → High
Bogdan Butnaru (bogdanb) wrote :

Wasn't there an "affects me too" button somewhere in Launchpad?

Anyway, this one affects me too. And for some reason after one or two tries Apport doesn't offer to send a report anymore (no idea if that's intended to happen), and so I can't retry sending it, as Charlie suggested.

Kjell Braden (afflux) wrote :

It's definetly independent of the crash file size, since simple python tracebacks don't seem to get uploaded either.

Markus Korn (thekorn) wrote :

I'm wondering how this is related to bug 309307.
To me it looks like this error is catched in UserInterface.file_report() (in apport/ui.py). This method is calling crashdb.upload() which is using this storeblob method of launchpad.

Markus Korn (thekorn) wrote :

I'm able to reproduce this timeout in about 1 out of 10 times when using apport on intrepid and on jaunty.
This timeout happens on launchpad.net/+storeblob this is why I added a task for launchpad.
I think as a workaround it makes sense to add a "try again" button to apport, or automatically try again a few times on timeouts.

spitfire (mieszkoslusarczyk) wrote :

This bug prevented me from reporting bug, everytime I tried it (jaunty a3).

Francis J. Lacoste (flacoste) wrote :

Is there an OOPS reference on the launchpad.net/+storeblob failure? That page doesn't appear in our daily OOPS report.

Or is this an Apache error page? (Is the error generated by Launchpad or by the apache front-proxy?)

Changed in launchpad:
status: New → Incomplete
Kjell Braden (afflux) wrote :

Removed unrelated logfiles with sensitive content.

spitfire (mieszkoslusarczyk) wrote :

Kjell, can you tell me what should I attach?

Alex Krastelev (alex-netrc) wrote :

Setting socket timeout ( socket.setdefaulttimeout(10)) fixes the bug but the reasons is unclear.

This patch fixes the bug under 9.04
in /usr/lib/python2.5/site-packages/launchpadbugs/storeblob.py
--- storeblob.py.orig
+++ storeblob.py
@@ -11,6 +11,7 @@
 '''

 import multipartpost_handler, urllib2, time, httplib
+import socket

 _https_upload_callback = None

@@ -68,6 +69,7 @@

     global _https_upload_callback
     _https_upload_callback = progress_callback
+ socket.setdefaulttimeout(10)
     opener = urllib2.build_opener(HTTPSProgressHandler, multipartpost_handler.MultipartPostHandler)
     result = opener.open('https://launchpad.net/+storeblob',
         { 'FORM_SUBMIT': '1', 'field.blob': blob })

STEVE555 (stevenward666) wrote :

Hi to all,
           I have been getting the same problem for sometime as well.
Here is the error message:
Could not upload report data to crash database:

<urlopen error The write operation timed out>

I'm currently using Kubuntu Jaunty Jackalope Alpha 3.

Regards,
            Steve

Alex Krastelev (alex-netrc) wrote :

Here is the reason for apport timeouts:
apt package ( imported by apport/packaging_impl.py) sets default timeout to 2 seconds, this seems to be too short for apport uploads.

in /usr/lib/python2.5/site-packages/apt/package.py
...
# Set a timeout for the changelog download
socket.setdefaulttimeout(2)
...

***This timeout must be increased.***

I wonder whether this timeout changed recently ?
Could anyone with 8.04 or 8.10 check if this timeout is 2 seconds, too ?
(please check in /usr/lib/python2.5/site-packages/apt/package.py)

spitfire (mieszkoslusarczyk) wrote :
Alex Krastelev (alex-netrc) wrote :

Thanks, found the package.py in Bazaar. The problematic 2-second timeout was introduced in rev 305 in the end of November 2008. Before the rev 305 there was no timeout at all.

Could anyone with knowledge of python-apt test increasing the timeout in package.py from 2 to 10 seconds and comment on this fix ?

Here is when the 2-second timeout appeared first:
merged from the consolidation-bracn (with some modificatins) // Michael Vogt 2008-11-24
http://bazaar.launchpad.net/~mvo/python-apt/python-apt--mvo/annotate/head%3A/apt/package.py

=== modified file 'apt/package.py'
--- apt/package.py 2008-09-18 12:58:03 +0000
+++ apt/package.py 2008-11-24 13:46:48 +0000
@@ -19,10 +19,18 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 # USA

-import apt_pkg
+import httplib
 import sys
 import random
+import re
+import socket
 import string
+import urllib2
+
+import apt_pkg
+
+# Set a timeout for the changelog download
+socket.setdefaulttimeout(2)

 #from gettext import gettext as _
 import gettext

Matt Walker (matthaeus123) wrote :

I downloaded revision 297, and it fixed only part of the problem. It uploaded the file successfully, but was unable to connect to launchpad correctly

file:///ubuntu/+source/pidgin/+filebug/cc1aJmaHRqzC9fiQBYkxarPo7Oq
^That's the address apport sent me to after uploading the report.

Alex Krastelev (alex-netrc) wrote :

I think at the moment it's better to manually change
socket.setdefaulttimeout(2) to socket.setdefaulttimeout(10) in /usr/lib/python2.5/site-packages/apt/package.py,
instead of reverting to the revision 297

Regarding apport opening non-existing URL file:///ubuntu/...
It seems to be an unrelated bug that happens when a file in /var/crash is not readable for you (owned by root).
After chowning the file in /var/crash I could submit the big.

Brian Murray (brian-murray) wrote :

I've uploaded a new release of python-launchpad-bugs to Jaunty that will work around this issue by increasing the default timeout in storeblob.py. Thanks for the tip Alex and thanks to Markus for the patch.

Changed in python-apt:
status: New → Triaged
Markus Korn (thekorn) on 2009-01-23
Changed in launchpad:
status: Incomplete → Invalid
Changed in apport:
status: Confirmed → Invalid
Changed in python-launchpad-bugs:
status: New → Fix Committed
Michael Vogt (mvo) wrote :

Thanks for looking into this, I will fix the python-apt code

Changed in python-apt:
assignee: nobody → mvo
importance: Undecided → Medium
status: Triaged → In Progress
Jean.c.h (slug71) wrote :

Seems to be working for me so far again.

Matt Walker (matthaeus123) wrote :

It failed for me today, but didn't at all yesterday. But the report was about 14mb

wulf solter (wulfsolter) wrote :

manually changed socket.setdefaulttimeout(2) to socket.setdefaulttimeout(10) in /usr/lib/python2.5/site-packages/ and havn't had any problems since!

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-apt - 0.7.9~exp2ubuntu4

---------------
python-apt (0.7.9~exp2ubuntu4) jaunty; urgency=low

  * apt/cache.py:
    - when running with the rootdir option, run
      InitConfig() again to ensure that the config
      from the rootdir is read, not from the host
      (lp: #243550)
  * apt/package.py:
    - make sure to set the defaulttimeout back to the
      original value (in getChangelog(), LP: #314212)

 -- Michael Vogt <email address hidden> Mon, 26 Jan 2009 08:45:00 +0100

Changed in python-apt:
status: In Progress → Fix Released
spitfire (mieszkoslusarczyk) wrote :

Now I tried to submit bug report (sending file > 10M), and just in the ended it showed up:

HTTP Error 502: Bad Gateway

spitfire (mieszkoslusarczyk) wrote :

Some reports are very big, are the compressed in any way?

Steve Langasek (vorlon) wrote :

since this bug was both introduced and fixed in python-apt, I don't think any changes are needed in apport here.

Changed in apport:
status: Triaged → Invalid
TJ (tj) wrote :

The problem of apport trying to display launchpad bug reports using "file://" URLs is dealt with in bug #314263

Martin Pitt (pitti) wrote :

The python-launchpad-bugs workaround is in Jaunty, but it's not needed any more. However, it doesn't hurt, and p-lp-bugs is relatively obsolete anyway.

Changed in python-launchpad-bugs:
status: Fix Committed → Fix Released

I still get this error in Kubuntu Jaunty alpha 6 !! But it occurs randomly, most of the times i am able to submit bugs.
So, I don't think it is fixed completely yet. This is preventing some of the crashed from being submitted.

I am getting in even when firefox is open and the network connecting is active !!

Is there a way I can submit the crash bug after I get this error?

Daniel Hahler (blueyed) wrote :

Musthafa, from "/usr/share/apport/apport-qt -h":
  -c PATH, --crash-file=PATH
                        Report the crash from given .crash file instead of the
                        pending ones in /var/crash

So, try "/usr/share/apport/apport-qt /var/crash/YOURCRASHFILE".

Åskar (olskar) wrote :

No, this is not fixed. I can reproduce this 8 out of 10 times on fully updated Jaunty.

Daniel and Musthafa, the correct command is:

/usr/share/apport/apport-gtk --crash-file=/var/crash/YOURCRASHFILE
or
/usr/share/apport/apport-qt --crash-file=/var/crash/YOURCRASHFILE

Jeffrey Baker (jwbaker) wrote :

That's because the "fix" is dumb and broken. It will eventually timeout for someone, somewhere, with a slow connection.

Åskar (olskar) wrote :

Then I would say it is more of a workaround than a fix, and this should perhaps be marked as confirmed again instead of fix released?

Åskar (olskar) on 2009-05-29
Changed in python-apt (Ubuntu Jaunty):
status: Fix Released → Confirmed
Daniel Stone (danielstone) wrote :

This still effects me and it shows(from speedtest.net) I have an up speed of 0.47Mb/s
This is during page transition on the launchpad site and crash reports through apport
noticed since Saturday

I think that's a different (LP) issue. I've had a lot of issues with LP
timeouts through the web interface recently too.

tags: added: iso-testing
Michael Vogt (mvo) wrote :

I close the jaunty task of this.

Changed in python-apt (Ubuntu Jaunty):
status: Confirmed → Won't Fix
tags: removed: iso-testing
tags: added: iso-testing
no longer affects: launchpad
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers