Ultimaker / Cura

3D printer / slicing GUI built on top of the Uranium framework
GNU Lesser General Public License v3.0
6.11k stars 2.06k forks source link

Cura crashes on project saving and material creation. #9049

Closed a123qwertz567 closed 3 years ago

a123qwertz567 commented 3 years ago

Application version

Platform Linux-5.9.16-1-Manjaro-x86_64-with-glibc2.32 (tested a 5.6 Kernel, too. No change) Qt version: 5.15.2 PyTw version: 5.12.2 OpenGL Version: 4.6 (Core Profile) Mesa 20.3.1 OpenGL Vendor: AMD OpenGl-Renderer: AMD Radeon (TM) RX 480 Graphics

Printer I tested multiple printers:

Reproduction steps

Screenshot(s) In the screenshot you can see the saving dialog before the crash. What makes me thinking is, there is no value for the nozzle in the extruder section. Maybe this value is mising? This could be connected to the error traceback "TypeError: start expected 2 arguments, got 1"

Screenshot_20201231_161617

Actual results

Expected results

Project file (For slicing bugs, provide a project which clearly shows the bug, by going to File->Save Project. For big files you may need to use WeTransfer or similar file sharing sites. G-code files are not project files!)

Log file Error traceback: Traceback (most recent call last): File "/usr/lib/python3.9/site-packages/cura/CuraApplication.py", line 1060, in event return super().event(event) File "/usr/lib/python3.9/site-packages/UM/Qt/QtApplication.py", line 464, in event event._function_event.call() File "/usr/lib/python3.9/site-packages/UM/Event.py", line 218, in call self._function(*self._args, *self._kwargs) File "/usr/lib/python3.9/site-packages/cura/Utils/Threading.py", line 34, in _handle_call ico.result = func(args, **kwargs) File "/usr/lib/cura/plugins/3MFWriter/ThreeMFWorkspaceWriter.py", line 57, in write self._writeContainerToArchive(container, archive) File "/usr/lib/cura/plugins/3MFWriter/ThreeMFWorkspaceWriter.py", line 150, in _writeContainerToArchive serialized_data = container.serialize(ignored_metadata_keys = ignore_keys) File "/usr/lib/cura/plugins/XmlMaterialProfile/XmlMaterialProfile.py", line 154, in serialize builder.start("metadata") # type: ignore TypeError: start expected 2 arguments, got 1

Log: Thread 0x00007f186ffff640 (most recent call first): File "/usr/lib/python3.9/threading.py", line 316 in wait File "/usr/lib/python3.9/site-packages/zeroconf/init.py", line 2432 in wait File "/usr/lib/python3.9/site-packages/zeroconf/init.py", line 1726 in run File "/usr/lib/python3.9/threading.py", line 954 in _bootstrap_inner File "/usr/lib/python3.9/threading.py", line 912 in _bootstrap

Thread 0x00007f1890a79640 (most recent call first): File "/usr/lib/python3.9/threading.py", line 316 in wait File "/usr/lib/python3.9/threading.py", line 574 in wait File "/usr/lib/cura/plugins/UM3NetworkPrinting/src/Network/ZeroConfClient.py", line 81 in _handleOnServiceChangedRequests File "/usr/lib/python3.9/threading.py", line 892 in run File "/usr/lib/python3.9/threading.py", line 954 in _bootstrap_inner File "/usr/lib/python3.9/threading.py", line 912 in _bootstrap

Thread 0x00007f189127a640 (most recent call first): File "/usr/lib/python3.9/threading.py", line 316 in wait File "/usr/lib/python3.9/site-packages/zeroconf/init.py", line 1476 in run File "/usr/lib/python3.9/threading.py", line 954 in _bootstrap_inner File "/usr/lib/python3.9/threading.py", line 912 in _bootstrap

Thread 0x00007f1891a7b640 (most recent call first): File "/usr/lib/python3.9/site-packages/zeroconf/init.py", line 1350 in run File "/usr/lib/python3.9/threading.py", line 954 in _bootstrap_inner File "/usr/lib/python3.9/threading.py", line 912 in _bootstrap

Thread 0x00007f189227c640 (most recent call first): File "/usr/lib/cura/plugins/USBPrinting/USBPrinterOutputDeviceManager.py", line 87 in _updateThread File "/usr/lib/python3.9/threading.py", line 892 in run File "/usr/lib/python3.9/threading.py", line 954 in _bootstrap_inner File "/usr/lib/python3.9/threading.py", line 912 in _bootstrap

Thread 0x00007f1892a7d640 (most recent call first): File "/usr/lib/cura/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py", line 61 in _updateThread File "/usr/lib/python3.9/threading.py", line 892 in run File "/usr/lib/python3.9/threading.py", line 954 in _bootstrap_inner File "/usr/lib/python3.9/threading.py", line 912 in _bootstrap

Thread 0x00007f18937fe640 (most recent call first): File "/usr/lib/python3.9/site-packages/UM/Backend/Backend.py", line 165 in _storeStderrToLogThread File "/usr/lib/python3.9/threading.py", line 892 in run File "/usr/lib/python3.9/threading.py", line 954 in _bootstrap_inner File "/usr/lib/python3.9/threading.py", line 912 in _bootstrap

Thread 0x00007f1893fff640 (most recent call first): File "/usr/lib/python3.9/site-packages/UM/Backend/Backend.py", line 153 in _storeOutputToLogThread File "/usr/lib/python3.9/threading.py", line 892 in run File "/usr/lib/python3.9/threading.py", line 954 in _bootstrap_inner File "/usr/lib/python3.9/threading.py", line 912 in _bootstrap

Thread 0x00007f18cbfff640 (most recent call first): File "/usr/lib/python3.9/threading.py", line 312 in wait File "/usr/lib/python3.9/threading.py", line 574 in wait File "/usr/lib/python3.9/site-packages/cura/Utils/Threading.py", line 39 in _call_on_qt_thread_wrapper File "/usr/lib/python3.9/site-packages/UM/FileHandler/WriteFileJob.py", line 76 in run File "/usr/lib/python3.9/site-packages/UM/JobQueue.py", line 132 in run File "/usr/lib/python3.9/threading.py", line 954 in _bootstrap_inner File "/usr/lib/python3.9/threading.py", line 912 in _bootstrap

Thread 0x00007f18d0ff9640 (most recent call first): File "/usr/lib/python3.9/threading.py", line 312 in wait File "/usr/lib/python3.9/threading.py", line 443 in acquire File "/usr/lib/python3.9/site-packages/UM/JobQueue.py", line 98 in _nextJob File "/usr/lib/python3.9/site-packages/UM/JobQueue.py", line 123 in run File "/usr/lib/python3.9/threading.py", line 954 in _bootstrap_inner File "/usr/lib/python3.9/threading.py", line 912 in _bootstrap

Thread 0x00007f18d17fa640 (most recent call first): File "/usr/lib/python3.9/threading.py", line 312 in wait File "/usr/lib/python3.9/threading.py", line 443 in acquire File "/usr/lib/python3.9/site-packages/UM/JobQueue.py", line 98 in _nextJob File "/usr/lib/python3.9/site-packages/UM/JobQueue.py", line 123 in run File "/usr/lib/python3.9/threading.py", line 954 in _bootstrap_inner File "/usr/lib/python3.9/threading.py", line 912 in _bootstrap

Thread 0x00007f18d1ffb640 (most recent call first): File "/usr/lib/python3.9/threading.py", line 312 in wait File "/usr/lib/python3.9/threading.py", line 443 in acquire File "/usr/lib/python3.9/site-packages/UM/JobQueue.py", line 98 in _nextJob File "/usr/lib/python3.9/site-packages/UM/JobQueue.py", line 123 in run File "/usr/lib/python3.9/threading.py", line 954 in _bootstrap_inner File "/usr/lib/python3.9/threading.py", line 912 in _bootstrap

Current thread 0x00007f190bc14740 (most recent call first): File "/usr/lib/python3.9/site-packages/cura/CrashHandler.py", line 393 in _logInfoWidget File "/usr/lib/python3.9/site-packages/cura/CrashHandler.py", line 182 in createDialog File "/usr/lib/python3.9/site-packages/cura/CrashHandler.py", line 86 in init File "/bin/cura", line 166 in exceptHook File "/usr/lib/python3.9/site-packages/UM/Qt/QtApplication.py", line 378 in exec File "/usr/lib/python3.9/site-packages/cura/CuraApplication.py", line 844 in run File "/bin/cura", line 234 in

Additional information

a123qwertz567 commented 3 years ago

Workaround for now: I can load a old profile with all settings and slice in that setting. But I cannot save stuff....

a123qwertz567 commented 3 years ago

Updated the issue. Cura 4.6 as an Appimage seems to work for now. Saving a project makes it hang/lag for some seconds but it works for now.

delaosa commented 3 years ago

Same crash with AUR package (cura-4.8.0-1) in Arch however 4.8.0 Appimage is working well.

Ghostkeeper commented 3 years ago

Cura currently requires Python 3.5. Perhaps this is one of the places where Python's interface changed to not be backwards compatible? That would explain why it works through the AppImage. We don't support any other Python version.

The line in question is here:

https://github.com/Ultimaker/Cura/blob/9562dc01f47bc1b3a368fa80563677a914bb09a0/plugins/XmlMaterialProfile/XmlMaterialProfile.py#L154

That #type: ignore makes me a bit suspicious that the argument list was also seen as wrong on some computers but correct in the Python version that Cura runs with.

ayghri commented 3 years ago

The problem is in the file "/usr/lib/cura/plugins/XmlMaterialProfile/XmlMaterialProfile.py" You just have to replace all calls: builder.start(X) by builder.start(X,{}) There are a few such calls between line 154 and 196

delaosa commented 3 years ago

Thanks @aghriss, it works for me.

c24w commented 3 years ago

The problem is in the file "/usr/lib/cura/plugins/XmlMaterialProfile/XmlMaterialProfile.py" You just have to replace all calls: builder.start(X) by builder.start(X,{}) There are a few such calls between line 154 and 196

Thanks @aghriss; works for me. Here's a command to do it in one go:

sed -i 's/\(builder\.start([^),]\+\))/\1, {})/' XmlMaterialProfile.py

Use at your own risk, of course :grimacing:

a123qwertz567 commented 3 years ago

Thank you for the solution. I will not try it if it works I am fine for now. The whole settings, profile, filament management is a mess from my perspective. I won't waste time to dial in setting in something that can break tomorrow....

Ghostkeeper commented 3 years ago

This has recently been fixed for us through a pull request: https://github.com/Ultimaker/Cura/pull/9105

The changes suggested by @c24w and applied by @lorenzph are backwards compatible to Python 3.5. So it apparently fixes it for Python 3.9, and doesn't break anything for the main Cura distribution. So we've merged them in. Thanks for the debugging, guys :)