slice indices must be integers or None or have an __index__ method

Bug #1013334 reported by Sasa Paporovic
60
This bug affects 8 people
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Fix Released
High
Martin Pitt

Bug Description

I am on Ubuntu12.10 Quantal 64bit with apport2.2.2-0ubuntu2.

On reporting a automatically gathered crash apport failed to connect to crash database and tells (invalid):

"Network problems

Cannot connect to crash database, please check your Internet connection.

slice indices must be integers or None or have an __index__ method"

-------------------------------------

The internet connection is valid. I have tested to report it with manually calls several times and during I am writing this here.

-------------------------------------

I attach the .crash file which is affected.

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: apport-gtk 2.2.2-0ubuntu2
ProcVersionSignature: Ubuntu 3.4.0-5.11-generic 3.4.0
Uname: Linux 3.4.0-5-generic x86_64
ApportVersion: 2.2.2-0ubuntu2
Architecture: amd64
Date: Thu Jun 14 20:34:17 2012
ExecutablePath: /usr/share/apport/apport-gtk
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Alpha amd64 (20120510)
InterpreterPath: /usr/bin/python3.2mu
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, no username)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: apport
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Sasa Paporovic (melchiaros) wrote :
Revision history for this message
Sasa Paporovic (melchiaros) wrote :
Revision history for this message
Sasa Paporovic (melchiaros) wrote :

I have retested it some minutes ago. Now it works. Seems to be that it was a problem with the db/launchpad and not with apport.

Changed in apport (Ubuntu):
status: New → Invalid
Revision history for this message
kyleabaker (kyleabaker) wrote :

I've experienced this same issue for the past couple days. System details below:
----

Description: Ubuntu quantal (development branch)
Release: 12.10

apport:
  Installed: 2.2.3-0ubuntu3
  Candidate: 2.2.3-0ubuntu3
  Version table:
 *** 2.2.3-0ubuntu3 0
        500 http://us.archive.ubuntu.com/ubuntu/ quantal/main amd64 Packages
        100 /var/lib/dpkg/status

Changed in apport (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
kyleabaker (kyleabaker) wrote :

Screenshot of error attached.

Revision history for this message
Sasa Paporovic (melchiaros) wrote :

Have it now sometimes with apport 2.2.3-0ubuntu3

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

This is happening to me for apport_2.2.5-0ubuntu1, the up to date version for today. I can confirm apport_2.0.1-0ubuntu5 from precise doesn't contain this problem.

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/1013334

tags: added: iso-testing
Revision history for this message
Martin Pitt (pitti) wrote :

Thanks! This is indeed not a networ error at all. I fixed apport's trunk to crash properly on this error instead of claiming it to be a network error. Unfortunately I cannot reproduce the actual issue with your attached .crash file.

Can you reproduce the error at will? If so, I'd like to hand you a test package which should give me more information about this problem.

summary: - apport could not connect to crash database
+ slice indices must be integers or None or have an __index__ method
Changed in apport (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Martin Pitt (pitti) wrote :

It apparently crashes somewhere in launchpad.py's upload(). But I went through all slices in launchpad.py, and none looks prone to invalid indexes, so right now I don't have a good guess what goes wrong. Presumably it's not directly in launchpad.py, but in giving bad data to the email module.

Can anyone who can reproduce this please download

http://bazaar.launchpad.net/~apport-hackers/apport/trunk/download/head:/crashdb_launchpad.py-20070509223526-qzyhddx1kp013rb4-1/launchpad.py

and install it with

 sudo cp launchpad.py /usr/share/pyshared/apport/crashdb_impl/

then do the steps which previously caused this error? Apport should now actually crash and leave behind a .crash file.

Revision history for this message
Erick Brunzell (lbsolost) wrote :

I still had my Ubuntu i386 20120626.1 disc laying here that I'd first seen this error with as reported in dup bug 1018032 so I booted it, DLed the requested file to /home, then ran the requested command.

Next I tried running ubuntu-bug apport which failed to reproduce this bug (but I filed bug 1018803 just to see what happened).

Next I ran ubuntu-bug casper which did reproduce this bug (screenshot attached), but I apparently either did something wrong or don't know where to find the .crash file :^(

I looked in /var/crash but it's empty, and I don't see it anywhere I look in /var/log or in /homes hidden dots.

Sorry for my ineptitude. At least I do know how to reproduce the error easily with that older iso.

Revision history for this message
Erick Brunzell (lbsolost) wrote :

Just came in to take a break and decided to try Ubuntu live i386 20120627 (presumably Alpha 2) to see if the above could be reproduced and it can be.

Just boot to the live desktop, open the terminal, and then run "ubuntu-bug casper".

I'm sure it can be reproduced with other methods, particularly with some of Lubuntu's ubiquity problems, but hopefully that info will help. I'll be glad to test anything recommended, just remember I'm an end user with almost no technical knowledge.

dino99 (9d9)
tags: added: i386
Revision history for this message
dino99 (9d9) wrote :

on Quantal i386 logged as gnome-classic

i also get nautilus crashing on logout, but i cant report because of this error:

slice indices must be integers or None or have an __index__ method

Revision history for this message
Martin Pitt (pitti) wrote :

I tried this on the 20120627 i386 and amd64 Ubuntu live system (I think that's exactly the same image as you did), in kvm. First right after booting into the live desktop, and a second time after "sudo apt-get update". I also tried it on my workstation (current Quantal amd64).

In each of those I ran "ubuntu-bug casper", and clicked Send; I got the upload progress dialog, and was sent to Firefox. In no case did I get that error message.

By the looks of your screenshot you are also using some virtual machine like KVM, or using Ethernet?

So I'm puzzled now what could be different. The main thing that comes to my mind is: Are you using a proxy on your host machine (i. e. not in the live system guest)?

I'm afraid I gave you the wrong file for debugging this more closely, sorry about that. Can you please boot the live system again, run these two commands in a terminal:

 wget http://people.canonical.com/~pitti/tmp/ui.py
 sudo cp ui.py /usr/lib/python3/dist-packages/apport/

and then reproduce the situation again? If you then get an apport crash file in /var/crash/, please attach it. If you see any output from that ubuntu-bug command in the terminal, please copy&paste it here.

Thank you!

Revision history for this message
Erick Brunzell (lbsolost) wrote :

@ Martin,

The tests I performed in both comment #11 and #12 were done using a live CD, not an installed version of Ubuntu. But I'd seen this in Lubuntu after installation, presumably due to a grub-install error during installation.

I'm just headed off to bed ATM (too tired to make sense of anything) but I'll give this a look again tomorrow. We'll get there ;^)

description: updated
Revision history for this message
Sasa Paporovic (melchiaros) wrote :

Request from commen 14

https://bugs.launchpad.net/ubuntu/+source/apport/+bug/1013334/comments/14

------------------------------------------------------------------
 I will attach the xsane.crash file from this reproducing.

Your are correct, I use VirtualBox4.1.18 from Felix Greyers repositorie for runnign Quantal on a Precise platform(64bit).

The console output is:

user@user-VirtualBox:/var/crash$ ubuntu-bug _usr_bin_xsane.1000.crash
Traceback (most recent call last):
  File "/usr/share/apport/apport-gtk", line 529, in <module>
    app.run_argv()
  File "/usr/lib/python3/dist-packages/apport/ui.py", line 573, in run_argv
    self.run_crash(self.options.crash_file, False)
  File "/usr/lib/python3/dist-packages/apport/ui.py", line 290, in run_crash
    self.file_report()
  File "/usr/lib/python3/dist-packages/apport/ui.py", line 1032, in file_report
    upthread.exc_raise()
  File "/usr/lib/python3/dist-packages/apport/REThread.py", line 65, in exc_raise
    raise self._exception[0](self._exception[1]).with_traceback(self._exception[2])
  File "/usr/lib/python3/dist-packages/apport/REThread.py", line 35, in run
    self._retval = self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python3/dist-packages/apport/crashdb_impl/launchpad.py", line 222, in upload
    hostname=self.get_hostname())
  File "/usr/lib/python3/dist-packages/apport/crashdb_impl/launchpad.py", line 1027, in upload_blob
    result = opener.open(req)
  File "/usr/lib/python3.2/urllib/request.py", line 369, in open
    response = self._open(req, data)
  File "/usr/lib/python3.2/urllib/request.py", line 387, in _open
    '_open', req)
  File "/usr/lib/python3.2/urllib/request.py", line 347, in _call_chain
    result = func(*args)
  File "/usr/lib/python3/dist-packages/apport/crashdb_impl/launchpad.py", line 980, in https_open
    return self.do_open(HTTPSProgressConnection, req)
  File "/usr/lib/python3.2/urllib/request.py", line 1135, in do_open
    h.request(req.get_method(), req.selector, req.data, headers)
  File "/usr/lib/python3.2/http/client.py", line 967, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.2/http/client.py", line 1005, in _send_request
    self.endheaders(body)
  File "/usr/lib/python3.2/http/client.py", line 963, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.2/http/client.py", line 808, in _send_output
    self.send(msg)
  File "/usr/lib/python3/dist-packages/apport/crashdb_impl/launchpad.py", line 965, in send
    HTTPSConnection.send(self, data[sent:(sent + chunksize)])
TypeError: slice indices must be integers or None or have an __index__ method
user@user-VirtualBox:/var/crash$

Revision history for this message
Sasa Paporovic (melchiaros) wrote :
Changed in apport (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Sasa Paporovic (melchiaros) wrote :

Additional in moment I could not upload with success any crashreport.

So, the problem is not limited to the xsane crash I have attached here.

Revision history for this message
Erick Brunzell (lbsolost) wrote :
Download full text (3.2 KiB)

Just finally giving this a new look but the heat wave here is both cooking my brain and causing frequent power outages so I need to post things in rather incomplete bits and pieces, just bear with me :^(

I specifically wanted to post this terminal output before searching for the .crash file:

ubuntu@ubuntu:~$ wget http://people.canonical.com/~pitti/tmp/ui.py
--2012-06-29 17:43:16-- http://people.canonical.com/~pitti/tmp/ui.py
Resolving people.canonical.com (people.canonical.com)... 91.189.89.62
Connecting to people.canonical.com (people.canonical.com)|91.189.89.62|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 57183 (56K) [text/x-python]
Saving to: `ui.py'

100%[======================================>] 57,183 111K/s in 0.5s

2012-06-29 17:43:19 (111 KB/s) - `ui.py' saved [57183/57183]

ubuntu@ubuntu:~$ sudo cp ui.py /usr/lib/python3/dist-packages/apport/
ubuntu@ubuntu:~$ ubuntu-bug casper
Traceback (most recent call last):
  File "/usr/share/apport/apport-gtk", line 529, in <module>
    app.run_argv()
  File "/usr/lib/python3/dist-packages/apport/ui.py", line 565, in run_argv
    return self.run_report_bug()
  File "/usr/lib/python3/dist-packages/apport/ui.py", line 408, in run_report_bug
    self.file_report()
  File "/usr/lib/python3/dist-packages/apport/ui.py", line 1032, in file_report
    upthread.exc_raise()
  File "/usr/lib/python3/dist-packages/apport/REThread.py", line 65, in exc_raise
    raise self._exception[0](self._exception[1]).with_traceback(self._exception[2])
  File "/usr/lib/python3/dist-packages/apport/REThread.py", line 35, in run
    self._retval = self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python3/dist-packages/apport/crashdb_impl/launchpad.py", line 222, in upload
    hostname=self.get_hostname())
  File "/usr/lib/python3/dist-packages/apport/crashdb_impl/launchpad.py", line 1027, in upload_blob
    result = opener.open(req)
  File "/usr/lib/python3.2/urllib/request.py", line 369, in open
    response = self._open(req, data)
  File "/usr/lib/python3.2/urllib/request.py", line 387, in _open
    '_open', req)
  File "/usr/lib/python3.2/urllib/request.py", line 347, in _call_chain
    result = func(*args)
  File "/usr/lib/python3/dist-packages/apport/crashdb_impl/launchpad.py", line 980, in https_open
    return self.do_open(HTTPSProgressConnection, req)
  File "/usr/lib/python3.2/urllib/request.py", line 1135, in do_open
    h.request(req.get_method(), req.selector, req.data, headers)
  File "/usr/lib/python3.2/http/client.py", line 967, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.2/http/client.py", line 1005, in _send_request
    self.endheaders(body)
  File "/usr/lib/python3.2/http/client.py", line 963, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.2/http/client.py", line 808, in _send_output
    self.send(msg)
  File "/usr/lib/python3/dist-packages/apport/crashdb_impl/launchpad.py", line 965, in send
    HTTPSConnection.send(self, data[sent:(sent + chunksize)])
TypeError: slice indices must be integers or None or have an __index__ method
ubuntu@ubuntu:~$

In case the power goes out again ...

Read more...

Revision history for this message
Erick Brunzell (lbsolost) wrote :

No luck finding the .crash file, probably due to my own ineptitude.

I'm testing on actual hardware with a burned DVD and a wired DSL connection:

VIA C7 CPU @ 1500MHz
VIA CN700/P4M800 Pro/P4M800 CE/VN800 Graphics [S3 UniChrome Pro] (rev 01)
VIA VT8233/A/8235/8237 AC97 Audio Controller (rev 60)
Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 78)
1GB DDR2 RAM

I do always check the md5sum and the disc integrity.

I'll repeat this on a different box to see if I get the same behavior.

Revision history for this message
Erick Brunzell (lbsolost) wrote :

On my Intel box:

ubuntu@ubuntu:~$ wget http://people.canonical.com/~pitti/tmp/ui.py
--2012-06-29 19:09:15-- http://people.canonical.com/~pitti/tmp/ui.py
Resolving people.canonical.com (people.canonical.com)... 91.189.89.62
Connecting to people.canonical.com (people.canonical.com)|91.189.89.62|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 57183 (56K) [text/x-python]
Saving to: `ui.py'

100%[======================================>] 57,183 112K/s in 0.5s

2012-06-29 19:09:18 (112 KB/s) - `ui.py' saved [57183/57183]

ubuntu@ubuntu:~$ sudo cp ui.py /usr/lib/python3/dist-packages/apport/
ubuntu@ubuntu:~$ ubuntu-bug casper
Traceback (most recent call last):
  File "/usr/share/apport/apport-gtk", line 529, in <module>
    app.run_argv()
  File "/usr/lib/python3/dist-packages/apport/ui.py", line 565, in run_argv
    return self.run_report_bug()
  File "/usr/lib/python3/dist-packages/apport/ui.py", line 408, in run_report_bug
    self.file_report()
  File "/usr/lib/python3/dist-packages/apport/ui.py", line 1032, in file_report
    upthread.exc_raise()
  File "/usr/lib/python3/dist-packages/apport/REThread.py", line 65, in exc_raise
    raise self._exception[0](self._exception[1]).with_traceback(self._exception[2])
  File "/usr/lib/python3/dist-packages/apport/REThread.py", line 35, in run
    self._retval = self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python3/dist-packages/apport/crashdb_impl/launchpad.py", line 222, in upload
    hostname=self.get_hostname())
  File "/usr/lib/python3/dist-packages/apport/crashdb_impl/launchpad.py", line 1027, in upload_blob
    result = opener.open(req)
  File "/usr/lib/python3.2/urllib/request.py", line 369, in open
    response = self._open(req, data)
  File "/usr/lib/python3.2/urllib/request.py", line 387, in _open
    '_open', req)
  File "/usr/lib/python3.2/urllib/request.py", line 347, in _call_chain
    result = func(*args)
  File "/usr/lib/python3/dist-packages/apport/crashdb_impl/launchpad.py", line 980, in https_open
    return self.do_open(HTTPSProgressConnection, req)
  File "/usr/lib/python3.2/urllib/request.py", line 1135, in do_open
    h.request(req.get_method(), req.selector, req.data, headers)
  File "/usr/lib/python3.2/http/client.py", line 967, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.2/http/client.py", line 1005, in _send_request
    self.endheaders(body)
  File "/usr/lib/python3.2/http/client.py", line 963, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.2/http/client.py", line 808, in _send_output
    self.send(msg)
  File "/usr/lib/python3/dist-packages/apport/crashdb_impl/launchpad.py", line 965, in send
    HTTPSConnection.send(self, data[sent:(sent + chunksize)])
TypeError: slice indices must be integers or None or have an __index__ method
ubuntu@ubuntu:~$

Hardware profile:

Intel Atom CPU 230 @ 1.60GHz
Intel 82945G/GZ Integrated Graphics Controller (rev 02)
Intel N10/ICH 7 Family High Definition Audio Controller (rev 01)
Realtek RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)
2GB DDR2 RAM

Revision history for this message
Sasa Paporovic (melchiaros) wrote :

With the updates from today(no apport ones, but many other) apport has got some functionality back.

It can connect to launchpad in general now on my system.

Apport crashed now on the attached xsane.crash file and is able to detect it's own crash and could report it here:

https://bugs.launchpad.net/ubuntu/+source/apport/+bug/1019543

Revision history for this message
dino99 (9d9) wrote :

Still cant report a crash on quantal i386 if i select "report this error"

i get the error filled on title, but also:

ERROR: hook /usr/share/apport/general-hooks/medibuntu.py crashed:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport/report.py", line 747, in add_hooks_info
    exec(compile(fd.read(), hook, 'exec'), symb)
  File "/usr/share/apport/general-hooks/medibuntu.py", line 17
    except ValueError, e:
                     ^
SyntaxError: invalid syntax
ERROR: hook /usr/share/apport/package-hooks//source_nautilus.py crashed:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport/report.py", line 799, in add_hooks_info
    symb['add_info'](self, ui)
