[Bug 1893574] [NEW] After creating a img and making it bootable bug occurs

Kyle Kelley 1893574 at bugs.launchpad.net
Sun Aug 30 20:07:59 UTC 2020


Public bug reported:

Ubiquity Crashes when entering user info in the UEFI version of a
bootable install. This is made from ubuntu 20.04 and will crash each
time it reaches this location.


read out form terminal when i enter ubuntu-bug ubiquity :
ERROR: hook /usr/share/apport/package-hooks/source_ubiquity.py crashed:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport/report.py", line 225, in _run_hook
    symb['add_info'](report, ui)
  File "/usr/share/apport/package-hooks/source_ubiquity.py", line 65, in add_info
    add_installation_log(report, 'UbiquitySyslog', 'syslog')
  File "/usr/share/apport/package-hooks/source_ubiquity.py", line 29, in add_installation_log
    if isinstance(report[ident], bytes):
  File "/usr/lib/python3.8/collections/__init__.py", line 1003, in __getitem__
    raise KeyError(key)
KeyError: 'UbiquitySyslog'

below i took the segments of the files that are reported as the issue
and labeled the lines

 usr/lib/python3/dist-packages/apport/report.py

def _run_hook(report, ui, hook):
    if not os.path.exists(hook):
        return False

    symb = {}
    try:
        with open(hook) as fd:
            exec(compile(fd.read(), hook, 'exec'), symb)
        try:
            symb['add_info'](report, ui) 225
        except TypeError as e:
            if str(e).startswith('add_info()'):
                # older versions of apport did not pass UI, and hooks that
                # do not require it don't need to take it
                symb['add_info'](report)
            else:
                raise
    except StopIteration:
        return True
    except Exception:
        hookname = os.path.splitext(os.path.basename(hook))[0].replace('-', '_')
        report['HookError_' + hookname] = traceback.format_exc()
        apport.error('hook %s crashed:', hook)
        traceback.print_exc()

    return False
    
usr/share/apport/package-hooks/source_ubiquity.py
def add_info(report, ui):
    add_installation_log(report, 'UbiquitySyslog', 'syslog') 65
    syslog = report['UbiquitySyslog']
    if 'Buffer I/O error on device' in syslog:
        if re.search('Attached .* CD-ROM (\\w+)', syslog):
            cd_drive = re.search('Attached .* CD-ROM (\\w+)', syslog).group(1)
            cd_error = re.search('Buffer I/O error on device %s' % cd_drive, syslog)
        else:
            cd_error = None
        if cd_error:

