Not sure if this is at all related to your problem but we had some issues a couple of months back and was then later fixed in an updated version of the tk-nuke engine.
But until that fix was included in the engine we could set this env variable as a workaround: SHOTGUN_SKIP_QTWEBENGINEWIDGETS_IMPORT=1
Are you on the latest version of the nuke engine as well?
As I mentioned this may not be related to your problem at all but could be worth a try!
we are currently investigating an issue with debug logging in Nuke where Nuke can crash if Nuke’s script editor is open.
Our current workaround it to turn off debug logging. Do you have it enabled on systems where it crashes? If yes, can you try turning off debug logging and see if the issue remains?
No different with or with out the debug mode.
In 1 of 20 startups via the tank.bat launch_nuke nuke does not crash, via Shotgun Desktop allways. But maybe that is a coincidence.
@Ricardo_Musch I think we might have tracked down the issue on our side. It was an app with a background task manager that wasn’t behaving nicely. Every time the file was saved it triggered an engine reload. There was a task manager that wasn’t shut down correctly so sometimes this caused a race condition that meant that the threads weren’t properly shut down before the QObject that owned the task manger got destroyed.
To fix the issue I’ve run deleteLater() on my task manager after calling shutting down. I’ve also forked the tk-nuke engine to only reload if the context actually changes (as I don’t see any reason to reload on every CTRL-S!). Note quite sure if that’s fixed the issue or not, but seems to have reduced crashing.
Still working out mechanics of submitting pull requests at my company but here’s a diff of what I did:
diff --git a/python/tk_nuke/__init__.py b/python/tk_nuke/__init__.py
index 1aec27e..c26d91e 100644
--- a/python/tk_nuke/__init__.py
+++ b/python/tk_nuke/__init__.py
@@ -99,13 +99,15 @@ def __engine_refresh(new_context):
If an engine is already started then we just need to change context,
else we need to start the engine.
"""
-
engine_name = os.environ.get("TANK_NUKE_ENGINE_INIT_NAME")
curr_engine = sgtk.platform.current_engine()
if curr_engine:
- # If we already have an engine, we can just tell it to change contexts
- curr_engine.change_context(new_context)
+ if curr_engine.context != new_context: # Only run if we're changing the context.
+ # If we already have an engine, we can just tell it to change contexts
+ curr_engine.change_context(new_context)
+ else:
+ logger.info('Skipping context change as the new context is the same as the old')
else:
# try to create new engine
try:
@Ricardo_Musch we’ve just noticed that the above fix breaks the shotgun load when picking up someone else’s published script (it disables the toolkit). I wouldn’t recommend using it
Now I am getting in line with the QThread: Destroyed while thread is still running error with the latest updates in SGTK. Nuke 12 and 14 are crashing 9 out of 10 times when I try to open them. I am very certain it is related to the workfiles2 app, because when I disable “launch_on_startup” everything works fine again. It feels like the workfiles app runs some threads to capture information and then kills the main thread in the process.
For the record: I do not have debug logging enabled, nor the script editor visible.
I am using:
tk-core: v0.21.2
tk-nuke: v0.15.1
tk-multi-workfiles2: v0.15.0
Does anybody have a solution to this? I’d rather not disable “launch_on_startup”, if I don’t have to.