Disable MATLABConnector on Linux Cluster

27 visualizaciones (últimos 30 días)
Andrew Lewis
Andrew Lewis el 21 de Mayo de 2024
Respondida: Conor Burgess el 24 de Jul. de 2025
I run a Linux Cluster and my users run hundereds of jobs, and for each job Matlab R2024a creates ~/.MathWorks/ServiceHost/<hostname>/v2024.2.0.3 as well as ~/.MathWorks/ServiceHost/<hostname>/logs
This is wasting space and also causing about 20% of jobs to hang indefintely with the follwing in the logs:
00015945 2024-05-21 16:23:20 0x00007fb526ab3640 ddux D logging JSON: MSH_INSTALL_ERROR
{"logDDUXData":{"keyValues":{"error_message":"Extract task invalid argument error: Package cannot be read or empty.","install_timestamp":"2024-05-21 14:17:13.666","post_background_update_code":"","post_install_code":"","pre_uninstall_code":"","start_msh_code":"","stop_msh_code":"","triggered_by":"TRIPWIRE_DESKTOP_SERVICES","update_version":"2024.2.0.3"},"product":""}}
00015946 2024-05-21 16:23:20 0x00007fb526ab3640 ddux D Added to event stats, eventkey [ MSH_INSTALL_ERROR ], bytes [ 370 ], count [ 1 ]
00015947 2024-05-21 16:23:20 0x00007fb526ab3640 ddux D logging JSON: MSH_INSTALL_ERROR
{"logDDUXData":{"keyValues":{"error_message":"Extract task invalid argument error: Package cannot be read or empty.","install_timestamp":"2024-05-21 14:17:13.668","post_background_update_code":"","post_install_code":"","pre_uninstall_code":"","start_msh_code":"","stop_msh_code":"","triggered_by":"TRIPWIRE_DESKTOP_SERVICES","update_version":"2024.2.0.3"},"product":""}}
Matlab as a package is available from a central folder, I don't want or need the above to happen. How do I disable this? On our older cluster this did not happen with R2022 etc.
  2 comentarios
Marcel Zwiers
Marcel Zwiers el 12 de Jun. de 2025
In our center, we run into a similar situation, in that our HPC users are facing a ridiculous amount of servicehost logs files in their home directories. We are already using a centrally managed servicehost, to mitigate the problem, but the log files remain to be an issue. It seems to me that these log files are of no interest to users, and that they should never be pushed into production (or at least Mathworks should provide a config option to disable logging).
Feng
Feng el 19 de Jul. de 2025
We're encountering the same issue on our HPC cluster with MATLAB R2025a. If MATLAB is not launched using the -batch option, for example, when a user starts MATLAB with:
matlab -nodisplay -nosplash -r "ver; exit"
instead of:
matlab -batch "ver"
it generates approximately 5MB of log files under ~/.MathWorks/ServiceHost/logs/ each time.
On a shared system, it's common for users to run such commands in automated scripts or loops. If a user runs this 1000 times, which is not unusual, it can quickly result in around 5GB of unnecessary log files in their home directory.
Is there any update or recommended approach from MathWorks to either disable this logging behavior or at least redirect the logs to a more appropriate location?

Iniciar sesión para comentar.

Respuestas (2)

UDAYA PEDDIRAJU
UDAYA PEDDIRAJU el 14 de Jun. de 2024
Hi Andrew,
To prevent directory creation and job stalls caused by MATLABConnector (R2024a Linux cluster), disable it using one of these methods:
  • Before starting MATLAB, set "MATLAB_DISABLE_SERVICEHOST=true" (e.g., export MATLAB_DISABLE_SERVICEHOST=true; matlab).
  • Edit your shell startup script (e.g., .bashrc) and add export "MATLAB_DISABLE_SERVICEHOST=true".
Apart from this I found following related query in the community: https://www.mathworks.com/matlabcentral/answers/2050132-how-can-i-permanently-disable-matlab-drive-in-linux and https://www.mathworks.com/matlabcentral/answers/452867-how-can-i-log-out-of-matlab-drive-connector
Caution: Disabling ServiceHost might affect features like cloud connectivity. The solutions should give an idea on how to proceed.
  1 comentario
Feng
Feng el 19 de Jul. de 2025
Hi, UDAYA,
Thank you for your suggestion. Unfortunately, I encountered the same issue with MATLAB R2025a. I tried adding the following environment variable as recommended:
export MATLAB_DISABLE_SERVICEHOST=true
However, this did not prevent the logs from being generated. I also attempted:
export MATHWORKS_DISABLE_SERVICE_HOST=true
But that didn’t help either. I’m wondering if there might be any other solutions to suppress these logs?

Iniciar sesión para comentar.


Conor Burgess
Conor Burgess el 24 de Jul. de 2025
Please use matlab -batch in HPC and CI/CD workflows - for R2024a Update 6 and later, this will avoid the creation of the log files in user home directories. The environment variables mentioned in other answers are not ones we use and will not work.

Productos


Versión

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by