How to convert interactive script to run on headless server

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
mrhickman53
Active Member
Posts: 25
Joined: Thu Sep 07, 2023 1:17 am
Location: USA

How to convert interactive script to run on headless server

Post by mrhickman53 » Thu Feb 13, 2025 9:52 pm

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.

User avatar
andrew
Site Admin
Posts: 8774
Joined: Fri Mar 30, 2007 6:07 am

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

Post by andrew » Fri Feb 14, 2025 8:43 am

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.

mrhickman53
Active Member
Posts: 25
Joined: Thu Sep 07, 2023 1:17 am
Location: USA

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

Post by mrhickman53 » Sun Feb 16, 2025 1:58 am

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.

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”