This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Bug in scada-remote "objects" request
#1
On some of my LogicMachines, I am encountering an error 500 "internal server error" when executing the scada-remote request for querying objects:

Code:
http://<LogicMachineIP>/scada-remote/?m=json&r=objects

This request produces the following error:
Code:
500 Internal Server Error

nginx


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:
Code:
/tmp/log/nginx/error.log

Here's what the error log contains:
Code:
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?
Reply


Messages In This Thread
Bug in scada-remote "objects" request - by rbourgeon - 16.03.2022, 10:45

Forum Jump: