canonical / checkbox

Checkbox is a testing framework used to validate device compatibility with Ubuntu Linux. It’s the testing tool developed for the purposes of the Ubuntu Certification program.
https://checkbox.readthedocs.io
GNU General Public License v3.0
30 stars 47 forks source link

Cannot export the submission tar file after finishing the session when the test plan is not whole #1557

Open weizhenwu opened 2 days ago

weizhenwu commented 2 days ago

Bug Description

Checkbox cannot export the submission tar file after finishing the session. The errors below will be reported and the session will stay incomplete. It happens only when I don't run the whole test plan but select partial tests.

To Reproduce

  1. Launch checkbox
  2. Select client-cert-iot-server-22-04-automated
  3. Select only camera tests and start testing
  4. Press F to export to submission after finishing

Environment

OS: ubuntu server 22.04 Checkbox type: snap Checkbox version: 4.2.0-dev121 DUT: 202409-35561

Relevant log output

ERROR:plainbox.bug:Undeclared exception UndefinedError raised from export_to_transport
ERROR:checkbox-ng.launcher.stages:Problem with a '2_tar_file' report using 'com.canonical.plainbox::tar' exporter sent to '/home/ubuntu/.local/share/checkbox-ng/submission_2024-10-23T03.08.00.817432.tar.xz' transport. Reason 'dict object' has no attribute 'com.canonical.contrib::ce-oem-info/snapd_installation_time'
Traceback (most recent call last):
  File "/snap/checkbox22/current/lib/python3.10/site-packages/checkbox_ng/launcher/stages.py", line 669, in _export_results
    result = self.sa.export_to_transport(
  File "/snap/checkbox22/current/lib/python3.10/site-packages/plainbox/impl/decorators.py", line 153, in wrapper
    raise exc
  File "/snap/checkbox22/current/lib/python3.10/site-packages/plainbox/impl/decorators.py", line 145, in wrapper
    return func(*args, **kwargs)
  File "/snap/checkbox22/current/lib/python3.10/site-packages/plainbox/impl/session/assistant.py", line 1823, in export_to_transport
    exporter.dump_from_session_manager(self._manager, exported_stream)
  File "/snap/checkbox22/current/lib/python3.10/site-packages/plainbox/impl/exporter/tar.py", line 74, in dump_from_session_manager
    exporter.dump_from_session_manager(manager, _s)
  File "/snap/checkbox22/current/lib/python3.10/site-packages/plainbox/impl/exporter/jinja2.py", line 205, in dump_from_session_manager
    self.dump(data, stream)
  File "/snap/checkbox22/current/lib/python3.10/site-packages/plainbox/impl/exporter/jinja2.py", line 175, in dump
    self.template.stream(data).dump(stream, encoding="utf-8")
  File "/snap/checkbox22/current/usr/lib/python3/dist-packages/jinja2/environment.py", line 1612, in dump
    fp.writelines(iterable)
  File "/snap/checkbox22/current/usr/lib/python3.10/tempfile.py", line 955, in writelines
    rv = file.writelines(iterable)
  File "/snap/checkbox22/current/usr/lib/python3/dist-packages/jinja2/environment.py", line 1607, in <genexpr>
    iterable = (x.encode(encoding, errors) for x in self)  # type: ignore
  File "/snap/checkbox22/current/usr/lib/python3/dist-packages/jinja2/environment.py", line 1656, in __next__
    return self._next()  # type: ignore
  File "/snap/checkbox22/current/usr/lib/python3/dist-packages/jinja2/environment.py", line 1348, in generate
    yield self.environment.handle_exception()
  File "/snap/checkbox22/current/usr/lib/python3/dist-packages/jinja2/environment.py", line 925, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/snap/checkbox22/current/lib/python3.10/site-packages/plainbox/impl/providers/exporters/data/checkbox.json", line 115, in top-level template code
    "name": "{{ job_state_map[job_id].job.tr_summary() }}",
  File "/snap/checkbox22/current/usr/lib/python3/dist-packages/jinja2/environment.py", line 474, in getattr
    return getattr(obj, attribute)
jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'com.canonical.contrib::ce-oem-info/snapd_installation_time'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/snap/checkbox22/current/bin/checkbox-cli", line 8, in <module>
    sys.exit(main())
  File "/snap/checkbox22/current/lib/python3.10/site-packages/checkbox_ng/launcher/checkbox_cli.py", line 166, in main
    return subcmd.invoked(ctx)
  File "/snap/checkbox22/current/lib/python3.10/site-packages/checkbox_ng/launcher/subcommands.py", line 295, in invoked
    self._export_results()
  File "/snap/checkbox22/current/lib/python3.10/site-packages/checkbox_ng/launcher/stages.py", line 723, in _export_results
    traceback.print_tb(exc)
  File "/snap/checkbox22/current/usr/lib/python3.10/traceback.py", line 53, in print_tb
    print_list(extract_tb(tb, limit=limit), file=file)
  File "/snap/checkbox22/current/usr/lib/python3.10/traceback.py", line 72, in extract_tb
    return StackSummary.extract(walk_tb(tb), limit=limit)
  File "/snap/checkbox22/current/usr/lib/python3.10/traceback.py", line 364, in extract
    for f, lineno in frame_gen:
  File "/snap/checkbox22/current/usr/lib/python3.10/traceback.py", line 329, in walk_tb
    yield tb.tb_frame, tb.tb_lineno
AttributeError: 'UndefinedError' object has no attribute 'tb_frame'

Additional context

No response

syncronize-issues-to-jira[bot] commented 2 days ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CHECKBOX-1627.

This message was autogenerated