apport-retrace sandbox can not be used with https mirrors in sources.list

Bug #1866996 reported by Esokrates
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Apport
Fix Released
Undecided
Unassigned
apport (Ubuntu)
Fix Released
Medium
Brian Murray

Bug Description

If /etc/apt/sources.list only contains https mirrors (and not a single http:// entry), then apport-retrace fails to determine the default mirror:

apport-retrace -v -s -R -S system ./crash/_usr_bin_gnome-shell.1000.crash
Ign http://ddebs.ubuntu.com focal InRelease
Get:1 http://ppa.launchpad.net/saiarcot895/chromium-dev/ubuntu focal InRelease [20.8 kB]
Get:2 http://ddebs.ubuntu.com focal Release [34.7 kB]
Get:3 https://mirror.init7.net/ubuntu focal InRelease [255 kB]
Get:4 http://ddebs.ubuntu.com focal Release.gpg [819 B]
Get:5 http://ddebs.ubuntu.com focal/main amd64 Packages [526 kB]
Get:6 http://ppa.launchpad.net/saiarcot895/chromium-dev/ubuntu focal/main amd64 Packages [1604 B]
Get:7 https://mirror.init7.net/ubuntu focal-updates InRelease [79.7 kB]
Get:8 http://ppa.launchpad.net/saiarcot895/chromium-dev/ubuntu focal/main Translation-en [1084 B]
Get:9 https://mirror.init7.net/ubuntu focal-backports InRelease [79.7 kB]
Get:10 https://mirror.init7.net/ubuntu focal-security InRelease [79.7 kB]
Get:11 https://mirror.init7.net/ubuntu focal/multiverse Sources [175 kB]
Get:12 http://ddebs.ubuntu.com focal/universe amd64 Packages [4435 kB]
Get:13 https://mirror.init7.net/ubuntu focal/restricted Sources [7032 B]
Get:14 https://mirror.init7.net/ubuntu focal/universe Sources [9784 kB]
Get:15 http://ddebs.ubuntu.com focal/multiverse amd64 Packages [67.0 kB]
Get:16 https://mirror.init7.net/ubuntu focal/main Sources [839 kB]
Get:17 https://mirror.init7.net/ubuntu focal/main amd64 Packages [976 kB]
Get:18 https://mirror.init7.net/ubuntu focal/main Translation-en [503 kB]
Get:19 https://mirror.init7.net/ubuntu focal/main amd64 DEP-11 Metadata [517 kB]
Get:20 https://mirror.init7.net/ubuntu focal/main DEP-11 48x48 Icons [93.7 kB]
Get:21 https://mirror.init7.net/ubuntu focal/main DEP-11 64x64 Icons [164 kB]
Get:22 https://mirror.init7.net/ubuntu focal amd64 Contents (deb) [41.2 MB]
Get:23 https://mirror.init7.net/ubuntu focal/restricted amd64 Packages [21.5 kB]
Get:24 https://mirror.init7.net/ubuntu focal/restricted Translation-en [6136 B]
Get:25 https://mirror.init7.net/ubuntu focal/universe amd64 Packages [8623 kB]
Get:26 https://mirror.init7.net/ubuntu focal/universe Translation-en [5154 kB]
Get:27 https://mirror.init7.net/ubuntu focal/universe amd64 DEP-11 Metadata [3619 kB]
Get:28 https://mirror.init7.net/ubuntu focal/universe DEP-11 48x48 Icons [3005 kB]
Get:29 https://mirror.init7.net/ubuntu focal/universe DEP-11 64x64 Icons [7981 kB]
Get:30 https://mirror.init7.net/ubuntu focal/multiverse amd64 Packages [145 kB]
Get:31 https://mirror.init7.net/ubuntu focal/multiverse Translation-en [105 kB]
Get:32 https://mirror.init7.net/ubuntu focal/multiverse amd64 DEP-11 Metadata [45.0 kB]
Get:33 https://mirror.init7.net/ubuntu focal/multiverse DEP-11 48x48 Icons [17.6 kB]
Get:34 https://mirror.init7.net/ubuntu focal/multiverse DEP-11 64x64 Icons [195 kB]
Fetched 88.8 MB in 6s (1341 kB/s)
Fetched 0 B in 0s (0 B/s)
Extracting downloaded debs...
Traceback (most recent call last):
  File "/usr/bin/apport-retrace", line 322, in <module>
    sandbox, cache, outdated_msg = apport.sandboxutils.make_sandbox(
  File "/usr/lib/python3/dist-packages/apport/sandboxutils.py", line 220, in make_sandbox
    pkgs = needed_runtime_packages(report, sandbox_dir, pkgmap_cache_dir, pkg_versions, verbose)
  File "/usr/lib/python3/dist-packages/apport/sandboxutils.py", line 92, in needed_runtime_packages
    pkg = apport.packaging.get_file_package(l, True, pkgmap_cache_dir,
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 490, in get_file_package
    return self._search_contents(file, map_cachedir, release, arch)
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 1296, in _search_contents
    url = '%s/dists/%s%s/Contents-%s.gz' % (self._get_mirror(), release, pocket, arch)
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 1252, in _get_mirror
    self._mirror = self._get_primary_mirror_from_apt_sources('/etc/apt/sources.list')
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 1242, in _get_primary_mirror_from_apt_sources
    raise SystemError('cannot determine default mirror: %s does not contain a valid deb line'
SystemError: cannot determine default mirror: /etc/apt/sources.list does not contain a valid deb line

Tested with Ubuntu 20.04 fully upgraded as of March 14 2020.
You can find all relevant files attached in the tar archive attached to comment #10.

This description is updated, comments #2 - #4 shall be ignored, another bug was opened for unrelated issues.

Tags: focal patch
Revision history for this message
Esokrates (esokrarkose) wrote :

Fix for https mirros in sources.list, tested successfully

tags: added: focal
Revision history for this message
Esokrates (esokrarkose) wrote :
Download full text (12.2 KiB)

The attached patch makes stacktraces a lot more informative in my case, tested with

apport-retrace -v -s -R -S system _usr_bin_texstudio.1000.crash

Without the patch I get:

--- stack trace ---
#0 0x00007fa95a8273eb in ?? ()
No symbol table info available.
#1 0x0000000000000000 in ?? ()
No symbol table info available.
--- source code stack trace ---
#0 0x00007fa95a8273eb in ?? ()
#1 0x0000000000000000 in ?? ()

which is completely useless.

With the patch applied I get

--- stack trace ---
#0 0x00007fa95a8273eb in raise () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1 0x00007fa95a806899 in abort () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#2 0x00007fa95adc5aaf in qt_message_fatal (context=..., message=<synthetic pointer>...) at global/qlogging.cpp:1907
No locals.
#3 QMessageLogger::fatal (this=this@entry=0x7ffc551f5df0, msg=msg@entry=0x7fa95bc45d17 "%s") at global/qlogging.cpp:888
        message = <optimized out>
        ap = {{gp_offset = 24, fp_offset = 48, overflow_arg_area = 0x7ffc551f5cf0, reg_save_area = 0x7ffc551f5c30}}
#4 0x00007fa95b8607c7 in init_platform (argv=<optimized out>, argc=@0x7ffc551f602c: 1, platformThemeName=..., platformPluginPath=..., pluginNamesWithArguments=...) at ../../include/QtCore/../../src/corelib/tools/qarraydata.h:208
        fatalMessage = {static null = {<No data fields>}, d = 0x565091eea860}
        plugins = {<QList<QString>> = {<QListSpecialMethods<QString>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = -1}, static is_always_lock_free = true}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x565091ee9840}, d = 0x565091ee9840}}, <No data fields>}
        platformArguments = {<QList<QString>> = {<QListSpecialMethods<QString>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = -1}, static is_always_lock_free = true}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x7fa95b0a8780 <QListData::shared_null>}, d = 0x7fa95b0a8780 <QListData::shared_null>}}, <No data fields>}
        availablePlugins = {<QList<QString>> = {<QListSpecialMethods<QString>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = -1}, static is_always_lock_free = true}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x565091eeace0}, d = 0x565091eeace0}}, <No data fields>}
        themeNames = {<QList<QString>> = {<QListSpecialMethods<QString>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = -1}, static is_always_lock_free = true}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x565091eea860}, d = 0x565091eea860}}, <No data fields>}
        plugins = <optimized out>
        platformArguments = <optimized out>
        availablePlugins = <optimized out>
        themeNames = <optimized out>
        pluginArgument = <optimized out>
        __for_range = <optimized out>
        __for_begin = <optimiz...

