Bootstrap engine.execute_commands error

Hello,

Im getting this error [DEBUG sgtk.stopwatch.tank.util.shotgun.connection] create_sg_connection: 0.000545s [DEBUG sgtk.core.bootstrap.manager] Launched engine <Sgtk Engine 0x02582290: tk-shell, env: asset> [DEBUG sgtk.env.asset.tk-shell.tk-multi-launchapp] Creating folders for Asset 2031. Defer keyword: 'tk-maya' [DEBUG sgtk.core.path_cache] Path cache sync tracking marker in local sqlite db: None QWidget: Must construct a QApplication before a QPaintDevice Abort
when trying to bootstrap into the tk-shell on the farm and was just wondering what could be calling the QWidget anything with a GUI I have running if not cmds.about(batch=True):

1 Like

Hi David – we’ve seen this crop up in different scenarios, with a few different causes. Because this seems to be happening at folder creation time, I have a hunch as to what might be going on. There’s a UI window that pops up in Desktop with a message like “Hang on, creating folders”, that may be the issue here.

As a test, can you try commenting out this show_global_busy() line in python/tank/path_cache.py in tk-core and see if the error goes away?

If so, this is a bug on our end. Oddly, we have an existing internal bug ticket for it from a few years back, which was closed as “Won’t Fix” – not sure what the story was there, but if that’s indeed what’s going on, we’ll reopen it.

Let us know how it goes!

1 Like

Hi,
That doesn’t seem to fix it I’m looking in to some more stuff on our end to see if that’s causing it

2 Likes

Hi @Dfulton1

I did just do a quick test here, and I couldn’t replicate it.
I removed my path_cache.db so that it would have to resync.
I bootstrapped the tk-shell engine in a Python interpreter with no QT installed, and launched Maya.
It populated the path cache and launched Maya.

I also tested with Qt in the site packages but without creating a QApplication, that also worked, and also with new assets as well.

keep us posted.
Cheers
Phil

1 Like

Hello,
Sorry for the delayed response I ended up figuring out what it was it had to do with I had pip installed the sgtk after I uninstalled it and just pointed it at a downloaded version of tk-core.

Now I’m running in to a few other issues currently I have a script that is bootstrapping the tk-shell, then running an engine.execute_command(mayapy, ). Which is running mayapy.

When mayapy runs is runs the before_app_launch which sets up our environments for maya. Also there is a static argument that runs a second script that opens and publishes said file. This seems to work on a windows machine but when running this on a linux machine it seems to throw this error This plugin does not support createPlatformOpenGLContext!. Though warning doesnt seem to effect it much

Also when I try to reimport the sgtk It cant seem to find it, and it returns none with sgtk.platform.current_engine()

should I have all of this running within one script or is splitting all this up the way to go?

2 Likes

Presumably it’s tk-multi-launchapp that is running this hook before launching mayapy? I’m just checking in case you’re actually calling it manually?

Does this happen without Shotgun (but still with your environment customizations)? It sounds like there is a Maya plugin you have that is not able to run in on your Linux set up?

Where is this running from? Is this running in the script that bootstrapped tk-shell or is it running in a script that is running in mayapy or is that the same script? I’m not overly familiar with mayapy, but I think you can import it into your script and use it within the same process?
If that is the case I’m not sure what would happen there, as presumably, the tk-shell engine is already running so it wouldn’t be able to start the tk-maya engine.

1 Like

Hi,
tk-multi-launchapp is running the hook before launching mayapy.

This plugin does not support createPlatformOpenGLContext! It does happen without Shotgun I was mainly checking to see if anyone else had any similar issues. This doesnt really seem to cause many issues I think its mainly a warning.

Currently the First of the two scripts I have been running this script from a console in linux. once it has bootstrapped the tk-shell , and ran the execute_command(mayapy, []). the mayapy is a software on our site that has a static arg to run the second script. I sort of have the feeling that this break between the 2 scripts is what is causing me to loose the context of the engine I will try putting the 2 scripts together to today and running it. Ended up running into other issue with the referencing of rig between windows and linux in a headless sense as well.

Thank you,

2 Likes

I think having a second script that is run by mayapy is the right way to go, however is it possible that the script is running before the engine is bootstrapped?

1 Like

No it is not running before the engine is bootstrapped. It is the bootstrapped engine that is running the execute_command which in turn runs the second script.

1 Like

Maybe there is a bit of confusion here.

Normally the process would be something like

  1. Shotgun engine such as desktop or shell gets bootstrapped.
  2. The multi launch app gets called and that launches Maya.
  3. Maya starts up and provides a completely separate python instance in which the Maya engine will be bootstrapped.

With the mayapy however, I’m not sure how it’s working, since I think it’s the same python process? Have you set the tk-maya engine on your software entity for mayapy?

Which engine are you expecting to get hold of, tk-shell or tk-maya?

1 Like

yes I have tk-maya on the mayapy software entity

1 Like