Standard NetXML modules are not loading after 5.0.2 upgrade

Started by lroytman, May 17, 2024, 07:53:53 PM

Previous topic - Next topic

lroytman

Hi,

We've upgraded our NetXMS installation from 4.5.0 to 5.0.2. Then we had to replace all deprecated functions in our EPP scripts. Now EPP scripts are being compiled successfully.
However, actual execution generates an error - Script (EPP::1) execution error: Script load failed
When we try to Execute Script on a node, even simple
String::right("Test", 2);
gives the following error: 
Cannot execute script: Script compilation error (Error 16 in line 1:Requested module not found or cannot be loaded)

Any recommendations on how to fix the issue?

Thank you,

Leo


Filipp Sudanov

String functions were deprecated, now string methods should be used:

a = "abc";
b = a.right(2);
println(b);

Documentation should be up to date: https://www.netxms.org/documentation/nxsl-latest/#class-string

lroytman

Thank you, Filipp, for your quick reply. After another turn of script corrections they seem to be working now.
It is unfortunate that documentation has not been updated. And compilation diagnostics has not been updated too. We wasted quite a few hours because of that. And, as compilation does not catch deprecated code, we cannot be sure we have not missed some places which can fail on execution.

Regards,

Leo

Victor Kirhenshtein

Hi,

is this:
String::right("Test", 2);
really in documentation somewhere? Or some text/example that suggests this is the correct way? Because it is incorrect and never was.
Module::function syntax is supported since 4.x, and some functions were indeed moved to system packages in version 5, but there never been module "String".

Best regards,
Victor

lroytman

Hi Victor,

Please, see here: https://netxms.org/documentation/nxsl-latest/#func-right
It says:  [color=rgba(0, 0, 0, 0.6)]This function is deprecated starting from version 5.0.[/color][color=rgba(0, 0, 0, 0.6)] Please use [/color]String::right()

Regards,

Leo