Orthanc is failing to load my lua script and is returning the following error:
E0210 12:19:14.820436 OrthancException.cpp:58] The specified path does not point to a regular file: The path does not point to a regular file: /home/wisdom/route_dicoms.lua
What’s surprising is this is the exact path of where the script is, but Orthanc is failing to read it. What could be wrong? I have tried everything renaming, adding another backslah at the end for specifying the file route and moving the file to some different location but nothing worked.
I am using ubuntu linux. Below are the screenshots of the path in linux and the orthanc.json file lua section.
I removed the underscore but it still didn’t work. I had already tried renaming it before but no positive results came out. On ensuring that the path of the script is local to the Orthanc server, the lua script and the orthanc server are already running in the same local machine(localhost) but nothing is working. Is this what you mean by local? Kindly note I am still a noob in networking.
What’s funny is this setup has already been working, just as it is. But now the lua script can’t be read and orthanc is returning an error (specified path does not point to a regular file). It’s quite confusing what has changed when this whole setup was working well initially.
Ok Wisdom, so we deduced that you’re not using docker, just running everything on the same host. Makes life a little easier as we’re only working with Orthanc itself now.
I have found that these Lua error messages are a little spurious and in my experience I do a couple of things (in order)
From orthanc.json, remove reference to the Lua script completely and restart Orthanc. Hopefully it comes up without issues.
If (1) works, create a temporary file (named route_dicom.lua) but with just a simple statement inside it - something like print(“Hello!”) and then restart Orthanc.
If (2) works then you know there’s something inside the script itself which is causing a problem.
If (2) doesn’t work then definitely check the orthanc.json configuration. It should contain something like “LuaScripts” : [“/home/wisdom/route_dicoms.lua”]
It may also be advisable to put more of the output into a post on this forum as there may be something else which is compounding the issue.
I did all the steps up to step 4 but to no avail. I have tried everything humanly possible. It’s actually now scary if there is actually a solution to this. Below I have attached the orthanc error log file, the error in terminal, screenshot of the temporary lua script, screenshot of the “LuaScripts” section of the orthanc.json configuration file and screenshot of the “DicomModalities” section in the orthanc.json configuration file in case it might have an effect on orthanc reading the lua script.
I have also tried uninstalling and reinstalling orthanc via terminal. Is there a way of completely removing orthanc and starting afresh as uninstalling via terminal using “sudo uninstall orthanc” seems to leave some orthanc files (orthanc storage etc.). Will this even help? Thanks in advance.
It seems that Orthanc is able to read the json config files from “/etc/orthanc” folder… What if you put your lua script there and adapt the path in the “LuaScripts” var ?
In the screen shot you have: “/home/wisdom/route.lua/”, with a ‘/’ at the end ? I don’t think you need that. If you have more than one lua script you can add them as additional elements in the array.
Also check the permission for the lua script file.
It finally worked. I don’t think it’s about the forward slash and the script permissions issue because I had already tried that. What I now did is I made a new lua file in the linux main root cd directory which need sudo priviledges (sudo touch route_dicoms.lua) and copied everything from my original lua script into this new lua file I have made in the main linux cd directory (opened using sudo gedit route_dicoms.lua/sudo nano route_dicoms.lua). >From the linux main cd directory everything seems to be working fine. I have attached the screenshot of where I have made this new lua script. The root cause still not yet clear to me. Maybe it’s because I once changed my user password for logging into my computer or something to do with sudo priviledges. So the new path is now just “/route_dicoms.lua”. Thanks.
Glad that you got it working Wisdom. I tend to put all of my scripts in /usr/share/orthanc/lua-scripts (within a docker container) and as long as they have (at least) 0444 permissions, then all should be able to read them.