Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid "KeyError: material_name" crash in Fedora #17642

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

hroncok
Copy link
Contributor

@hroncok hroncok commented Dec 14, 2023

Description

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/UM/Qt/ListModel.py", line 54, in data
    return self._items[index.row()][self._role_names[role].decode("utf-8")]
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'material_name'

Downstream report: https://bugzilla.redhat.com/show_bug.cgi?id=2252195
Community: https://community.ultimaker.com/topic/44538-cura-53-crashs-at-startup/

For reasons unknown, this crash does not happen with the AppImage.

Nevertheless, in 2baada8 material_name was added as a role, not material_label. Reaming the field in the sentinel extruder makes the crash go away.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Printer definition file(s)
  • Translations

How Has This Been Tested?

On Fedora, I followed the reproducer provided by our users:

  1. Expand the settings menu on the upper right side, where the print quality is shown
  2. Search for the Build Plate Adhesion setting in Show Custom in the menu and expand it
  3. Cura will crash
  4. Launch Cura, it crashes on startup

Test Configuration:

  • Operating System: Fedora Linux 39

Checklist:

    Traceback (most recent call last):
      File "/usr/lib/python3.11/site-packages/UM/Qt/ListModel.py", line 54, in data
        return self._items[index.row()][self._role_names[role].decode("utf-8")]
               ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    KeyError: 'material_name'

Downstream report: https://bugzilla.redhat.com/show_bug.cgi?id=2252195
Community: https://community.ultimaker.com/topic/44538-cura-53-crashs-at-startup/

For reasons unknown, this crash does not happen with the AppImage.

Nevertheless, in 2baada8
material_name was added as a role, not material_label.
Reaming the field in the sentinel extruder makes the crash go away.
@nallath nallath merged commit cfb0b3e into Ultimaker:main Jan 24, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants