Exception(s) causing the orthanc server to restart

Hi all,

Apologies, my question is a bit vague, but can this Lua script error cause the Orthanc server to restart or is the error being handled gracefully?

E0521 04:55:59.510518 Toolbox.cpp:2394] Cannot parse JSON: * Line 1, Column 1
  Syntax error: value, object or array expected.
E0521 04:55:59.510542 OrthancException.cpp:61] Cannot execute a Lua command: [string \"line\"]:77: attempt to index a nil value (local 'res')
E0521 04:55:59.510594 LuaScripting.cpp:848] Error while processing Lua events: Cannot execute a Lua command

Context: My server keeps restarting and the last log is always a series of access logs like this. There are no logs that usually say Unregistering plugin..., so I am unsure what to look for.

W0521 04:55:59.518754 ServerContext.cpp:2520] W001: Accessing Dicom tags from storage when accessing study : 0018,0015

Regards,
Yash

Lua errors are not handled “gracefully”. You should first fix the error before investigating anything else …

Hi, thanks I’ll shift my focus to that.

I use Lua script to call 3rd party REST APIs. Since the errors are not handled gracefully, is there a better to do this in Lua?

I know Python is a good option for this use-case but any help with Lua would be super useful!

Rgds

You probably just need to add something like:

if (res) then
  -- your code that indexes res
end
1 Like