ui.information("The system log from your installation contains an error.
The specific error commonly occurs when there is an issue with the media
from which you were installing.  This can happen when your media is
dirty or damaged or when you've burned the media at a high speed.
Please try cleaning the media and or burning new media at a lower speed.
In the event that you continue to encounter these errors it may be an
issue with your CD / DVD drive.")

usr/share/apport/package-hooks/source_ubiquity.py
def add_installation_log(report, ident, name):
    f = False
    for try_location in ('/var/log/installer/%s',
                         '/var/log/%s',
                         '/var/log/upstart/%s'):
        if os.path.exists(try_location % name):
            f = try_location % name
            break
    if not f:
        return

    if os.access(f, os.R_OK):
        with open(f, 'rb') as f:
            report[ident] = f.read().decode('UTF-8', 'replace')
    elif os.path.exists(f):
        apport.hookutils.attach_root_command_outputs(report, {ident: "cat '%s'" % f})

    if isinstance(report[ident], bytes):  line 29
        try:
            report[ident] = report[ident].decode('UTF-8', 'replace')
        except (UnicodeDecodeError, KeyError):
            Pass

/usr/lib/python3.8/collections/__init__.py
def __getitem__(self, key):
        if key in self.data:
            return self.data[key]
        if hasattr(self.__class__, "__missing__"):
            return self.__class__.__missing__(self, key)
        raise KeyError(key) 1003

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: ubiquity 20.04.15.2 [modified: usr/bin/ubiquity usr/share/ubiquity/plugininstall.py]
ProcVersionSignature: Ubuntu 5.4.0-42.46-generic 5.4.44
Uname: Linux 5.4.0-42-generic x86_64
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Sun Aug 30 15:24:13 2020
InstallationDate: Installed on 2020-08-30 (0 days ago)
InstallationMedia:
 
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=C.UTF-8
 SHELL=/bin/bash
SourcePackage: ubiquity
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: ubiquity (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug focal

** Attachment added: "Screenshot from 2020-08-30 15-31-43.png"
   https://bugs.launchpad.net/bugs/1893574/+attachment/5405894/+files/Screenshot%20from%202020-08-30%2015-31-43.png

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ubiquity in Ubuntu.
https://bugs.launchpad.net/bugs/1893574

Title:
  After creating a img and making it bootable bug occurs

Status in ubiquity package in Ubuntu:
  New

Bug description:
  Ubiquity Crashes when entering user info in the UEFI version of a
  bootable install. This is made from ubuntu 20.04 and will crash each
  time it reaches this location.

  
  read out form terminal when i enter ubuntu-bug ubiquity :
  ERROR: hook /usr/share/apport/package-hooks/source_ubiquity.py crashed:
  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/apport/report.py", line 225, in _run_hook
      symb['add_info'](report, ui)
    File "/usr/share/apport/package-hooks/source_ubiquity.py", line 65, in add_info
      add_installation_log(report, 'UbiquitySyslog', 'syslog')
    File "/usr/share/apport/package-hooks/source_ubiquity.py", line 29, in add_installation_log
      if isinstance(report[ident], bytes):
    File "/usr/lib/python3.8/collections/__init__.py", line 1003, in __getitem__
      raise KeyError(key)
  KeyError: 'UbiquitySyslog'

  below i took the segments of the files that are reported as the issue
  and labeled the lines

   usr/lib/python3/dist-packages/apport/report.py

  def _run_hook(report, ui, hook):
      if not os.path.exists(hook):
          return False

      symb = {}
      try:
          with open(hook) as fd:
              exec(compile(fd.read(), hook, 'exec'), symb)
          try:
              symb['add_info'](report, ui) 225
          except TypeError as e:
              if str(e).startswith('add_info()'):
                  # older versions of apport did not pass UI, and hooks that
                  # do not require it don't need to take it
                  symb['add_info'](report)
              else:
                  raise
      except StopIteration:
          return True
      except Exception:
          hookname = os.path.splitext(os.path.basename(hook))[0].replace('-', '_')
          report['HookError_' + hookname] = traceback.format_exc()
          apport.error('hook %s crashed:', hook)
          traceback.print_exc()

      return False
      
  usr/share/apport/package-hooks/source_ubiquity.py
  def add_info(report, ui):
      add_installation_log(report, 'UbiquitySyslog', 'syslog') 65
      syslog = report['UbiquitySyslog']
      if 'Buffer I/O error on device' in syslog:
          if re.search('Attached .* CD-ROM (\\w+)', syslog):
              cd_drive = re.search('Attached .* CD-ROM (\\w+)', syslog).group(1)
              cd_error = re.search('Buffer I/O error on device %s' % cd_drive, syslog)
          else:
              cd_error = None
          if cd_error:

  ui.information("The system log from your installation contains an
  error.  The specific error commonly occurs when there is an issue with
  the media from which you were installing.  This can happen when your
  media is dirty or damaged or when you've burned the media at a high
  speed.  Please try cleaning the media and or burning new media at a
  lower speed.  In the event that you continue to encounter these errors
  it may be an issue with your CD / DVD drive.")

  usr/share/apport/package-hooks/source_ubiquity.py
  def add_installation_log(report, ident, name):
      f = False
      for try_location in ('/var/log/installer/%s',
                           '/var/log/%s',
                           '/var/log/upstart/%s'):
          if os.path.exists(try_location % name):
              f = try_location % name
              break
      if not f:
          return

      if os.access(f, os.R_OK):
          with open(f, 'rb') as f:
              report[ident] = f.read().decode('UTF-8', 'replace')
      elif os.path.exists(f):
          apport.hookutils.attach_root_command_outputs(report, {ident: "cat '%s'" % f})

      if isinstance(report[ident], bytes):  line 29
          try:
              report[ident] = report[ident].decode('UTF-8', 'replace')
          except (UnicodeDecodeError, KeyError):
              Pass

  /usr/lib/python3.8/collections/__init__.py
  def __getitem__(self, key):
          if key in self.data:
              return self.data[key]
          if hasattr(self.__class__, "__missing__"):
              return self.__class__.__missing__(self, key)
          raise KeyError(key) 1003

  ProblemType: Bug
  DistroRelease: Ubuntu 20.04
  Package: ubiquity 20.04.15.2 [modified: usr/bin/ubiquity usr/share/ubiquity/plugininstall.py]
  ProcVersionSignature: Ubuntu 5.4.0-42.46-generic 5.4.44
  Uname: Linux 5.4.0-42-generic x86_64
  ApportVersion: 2.20.11-0ubuntu27
  Architecture: amd64
  CasperMD5CheckResult: skip
  CurrentDesktop: ubuntu:GNOME
  Date: Sun Aug 30 15:24:13 2020
  InstallationDate: Installed on 2020-08-30 (0 days ago)
  InstallationMedia:
   
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=C.UTF-8
   SHELL=/bin/bash
  SourcePackage: ubiquity
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1893574/+subscriptions



More information about the foundations-bugs mailing list