The bug seems to be stemming from a conflict of wrong HTTP request
formatting of apport package and the latest version upgrade of multipart
package on Launchpad.

The current version of multipart package is strict in its input request
criteria, requiring the standard HTTP1.1 format, and rejecting any
request that doesn’t fit the standard
https://github.com/defnull/multipart/issues/55 . One of those standards
is the line breaks, which are enforced to be CRLF, as can be seen here
https://www.rfc-editor.org/rfc/rfc2616#section-2.2 .

The apport package meanwhile uses LF line endings in its HTTP requests
to Launchpad, which is done in its /crashdb_impl/launchpad.py file in
the upload_blob method (in line:1198) when the request was being
constructed and sent. Because of the wrong line break, the request fails
to parse properly on Launchpad and the returned response is broken for
the same reason which triggers the assert statement.

One of the simplest ways of solving this problem would be to update the
request creation part of the script to fit the HTTP1.1 standard and
change LF line breaks into CRLF line breaks. Even a simple req.data =
req.data.replace(b‘\n’, b’\r\n’) would work in the simplest cases, but a
more generalized approach would be preferred.

** Bug watch added: github.com/defnull/multipart/issues #55
   https://github.com/defnull/multipart/issues/55

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to apport in Ubuntu.
https://bugs.launchpad.net/bugs/2096327

Title:
  apport cannot upload blobs to launchpad - X-Launchpad-Blob-Token
  missing from http response -> "assert ticket"

Status in Launchpad itself:
  Confirmed
Status in apport package in Ubuntu:
  Confirmed

Bug description:
  The tale is slightly convoluted. After doing an "apt upgrade"
  yesterday, xsane and simple-scan started failing: scanner detected,
  but could not scan. Trying to report it with ubuntu-bug then crashed
  with the following error:

  $ sudo ubuntu-bug simple-scan
  Traceback (most recent call last):
    File "/usr/share/apport/apport-gtk", line 650, in <module>
      app.run_argv()
    File "/usr/lib/python3/dist-packages/apport/ui.py", line 917, in run_argv
      return self.run_report_bug()
             ^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/apport/ui.py", line 740, in 
run_report_bug
      self.file_report()
    File "/usr/lib/python3/dist-packages/apport/ui.py", line 1788, in 
file_report
      upthread.exc_raise()
    File "/usr/lib/python3/dist-packages/apport/REThread.py", line 67, in 
exc_raise
      raise self._exception[1].with_traceback(self._exception[2])
    File "/usr/lib/python3/dist-packages/apport/REThread.py", line 42, 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
      ticket = upload_blob(blob_file, progress_callback, 
hostname=self.get_hostname())
               
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/apport/crashdb_impl/launchpad.py", 
line 1246, in upload_blob
      assert ticket
             ^^^^^^
  AssertionError

  This is a blocker for me.

To manage notifications about this bug go to:
https://bugs.launchpad.net/launchpad/+bug/2096327/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to