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.
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.)
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)”
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
Pingback: NAV service failed to start: “HTTP could not register URL” - Microsoft Dynamics NAV Thoughts - Dynamics User Group
Excellend post, thank you.
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
I got these kind of errors but your post help me to point out the errors thanks for sharing.
Very helpful… thanks.
You are a life saver! I’ve spend a whole day for searching of the solution. Thank you very much for your post!
Thanks for the article! For those who after all described manipulations still struggle with SSL / HTTPS not working for Web services, check these commands:
netsh http show sslcert
netsh http add sslcert
To show installed certificates and to install one if missing
Thank you so much
Thank you so much solved my problems after a long time
this error appears when URL is already registered with same parameters, and the instance for some reason doesnt overwrite it, so you need to simply delete the record as suggested. One thing Microsoft could improve on is: before writing a registration check if it already exists, if it does delete it, and let the instance handler create it again. Its a bug in my opinion.