Splitting above sources.list line results in:
['deb', '[', 'arch=riscv64', ']', 'http://ports.ubuntu.com/ubuntu-ports/', 
'lunar', 'main', 'restricted']

Method _get_primary_mirror_from_apt_sources() incorrectly assumes that
if the second field in the line starts with '[' the next field is the
mirror url. Instead the method should look for the matching ']'. The
field after ']' is the mirror.

    @staticmethod
    def _get_primary_mirror_from_apt_sources(apt_sources):
        """Heuristically determine primary mirror from an apt sources.list."""
        with open(apt_sources, encoding="utf-8") as f:
            for line in f:
                fields = line.split()
                if len(fields) >= 3 and fields[0] == "deb":
                    if fields[1].startswith("["):
                        # options given, mirror is in third field
                        mirror_idx = 2
                    else:
                        mirror_idx = 1
                    if fields[mirror_idx].startswith("http://";) or fields[
                        mirror_idx
                    ].startswith("https://";):
                        return fields[mirror_idx]

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

Title:
  https mirrors apport-retrace crashed with SystemError in
  _get_primary_mirror_from_apt_sources(): cannot determine default
  mirror: /etc/apt/sources.list does not contain a valid deb line

Status in apport package in Ubuntu:
  Confirmed

Bug description:
  1. Have other crash occur.
  2. Click retrace locally.
  3. apport-retrace crashes.

  The only thing I can think is it's the fact that i changed my mirror to:
  deb https://mirrors.ocf.berkeley.edu/ubuntu/ disco main restricted universe 
multiverse
  deb-src https://mirrors.ocf.berkeley.edu/ubuntu/ disco main restricted 
universe multiverse

  ProblemType: Crash
  DistroRelease: Ubuntu 19.04
  Package: apport-retrace 2.20.10-0ubuntu23
  ProcVersionSignature: Ubuntu 5.0.0-8.9-generic 5.0.1
  Uname: Linux 5.0.0-8-generic x86_64
  NonfreeKernelModules: nvidia_modeset nvidia
  ApportLog:
   ERROR: apport (pid 10677) Mon Apr  1 19:40:34 2019: called for pid 8661, 
signal 11, core limit 0, dump mode 1
   ERROR: apport (pid 10677) Mon Apr  1 19:40:34 2019: executable: 
/usr/bin/gedit (command line "/usr/bin/gedit --gapplication-service")
   ERROR: apport (pid 10677) Mon Apr  1 19:40:34 2019: debug: session gdbus 
call: (true,)
   
   ERROR: apport (pid 10677) Mon Apr  1 19:40:42 2019: wrote report 
/var/crash/_usr_bin_gedit.1000.crash
  ApportVersion: 2.20.10-0ubuntu23
  Architecture: amd64
  CrashReports:
   640:1000:117:8118520:2019-04-01 20:06:04.204469680 -0700:2019-04-01 
20:06:05.204469680 -0700:/var/crash/_usr_bin_gedit.1000.crash
   640:1000:117:23602:2019-04-01 20:06:21.172740697 -0700:2019-04-01 
20:06:22.172740697 -0700:/var/crash/_usr_bin_apport-retrace.1000.crash
  CurrentDesktop: ubuntu:GNOME
  Date: Mon Apr  1 20:06:22 2019
  ExecutablePath: /usr/bin/apport-retrace
  InstallationDate: Installed on 2018-04-14 (352 days ago)
  InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Alpha amd64 (20180414)
  InterpreterPath: /usr/bin/python3.7
  PackageArchitecture: all
  ProcCmdline: /usr/bin/python3 /usr/bin/apport-retrace -S system -C 
/home/username/.cache/apport/retrace -v --output 
/var/crash/_usr_bin_gedit.1000.crash /var/crash/_usr_bin_gedit.1000.crash
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, user)
   XDG_RUNTIME_DIR=<set>
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  Python3Details: /usr/bin/python3.7, Python 3.7.3, python3-minimal, 3.7.2-1
  PythonArgs: ['/usr/bin/apport-retrace', '-S', 'system', '-C', 
'/home/username/.cache/apport/retrace', '-v', '--output', 
'/var/crash/_usr_bin_gedit.1000.crash', '/var/crash/_usr_bin_gedit.1000.crash']
  PythonDetails: /usr/bin/python2.7, Python 2.7.16, python-minimal, 2.7.16-1
  SourcePackage: apport
  Title: apport-retrace crashed with SystemError in 
_get_primary_mirror_from_apt_sources(): cannot determine default mirror: 
/etc/apt/sources.list does not contain a valid deb line
  UpgradeStatus: Upgraded to disco on 2019-01-05 (86 days ago)
  UserGroups: adm cdrom dip libvirt lpadmin lxd plugdev sambashare sudo

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apport/+bug/1822712/+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