Created On:  21 March 2011

Problem:

When deploying a web service you get the following error in a dialog box:

<html><head><title>Error - File Not Available</title>

<meta name="robots" content="noindex"></meta>

<body><h2>HTTP Error 404 - File Not Available</h2>

<p>The requested file is not available</p>

</body></html>

Resolution:

A 404 error at the beginning of the deployment operation almost certainly means that MFCS was unable to locate either the mfdeploy.exe program or one of its path components, or one of the path components in the PATH_INFO portion of the URL.

Once the CAR file has been built and the server's deployment listener has been contacted, the deployment client (here the IMTK) does an HTTP POST operation to send the CAR file to the deployment receiver program, mfdeploy.exe. It uses a URL that specifies the virtual path to mfdeploy.exe and the virtual path to the deployment directory. In the out-of-the-box configuration that URL will look something like:

http://127.0.0.1:1234/cgi/mfdeploy.exe/uploads/myservice.car

Here the "127.0.0.1:1234" part is the IP address and port of the listener that will receive the deployment request (the port value will change each time ES is started). That's the "Web" listener in the ESDEMO configuration in MFDS. The "/cgi/mfdeploy.exe" part is the virtual path to the mfdeploy.exe program, which should be in the base\\bin directory of the NX4 installation; I'll explain below how that gets translated. The "/uploads" part is a virtual path to the deployment directory, which in the default configuration is base\\deploy. The "/myservice.car" is the name of the CAR file.

The information used to create that URL comes from the deployment service ("Deployer" in the default configuration), in its "Configuration Information" area.

The virtual directories "cgi" and "uploads" are translated into the "base\\bin" and "base\\deploy" directories under the NX4 installation area using settings in the "Configuration Information" area of the listener that receives the request. In the default configuration, that's the "Web" listener.

So, some of the things that could produce this 404:

- The configuration for the "Deployer" service has been altered or corrupted, and the generated URL is invalid.

- The configuration for the "Web" listener has been altered or corrupted, and the virtual directories in the URL can't be translated to valid real directories.

- mfdeploy.exe is missing from base\\bin (due to installation error, perhaps?).

- The base\\deploy directory is missing for some reason.

I'd suggest that the you check the MFCS log (from the MFDS home page, select "Details" for the server, then "ES Console", then "Comms Console") to see if there are any additional messages there. Then I suggest checking to make sure the mfdeploy.exe program is in base\\bin, and checking that the base\\deploy directory exists. If all of those are OK, check the MFDS configuration, particularly the Configuration Information fields for the "Web" listener and "Deployer" service.

It may also help to determine whether the problem is in locating mfdeploy.exe or translating the PATH_INFO (the "/uploads" portion of the URL). The following procedure should show whether MFCS can find mfdeploy.exe:

1. Make sure ESDEMO is started.

2. Go to MFDS. Examine the listeners for ESDEMO. Note the port number being used by the "Web" listener; that's the number after the second colon in the "Endpoint" information.

3. Browse the URL "http://localhost:x/cgi/mfdeploy.exe", where "x" is the port number from step 2. You should see a message like:

405: Method "GET" not allowed; use POST

If you see that message, MFCS was able to find and run mfdeploy.exe (this error message is generated by mfdeploy.exe itself).

If http://localhost:2205 works, but http://localhost:2205/cgi fails, that indicates there's either a problem with the configuration of the "Web" listener in MFDS, or a bug in MFCS.  Actually, the customer should get a 404 for http://localhost:2205, since there's supposed to be a configuration entry for the Web listener that says:

=/dev/null

which should prevent browsing the drive's root directory.  (I've seen this not work sometimes on NX4sp1.  Apparently there was a sporadic bug with virtual drive translation in the Web listener, or possibly a bug in MFDS when it provided the configuration information to MFCS.)

So I would recommend the customer try the following:

1. Go to MFDS (http://localhost:86).

2. Click on the Details button next to the "listeners" entry on the main page; this will go to the Listeners page.

3. Click the Edit button for the "Web" listener.

4. Go to the text box that's labelled "Configuration Information".  It should read:

[virtual paths]

cgi=/bin

uploads=/deploy

=/dev/null

5. I suggest copying that text from this note and pasting it into the configuration information text area, to be sure that MFDS has the correct information for this listener.

6. Hit the OK button to save the changes.

7. The listener should pick up the revised configuration almost immediately, but just to be sure I recommend stopping and restarting the server.

Now check the port number assigned to the web listener and try the http://locahost:/cgi/mfdeploy.exe test again.  (Note that to make this easier, the customer can edit the listener and assign an unused port to it, so it will always be on the same port.  I usually use port 9080 for ESDEMO's Web listener, since HTTP usually uses port 80 and ESDEMO's ports start at 9000.)

If everything seems correct but you are still getting a 404 error, disable temporarily any software firewall that you have running in your machine.

If it still fails, have the customer edit the listener again and add these lines to the end of the configuration:

[options]

logging=y

then try the test again.  MFCS should log some additional messages on each request to the Web listener, along the lines of:

Tuesday, February 24, 2004 11:18:25 AM TranslateVirtualDir: "cgi" -> "/bin"

Tuesday, February 24, 2004 11:18:25 AM TranslateVirtualDir: "" -> "D:\\Program Files\\Net Express 4.0\\Base"

Tuesday, February 24, 2004 11:18:25 AM TranslateVirtualDir (final stage): "/cgi/mfdeploy.exe" -> "D:\\Program Files\\Net Express 4.0\\Base/bin/"