Page 1 of 1

How to convert interactive script to run on headless server

Posted: Thu Feb 13, 2025 9:52 pm
by mrhickman53
qcad-3.31.2-pro-linux-qt5.14-x86_64
interactive target ubuntu 24.04 desktop
headless target ubuntu 24.04 server

I have written a script that functions either interactively if qcad is started without a user argument --path= on the command line or "automatically" if the --path argument is present.

qcad -platform offscreen -no-gui -exec File/PRformalDwg/PRformalDwg.js --path="\$panelRightMntDir/Development/panelizerOut"
Is a command line that works on ubuntu 24.04 desktop. The debug statements at startup prior to the user script starting are:

mark@Z790-AORUS-ELITE-AX:~/opt/qcad-3.31.2-pro-linux-qt5.14-x86_64/scripts$ qcad -platform offscreen -no-gui -exec File/PRformalDwg/PRformalDwg.js --path="\$panelRightMntDir/Development/panelizerOut"
QCAD version 3.31.2
11:37:35: Debug: loading plugins...
11:37:35: Debug: RHelpPlugin::init
11:37:35: Debug: RPolygonPlugin::init
11:37:35: Debug: RProScriptsPlugin::init
11:37:35: Debug: RProxiesPlugin::init
11:37:35: Debug: RTracePlugin::init
11:37:35: Debug: RDwgPlugin::init
11:37:35: Debug: loading static plugins...
11:37:35: Debug: LayerListPro.init
11:37:35: Debug: loading plugins...
11:37:35: Debug: loading static plugins...
Warning: This plugin does not support propagateSizeHints()
11:37:35: Debug: loading plugins...
11:37:35: Debug: loading static plugins...
11:37:35: Debug: openFiles: -allow-multiple-instances,-no-gui,-exec,File/PRformalDwg/PRformalDwg.js,--path=$panelRightMntDir/Development/panelizerOut


However, that same command line executed on ubuntu 24.04 server hangs after the Warning: This plugin does not support propagateSizeHints() statement. The application hangs before the "loading plugins..." statement found in ../sourceCode/src/core/RPluginLoader.cpp: qDebug() << "loading plugins...";

Since my script does not even get a chance to run, it seems I need to add more to the server environment to make qcad happy.

Suggestions?

Thanks.

Re: How to convert interactive script to run on headless server

Posted: Fri Feb 14, 2025 8:43 am
by andrew
To debug plugins, you can set

Code: Select all

export QT_DEBUG_PLUGINS=1
This should give you some more information.

You also might want to check for missing libraries in plugins using ldd.

Re: How to convert interactive script to run on headless server

Posted: Sun Feb 16, 2025 1:58 am
by mrhickman53
I went as far as I could with ldd and QT_DEBUG_PLUGINS=1 and did not find a missing dependency based on what the debug statements claimed were being loaded. I then spun up another virtual machine of Xubuntu 24.04 minimal desktop, and qcad seems to hang at the same location. A third virtual machine with the same Ubuntu 24.04 desktop that I run on the physical machine runs qcad fine, do I don't think I can blame the KVM environment. I can meet my needs with this configuration but might poke again at how lightweight a system will support qcad in the future.

Thanks for your suggestions. They helped me refine my skills at troubleshooting a bit, though they are still pretty rough.