SBX - Forum Post Title

Nav 2018 web client an error has occurred

Microsoft Dynamics NAV Forum

Question Status

Suggested Answer

The rtc is working fine on a service tier. I have created a new service tier and used new- The json file has been edited to use navuserpassword and when the browser is run the credentials are entered but the message "An error has occurred" is displayed"

The event log shows

Error accessing Website Raw Url: Url: Type: Microsoft.Dynamics.Nav.Types.NavServerNotFoundExceptionMessage: A server was not found at "net.tcp://nav2018demo:9046/web/Service". Either the URL is incorrect or the server is currently not available.StackTrace: at Microsoft.Dynamics.Nav.Client.ConnectionEstablisher.ConfirmOpenConnectionRetry(ConnectFailedEventArgs connectFailedArgs, Exception exception) in S:\Depot\NAV110\Platform\Client\Shared\Prod.Client.ServiceConnection\ConnectionEstablisher.cs:line 658 at Microsoft.Dynamics.Nav.Client.ConnectionEstablisher.OpenConnection[TChannel](ConnectFailedEventArgs connectFailedArgs, ConnectionRequest connectionRequest, ConnectionOptions connectionOptions, SpnSetting spnSettingToTry, Boolean allowSpnSettingsSwap, UserSettings& userSettings) in S:\Depot\NAV110\Platform\Client\Shared\Prod.Client.ServiceConnection\ConnectionEstablisher.cs:line 482 at Microsoft.Dynamics.Nav.Client.ConnectionEstablisher.OpenConnection[TChannel](ConnectionRequest connectionRequest, ConnectionOptions connectionOptions, UserSettings& userSettings) in S:\Depot\NAV110\Platform\Client\Shared\Prod.Client.ServiceConnection\ConnectionEstablisher.cs:line 216 at Microsoft.Dynamics.Nav.Client.Web.SimpleServerOperation.SimpleServerOperationConnectionEstablisher.OpenConnection[TChannel](ConnectionRequest connectionRequest, ConnectionOptions connectionOptions, UserSettings& userSettings) in S:\Depot\NAV110\Platform\Client\Web\Prod.Client.WebCommon\Security\SimpleServerOperation.cs:line 151 at Microsoft.Dynamics.Nav.Client.Web.SimpleServerOperation.ExecuteCore[TResult,TChannel](RequestContext requestContext, ConnectionOptions serverConnectionOptions, Func`2 operation, Func`3 operationWithContext, Func`2 localExceptionHandler) in S:\Depot\NAV110\Platform\Client\Web\Prod.Client.WebCommon\Security\SimpleServerOperation.cs:line 295 at Microsoft.Dynamics.Nav.Client.Web.SimpleServerOperation.Execute[TResult,TChannel](RequestContext requestContext, ConnectionOptions serverConnectionOptions, Func`2 operation, Func`2 localExceptionHandler) in S:\Depot\NAV110\Platform\Client\Web\Prod.Client.WebCommon\Security\SimpleServerOperation.cs:line 207 at Microsoft.Dynamics.Nav.Client.Web.UserValidator.ValidateUser(RequestContext requestContext) in S:\Depot\NAV110\Platform\Client\Web\Prod.Client.WebCommon\Security\UserValidator.cs:line 60 at Prod.Client.WebCoreApp.Authentication.UserPasswordAuthenticationProvider.<Authenticate>d__1.MoveNext()--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Dynamics.Nav.WebClient.Controllers.AuthenticationController.<SignIn>d__6.MoveNext()--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__27.MoveNext()--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextActionFilterAsync>d__25.MoveNext()--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextExceptionFilterAsync>d__24.MoveNext()Source: Microsoft.Dynamics.Nav.Client.ServiceConnection----------------------------------Type: System.Net.Sockets.SocketExceptionMessage: An existing connection was forcibly closed by the remote hostStackTrace: at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) at System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)

After spending hours looking thru google and contemplating the issue I finally resorted to opening a case with MS. Mohamad in Dubai was very experienced and told me that MS has had some issues with credentials but rest assured he could work thru the issues and fix it!

Well, he was very knowledgeable and we had a shared session to go over the possible issues. It is now working and I have listed some notes below that might help anyone else. Mohamad also agreed with me that the setup in NAV 2018 is not as good as it should be and it leaves a lot of the setup steps out meaning the result is a nonworking NAV. The good news is that in 2 versions from now there will be no GUI and Powershell will do all the work lol!

In my case, I had created a new service tier for my web client tests that I want to user NavUserPassword for and still had the original one in place and working using Windows Credentials. I was also just setting this up for testing and development so it is a workgroup server and not a member of an AD. The original service tier is the default one. Bear this in mind. NAV2018 uses Web core and the web.config is stripped out into navsettings.json where the server instance credentials etc are now for the web client. This is not a detailed step by step guide as I assume you are well versed with Windows tools.

Steps for NavUserPassword in NAV 2018Change service account of new service tier to domain user account and add this new account to the local admins groupplace public (I did not use a self-generated ssl cert) SSL cert in trusted store, as well as personal using MMC with cert store loadedright click SSL in personal all tasks and manage private key - give rights to nav tier service accountRun new-navwebinstance to create web virtual directory if it does not get created when you create the new service tierCheck that the website in IIS manager is set to the app pool with the name of the new virtual folder created in IIS and that the pool is set to no managed code if not change thisSet login in SQL for new nav service tier service account with sysadmin rightsCheck navsettings.json file in wwwroot, for the website, has the correct server/instance/ports and credential type as this will default to the same as the initial service tierrestart IIS when changes are maderestart nav service tier

You may need to use netsh http show urlacl to check the service tier ports are there.

The above is a bit of a brain dump so some of this may be a little off base but I hope it is enough to get you thru.