#241 Don't crash in image_checksum.py when we failed earlier in iso creation.
Closed: Fixed 7 years ago Opened 8 years ago by pbrobinson.

We crash in image_checksum.py when we actually failed the .iso creation long before in a runroot.

I believe there's possibly two issues:
1) probably should check the files we're expecting are there before trying to checksum something and crashing out in the process
2) maybe run the checksum part of the process as part of the actual iso creation part of the process. Not sure if checksumming in the runroot before transferred centrally might not be a good idea so it could be verified centrally to ensure a complete copy/no corruption moving from the runroot porcess -> central.

As a bonus, possibly a completely separate RFE needed, it would be good also to abort any dependent processes here as if media isn't available a bunch of dependent processes fail too [1] when they really just shouldn't be run (let me know if you want this split into multiple issues).

http://ppc.koji.fedoraproject.org/compose/24/Fedora-24-20160330.0/logs/global/traceback.global.log

Traceback (most recent call last):
  File "/usr/bin/pungi-koji", line 384, in <module>
    main()
  File "/usr/bin/pungi-koji", line 197, in main
    run_compose(compose)
  File "/usr/bin/pungi-koji", line 351, in run_compose
    image_checksum_phase.start()
  File "/usr/lib/python2.7/site-packages/pungi/phases/base.py", line 62, in start
    self.run()
  File "/usr/lib/python2.7/site-packages/pungi/phases/image_checksum.py", line 90, in run
    base_checksum_name = self._get_base_filename(variant)
  File "/usr/lib/python2.7/site-packages/pungi/phases/image_checksum.py", line 82, in _get_base_filename
    'respin': self.compose.compose_respin,
KeyError: 'label'
Frame _get_base_filename in /usr/lib/python2.7/site-packages/pungi/phases/image_checksum.py at line 82

      75             base_checksum_name = base_checksum_name % {
      76                 'release_short': self.compose.ci_base.release.short,
      77                 'release_id': self.compose.ci_base.release_id,
      78                 'variant': variant,
      79                 'version': self.compose.ci_base.release.version,
      80                 'date': self.compose.compose_date,
      81                 'type_suffix': self.compose.compose_type_suffix,
-->   82                 'respin': self.compose.compose_respin,
      83             }
      84             base_checksum_name += '-'
      85         return base_checksum_name
      86 
      87     def run(self):
      88         for (variant, path), images in self._get_images().iteritems():

<LOCALS>
  base_checksum_name = '%(release_short)s-%(variant)s-%(version)s_%(label)s'
                self = <pungi.phases.image_checksum.ImageChecksumPhase object at 0x3fff895aff90>
       self._skipped = False
      self.checksums = ['sha256']
        self.compose = <pungi.compose.Compose object at 0x3fff8b586d90>
 self.config_options = <ERROR WHILE CONVERTING VALUE TO STRING>
       self.finished = False
            self.msg = '---------- PHASE: IMAGE_CHECKSUM ----------'
           self.name = 'image_checksum'
       self.one_file = True
             variant = 'Cloud'
</LOCALS>
Frame run in /usr/lib/python2.7/site-packages/pungi/phases/image_checksum.py at line 90

      83             }
      84             base_checksum_name += '-'
      85         return base_checksum_name
      86 
      87     def run(self):
      88         for (variant, path), images in self._get_images().iteritems():
      89             checksums = {}
-->   90             base_checksum_name = self._get_base_filename(variant)
      91             for image in images:
      92                 filename = os.path.basename(image.path)
      93                 full_path = os.path.join(path, filename)
      94                 if not os.path.exists(full_path):
      95                     continue
      96 

[1] http://ppc.koji.fedoraproject.org/koji/buildinfo?buildID=393499


The crash in checksum phase is fixed already. The only files that are checksummed are those listed in images.json metadata. If any task fails to create an image, it will not add it there. We can't compute the checksum together with creating the image, as that was a problem in issue #35.

I agree that it does not make much sense to start image-build tasks if buildinstall phase failed to create required files.

@lsedlar changed the status to Fixed

7 years ago

Login to comment on this ticket.

Metadata