TypeError: add_info() takes exactly 1 positional argument (2 given)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport/report.py", line 804, in add_hooks_info
    symb['add_info'](self)
  File "/usr/share/apport/package-hooks//source_nautilus.py", line 6, in add_info
    if report.has_key("Stacktrace") and "/usr/lib/nautilus" in report["Stacktrace"]:
AttributeError: 'Report' object has no attribute 'has_key'

so maybe those are giving that "slice indices must be integers or None or have an __index__ method"

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks for the updated traces! This was indeed very helpful. This apparently happens if the data upload is either very slow, or gets interrupted due to network hangs. I believe I fixed this now in trunk.

If you want to test it immediately, you can do

wget http://bazaar.launchpad.net/~apport-hackers/apport/trunk/download/head:/crashdb_launchpad.py-20070509223526-qzyhddx1kp013rb4-1/launchpad.py
sudo cp launchpad.py /usr/lib/python3/dist-packages/apport/crashdb_impl/
and install it with

 sudo cp launchpad.py /usr/share/pyshared/apport/crashdb_impl/

Thanks!

Changed in apport (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
importance: Undecided → High
status: Confirmed → Fix Committed
Revision history for this message
dino99 (9d9) wrote :

Thanks Martin,

add some more comments:

- there is no network speed issue here
- some crash reports can be filled without trouble
- but some others push that error, like nautilus & gnome-panel crashes

so its strange.

Revision history for this message
Martin Pitt (pitti) wrote : Re: [Bug 1013334] Re: slice indices must be integers or None or have an __index__ method

dino99 [2012-07-03 11:39 -0000]:
> - there is no network speed issue here
> - some crash reports can be filled without trouble
> - but some others push that error, like nautilus & gnome-panel crashes
>
> so its strange.

It's more prone to happen for larger reports. It would happen as soon
as transferring a block would take longer than the previous one and
longer than two seconds.

If you are interested in the specifics, Python 3's division works
differently from Python 2's; in Python 2, 1024/2 was an integer "512"
(which is a valid array index), while in Python 3 it is a float
"512.0" which is not a valid array index.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.3-0ubuntu1

---------------
apport (2.3-0ubuntu1) quantal; urgency=low

  * New upstream release:
    - launchpad.py: Rework test suite to not use Launchpad's +storeblob
      facility at all any more. It almost never works on staging and is
      horribly slow. Fake the bug creation from a blob by manually creating
      the comment and attachments ourselves, and just assume that storeblob
      works on production. Also change the structure to allow running every
      test individually.
    - crash-digger: Add --crash-db option to specify a non-default crash
      database name. (LP: #1003506)
    - apport-gtk: Add --hanging option to specify the process ID of a hanging
      application. If the user chooses to report this error, apport will
      terminate the pid with SIGABRT, otherwise it will send SIGKILL. The
      normal core pipe handler will be used to process the resulting report
      file, with a .hanging file in /var/crash to separate these from regular
      crashes.
    - apport: Also treat a binary as modified if the /proc/pid/exe symlink
      does not point to an existing file any more. (LP: #984944)
    - Fix PEP-8 violations picked up by latest pep8 checker.
    - ui.py: Do not ignore certain exceptions during upload which are not
      likely to be a network error.
    - launchpad.py: Recongize Launchpad projects for bug query and marking
      operations. (LP: #1003506)
    - packaging-apt-dpkg.py: Fix get_source_tree() to work with apt sandboxes.
    - apport-retrace: Turn StacktraceSource generation back on, now that it
      works with the current sandboxing.
    - launchpad.py: Ensure that upload chunk size does not underrun.
      (LP: #1013334)
    - apport_python_hook: Fix UnicodeEncodeError crash with Python 2 for
      exceptions with non-ASCII characters. (LP: #972436)
    - test_ui_kde.py: Fix occasional test failure in test_1_crash_details if
      the application ends before the "is progress bar visible" check is done.
 -- Martin Pitt <email address hidden> Mon, 09 Jul 2012 08:14:30 +0200

Changed in apport (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.