16.03.2022, 10:45
On some of my LogicMachines, I am encountering an error 500 "internal server error" when executing the scada-remote request for querying objects:
This request produces the following error:
Note that on the same machines, the other requests that can be done with scada-remote (such as r=alerts or r=errors) work properly.
I decided to investigate the error logs of the nginx server, which are located in the following file:
Here's what the error log contains:
So the deep reason behind the error seems to be that the script /usr/share/lua/genohm-scada.lua tries to compare (>, <, =) a number with nil.
I tried to investigate inside the 3 files that seem to be involved (/usr/share/lua/genohm-scada.lua, /lib/genohm-scada/web/remote/objects.lua and /lib/genohm-scada/web/remote-handler.lua), but these files are binary (encoded). As a result it's impossible to debug these scripts.
Therefore, I am currently unable to investigate what is precisely the number comparison that causes the request to crash. Would it be possible for the administrators to send me the uncompiled Lua code of these 3 scripts so I can investigate the problem further?
Code:
1
http://<LogicMachineIP>/scada-remote/?m=json&r=objectsThis request produces the following error:
Code:
123
500 Internal Server Error
nginxNote that on the same machines, the other requests that can be done with scada-remote (such as r=alerts or r=errors) work properly.
I decided to investigate the error logs of the nginx server, which are located in the following file:
Code:
1
/tmp/log/nginx/error.logHere's what the error log contains:
Code:
123456
2022/03/16 11:24:54 [error] 1105#0: *2681 lua entry thread aborted: runtime error: /usr/share/lua/genohm-scada.lua:0: attempt to compare number with nil
stack traceback:
coroutine 0:
/usr/share/lua/genohm-scada.lua: in function 'decodevalue'
/lib/genohm-scada/web/remote/objects.lua: in function </lib/genohm-scada/web/remote/objects.lua:0>
/lib/genohm-scada/web/remote-handler.lua: in function </lib/genohm-scada/web/remote-handler.lua:0>, client: xxxxxxxx, server: , request: "GET /scada-remote/?m=json&r=objects HTTP/1.1", host: "xxxxxxxxx"So the deep reason behind the error seems to be that the script /usr/share/lua/genohm-scada.lua tries to compare (>, <, =) a number with nil.
I tried to investigate inside the 3 files that seem to be involved (/usr/share/lua/genohm-scada.lua, /lib/genohm-scada/web/remote/objects.lua and /lib/genohm-scada/web/remote-handler.lua), but these files are binary (encoded). As a result it's impossible to debug these scripts.
Therefore, I am currently unable to investigate what is precisely the number comparison that causes the request to crash. Would it be possible for the administrators to send me the uncompiled Lua code of these 3 scripts so I can investigate the problem further?