Skip to content

Traceback when uploading results with latest edge version of Checkbox #1909

@bladernr

Description

@bladernr

Bug Description

Refer to https://warthogs.atlassian.net/browse/CHECKBOX-1888

Cert-blocker Test Case

  • cert-blocker

To Reproduce

Run certification tests on a s390x z/VM instance
At concousion of the run, attempt to submit the results to C3
Attempts result in traceback as noted below

Expected Result

Submission to C3 is successful

Actual Result

Traceback occurs and the submission tarball is not created, thus you are unable to actually submit. Additionally, there is no way to recover at this point (so exiting checkbox and restarting it doesn't seem to return to the test results summary window and the "Do you want to submit" prompt to try again.

Environment

s390x z/VM instance on Z13

ubuntu@hwe0008:~$ checkbox-cli --version
4.5.0.dev12
ubuntu@hwe0008:~$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=25.04
DISTRIB_CODENAME=plucky
DISTRIB_DESCRIPTION="Ubuntu 25.04"
ubuntu@hwe0008:~$ uname -a
Linux hwe0008 6.14.0-15-generic #15-Ubuntu SMP Sun Apr  6 13:39:00 UTC 2025 s390x s390x s390x GNU/Linux

Relevant log output

Enter submission description (press Enter to skip): 25.10 initial validation                                                  ERROR:plainbox.bug:Undeclared exception ModuleNotFoundError raised from export_to_transport                                   ERROR:checkbox-ng.launcher.stages:Problem with a 'upload to certification' report using 'com.canonical.plainbox::tar' exporter sent to 'https://certification.canonical.com/api/v1/submission/a00D000000feN6oIAE/' transport. Reason: ModuleNotFoundError("No module named 'filetype'")
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/checkbox_ng/launcher/stages.py", line 711, in _export_results
    result = self.sa.export_to_transport(
        exporter_id, transport, exp_options
    )
  File "/usr/lib/python3/dist-packages/plainbox/impl/decorators.py", line 153, in wrapper
    raise exc
  File "/usr/lib/python3/dist-packages/plainbox/impl/decorators.py", line 145, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/plainbox/impl/session/assistant.py", line 1848, in export_to_transport
    exporter.dump_from_session_manager(self._manager, exported_stream)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/plainbox/impl/exporter/tar.py", line 74, in dump_from_session_manager
    exporter.dump_from_session_manager(manager, _s)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/plainbox/impl/exporter/jinja2.py", line 220, in dump_from_session_manager
    self.dump(data, stream)
    ~~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/plainbox/impl/exporter/jinja2.py", line 179, in dump
    self.template.stream(data).dump(stream, encoding="utf-8")
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1623, in dump
    real_fp.writelines(iterable)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/usr/lib/python3.13/tempfile.py", line 1049, in writelines
    return self._file.writelines(it)
           ~~~~~~~~~~~~~~~~~~~~~^^^^
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1618, in <genexpr>
    iterable = (x.encode(encoding, errors) for x in self)  # type: ignore
                                                    ^^^^
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1667, in __next__
    return self._next()  # type: ignore
           ~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1348, in generate
    yield self.environment.handle_exception()
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 942, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/usr/lib/python3/dist-packages/plainbox/impl/providers/exporters/data/checkbox.html", line 271, in top-level template code
    {%- set img_type = job_state.result.img_type %}

  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 490, in getattr
    return getattr(obj, attribute)
  File "/usr/lib/python3/dist-packages/plainbox/impl/result.py", line 487, in img_type
    import filetype
ModuleNotFoundError: No module named 'filetype'

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions