NAV service failed to start: “HTTP could not register URL”

28 Aug

Tonight I had an issue with a NAV server that failed to start with the next error message:

Server instance: DynamicsNAV71

The service MicrosoftDynamicsNavServer$DynamicsNAV71 failed to start. This could be caused by a configuration error. Detailed error information:System.ServiceModel.AddressAlreadyInUseException: HTTP could not register URL http://+:7047/DynamicsNAV71/. Another application has already registered this URL with HTTP.SYS. —> System.Net.HttpListenerException: Failed to listen on prefix ‘http://+:7047/DynamicsNAV71/‘ because it conflicts with an existing registration on the machine.

image

 

Cause

The problem is that there can be different situations that lead to this error. In my case I was playing around with SSL certificates and switched SSL on web services on and off. After some investigation I found out that there was a URL registration done for https with port number 7047. Obviously, it is not possible to register a URL with the same port number, but with different protocols (http vs. https). And for some reason that I don’t know, the NAV Administration Management Console didn’t clean up the URL registrations.

To find out what the registered URL’s are, use the following command at a command prompt:

netsh http show urlacl

This command gives a list of registered URL’s as shown in the next picture. (This list is longer than shown here.)

image

Notice the https prefix in the URL.

Solution

The solution for this error is to manually recreate the URL registration. This can be done by first deleting the registered URL’s and then register the correct URL.

To delete these registered URL’s use the following command:

netsh http delete urlacl url=https://+:7047/DynamicsNAV71/

Repeat this for each URL that causes a problem (here both with port 7047 and 7048).

By the way: if you now try to start the NAV service, you will get an access denied error: HTTP could not register URL http://+:7047/DynamicsNAV71/. Your process does not have access rights to this namespace.

Registering the URL again is needed to get the service up and running. This can be achieved with the following command:

netsh http add urlacl url=http://+:7047/DynamicsNAV71/ user= “NT AUTHORITY\NETWORK SERVICE” listen=yes delegate=no sddl=”D:(A;;GX;;;NS)”

image

Now the NAV service will start succesfully!

More information about the Netsh commands for HTTP can be found here:
http://msdn.microsoft.com/en-us/library/windows/desktop/cc307236(v=vs.85).aspx

6 thoughts on “NAV service failed to start: “HTTP could not register URL”

  1. Pingback: NAV service failed to start: “HTTP could not register URL” - Microsoft Dynamics NAV Thoughts - Dynamics User Group

  2. I had similar error. but in my case the problem was with the ports configured for each services. By mistake I had defined same port values to multiple services.

    Btw, thanks for your post. this helps me to investigate further in the service and resolve the issue.

    Thanks again,
    R Thomas
    Sr. Developer
    Techcronus Business Solutions
    http://www.techcronus.com

  3. You are a life saver! I’ve spend a whole day for searching of the solution. Thank you very much for your post!

Leave a Reply

Your email address will not be published.