I have written a Web API that is running in IIS 7.5 which uses the everything SDK to search for files. I have installed the 32 bit version of everything on the server running IIS and am using the 32 bit sdk methods. All is working fine on my development machine, but on the IIS machine, running the SDK from within a Web API application returns no search results. I've tried giving the web application admin privileges but still nothing.
Error 4 = Everything IPC is not available. (Should be error code 2, but it's a bug with the latest SDK)
Is the "Everything.exe *32" process the Everything service or the Everything search client?
Please try the same thing again with a Everything search window open in the background.
With both the service and the search client running I get the same result (4).
The command lines displayed in the task manager are
"C:\Program Files (x86)\Everything\Everything.exe" -svc
"C:\Program Files (x86)\Everything\Everything.exe"
The service is running under the SYSTEM account and the client is running under my personal account (my account is an admin)
What I mean to say is that with the Everything search window open, I still get error 4.
No, the ES command line interface does not work when executed from within the web app. I get a similar response from it:
"Everything IPC window not found, IPC unavailable."
Exit code is 1
I'm using version 1.3.4.686 (x86)
There are two accounts on this windows server and both are administrators so running as a standard user isn't possible on this server, to my knowledge. (Though, if you mean have I unchecked "Run as administrator" in Everything options, then yes. I have tried that with no change in results)
Changing CreateNoWindow to false had no effect.
> Is Everything running with a instance name?
I'm not sure what you mean.
I wrote a small console app to use the SDK and the ev tool. Both work as expected on the server from the console app.
The IIS worker runs in a different Terminal Server Session than normal applications so I don't think it can interact with the everything process running in my windows session, but I don't know why the ev tool can't work from within IIS.
Good news, I got it working by starting the everything.exe process first using `WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden`
My first attempt after that was to interact with es.exe to get the search results. It was necessary to run es.exe repeatedly *on my first attempt* because the everything.exe process was still in the process of launching and not completely ready for interactions from es.exe. This was ok. I simply repeated my request until I got a correct response which didn't take too long. Subsequent requests succeeded on the first attempt since everything.exe was functional and ready for requests.
Then instead of es.exe I switched to using the SDK. The SDK doesn't seem to have the same issue of failing the first request due to everything.exe being in an unready state. Can you clarify this for me? Does the SDK handle the case for me where everything.exe is unready and waits until it is ready? Or is this a fluke and I should still wrap my requests in a loop to try repeatedly until success/timeout?
Hmm, you said that es.exe uses the SDK, so I'm starting to think this was a fluke, but it seems to behave this way consistently. Curious.
The SDK doesn't seem to have the same issue of failing the first request due to everything.exe being in an unready state.
The SDK will return no results if Everything is not in a ready state. The same as ES. ES has a -timeout <milliseconds> option to wait for the db to be in the ready state before sending the query (by default it is off).
You will need to check if Everything is ready with the SDK Everything_IsDBLoaded function or IPC EVERYTHING_IPC_IS_DB_LOADED call.
Or is this a fluke and I should still wrap my requests in a loop to try repeatedly until success/timeout?
Put your SDK calls in a loop and check for Everything_IsDBLoaded / IPC EVERYTHING_IPC_IS_DB_LOADED before calling Everything_Query. At the start of the loop check for some timeout, see the ES source code for implementation.
Thanks for the feedback. I do not see Everything_IsDBLoaded documented nor can I find its use in the source code of ES. I tried the following but it always returns false: