When I start the windows service without using python plugin, the Orthanc perfectly starts as a service. Below is the configuration when it runs perfectly fine:
But as soon as I add the python plugin, Orthanc fails to start as a service. Below is the configuration for the same:
I guess, Orthanc is unable to access the Python interpreter. Could you please help me with this problem.
First, make sure you have followed all recommendations from here:
Beware that one version of the Python plugin can only be run against one version of the Python interpreter. This version is clearly indicated in the filename of the precompiled binaries.
Pay also attention to pick the right 32/64 bits version. If you are running Orthanc 64bits, install Python in 64bits and select the 64bits Python plugin too.
When you install Python on your Windows machine, make sure to install Python for All Users and select the Add Python to Path option.
Then, check your logs for errors and share your logs.
I have made sure all the points you have mentioned:
I have installed Python for all users
It’s 64 bits
Checked add to Path option while installation
Orthanc version is 4.0
Python version is 3.8.10
Python Plugin which I have downloaded is OrthancPython3.8-4.0.dll which is the compatible one
And like I already said, it runs perfectly fine when I operate it from my terminal using command “Orthanc.exe configuration.json”
It doesn’t work as expected when we start it as windows service. For running the service, I have used nssm.exe.
Paths of nssm.exe have been configured and that also works fine if I run manually but again fails when I run as a service!
I really appreciate the response but unfortunately that doesn’t help. I have checked the Orthanc command in noth manual process and in service, they are both.
Also the python versions are the same for user as well as admin. Also I have only one version of Python installed in my system which is 3.8.10. Attaching ss for your reference!
Please help if you have some other things/solutions on mind!
FYI, here’s the kind of output you may get with ProcessMonitor that would help you diagnose what goes wrong when loading the python plugin (here, I intentionally prevented access to the dll for the SYSTEM user)
That really helped me check the process for the service. I am still not familiar, how do I figure out the exact problem because all I see is success and NAME_NOT_FOUND. Attaching screenshot for your reference!
Different users can lead to wildly different runtime environments.
My advice would be to check if the service works fine when run as the same BadBoy (cool user name btw) user. Google for “change windows service to run as user”