Revision history for this message
Esokrates (esokrarkose) wrote :

This is the crash file from comment #2.

Revision history for this message
Esokrates (esokrarkose) wrote :

Note that in the end the source code stack trace contained many errors such as "Error: qlogging.cpp was not found in source tree".

Also note that there are a lot "No symbol table info available." for files such as /lib/x86_64-linux-gnu/libc.so.6, lib/x86_64-linux-gnu/libglib-2.0.so.0, etc. so it seems everything located in /lib does not get debug symbols in the sandbox.

Revision history for this message
Brian Murray (brian-murray) wrote :

Thanks for using apport and finding / digging into these issues. I'd appreciate it if there were separate bugs for each issue that you've found so we can better track the fixing of them.

While your https patch looks good and makes sense I'm puzzled that I am not able to recreate the issue you are experiencing. As I understand it you are running 20.04, what version of apport are you using?

Lets go ahead and use this bug for the https issue.

Changed in apport:
status: New → Incomplete
Revision history for this message
Esokrates (esokrarkose) wrote :

Brian, if you use this issue for the https issue, why is it marked incomplete then?
But I guess the https issue does not need further discussion, could you just ship the patch?

I am using the latest version of apport in the focal repos. Did you try to retrace my texstudio crash and obtained a full backtrace?

Revision history for this message
Brian Murray (brian-murray) wrote :

I used your sources.list file and your texstudio crash and did not receive the "cannot determine default mirror" error message. Although I haven't been able to recreate the error which you received I'll go ahead and add the patch anyway.

summary: - Apport-retrace sandbox has multiple issues
+ apport-retrace can not be used with https mirrors in sources.list
Changed in apport (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Changed in apport:
status: Incomplete → Triaged
Changed in apport (Ubuntu):
assignee: nobody → Brian Murray (brian-murray)
status: Triaged → Fix Committed
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote : Re: apport-retrace can not be used with https mirrors in sources.list

The attachment "fix-https.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Esokrates (esokrarkose) wrote :

@Brian: Thanks for merging the patch. As for reproducing the https issue: The issue happens if ALL entries in fstab are https mirrors, like

deb https://mirror.init7.net/ubuntu/ focal main restricted universe multiverse
deb-src https://mirror.init7.net/ubuntu/ focal main restricted universe multiverse

deb https://mirror.init7.net/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirror.init7.net/ubuntu/ focal-updates main restricted universe multiverse

deb https://mirror.init7.net/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirror.init7.net/ubuntu/ focal-backports main restricted universe multiverse

deb https://mirror.init7.net/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirror.init7.net/ubuntu/ focal-security main restricted universe multiverse

The you will be 100% able to reproduce the error.

As for the other issues
1. Did you try to retrace my texstudio crash on focal machine in sandbox mode?
2. Did you obtain a backtrace without missing symboles?

As I mentioned in comment #2 just retracing the crash file with
apport-retrace -v -s -R -S system _usr_bin_texstudio.1000.crash gives me the following useless stack trace:

--- stack trace ---
#0 0x00007fa95a8273eb in ?? ()
No symbol table info available.
#1 0x0000000000000000 in ?? ()
No symbol table info available.
--- source code stack trace ---
#0 0x00007fa95a8273eb in ?? ()
#1 0x0000000000000000 in ?? ()

Revision history for this message
Esokrates (esokrarkose) wrote :

@Brian: I will open a separate bug for comment #9 soon, as this issue here is about the https issue.

Since you asked to reproduce please fully upgrade your focal installation and use the files as found in the attached tar archive.

Command to reproduce is:

apport-retrace -v -s -R -S system _usr_bin_gnome-shell.1000.crash

Esokrates (esokrarkose)
description: updated
summary: - apport-retrace can not be used with https mirrors in sources.list
+ apport-retrace sandbox can not be used with https mirrors in
+ sources.list
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.20.11-0ubuntu21

---------------
apport (2.20.11-0ubuntu21) focal; urgency=medium

  [ Brian Murray ]
  * backends/packaging-apt-dpkg.py: allow mirrors which are accessed via https
    in sources.list. Thanks to Launchpad user Esokrates for the fix.
    (LP: #1866996)
  * backends/packaging-apt-dpkg.py: when downloading packages from Launchpad
    do not require them to be authenticated.
  * test/test_backend_apt_dpkg.py: Fix check for connectivity and modify
    install from PPA test for a change in the PPA being tested.

  [ Matthieu Clemenceau ]
  * test/test_ui.py: Removed linux package version to fix autopkgtest with
    focal. Changed linux-5.4 and linux-signed-5.4 to linux and linux-signed

 -- Brian Murray <email address hidden> Thu, 12 Mar 2020 15:46:30 -0700

Changed in apport (Ubuntu):
status: Fix Committed → Fix Released
Esokrates (esokrarkose)
Changed in apport:
status: Triaged → 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.