Microsoft Dynamics AX Support

This blog contains posts by the Microsoft Dynamics AX Support Teams Worldwide

AX client cannot connect to AOS or crash at start up when AX database restored from another environment

Two symptoms have been detected so far:

  1. AX Client may not crash, but you will see dialog failed to connect to AOS in a second or two after launch Ax32.exe
  2. AX Client will crash with call stack below:

    00 Ax32!std::_Tree<std::_Tmap_traits<formMessageSecurityRule::Message,formMessageSecurityRule *,std::less<formMessageSecurityRule::Message>,std::allocator<std::pair<formMessageSecurityRule::Message const ,formMessageSecurityRule *> >,0> >::_Lbound

    01 Ax32!std::_Tree<std::_Tmap_traits<formMessageSecurityRule::Message,formMessageSecurityRule *,std::less<formMessageSecurityRule::Message>,std::allocator<std::pair<formMessageSecurityRule::Message const ,formMessageSecurityRule *> >,0> >::lower_bound

    02 Ax32!std::_Tree<std::_Tmap_traits<formMessageSecurityRule::Message,formMessageSecurityRule *,std::less<formMessageSecurityRule::Message>,std::allocator<std::pair<formMessageSecurityRule::Message const ,formMessageSecurityRule *> >,0> >::find

    03 Ax32!formMessageSecurity::DoMessageSecurity

    04 Ax32!AxWnd::AxWndBase::ProcessViaMSGInterface

    05 Ax32!AxWnd::AxMainFrame::ProcessWindowMessage

    06 Ax32!WTL::CMDIFrameWindowImpl<AxWnd::AxMainFrame,WTL::CMDIWindow,ATL::CWinTraits<114229248,262400> >::MDIFrameWindowProc

    07 user32!_InternalCallWinProc

    08 user32!InternalCallWinProc

    09 user32!UserCallWinProcCheckWow

    0a user32!CallWindowProcAorW

    0b user32!CallWindowProcW

    0c Ax32!ATL::CContainedWindowT<ATL::CWindow,ATL::CWinTraits<1442840576,0> >::DefWindowProcW

    0d Ax32!ATL::CContainedWindowT<ATL::CWindow,ATL::CWinTraits<1442840576,0> >::WindowProc

    0e user32!_InternalCallWinProc

    0f user32!InternalCallWinProc

    10 user32!UserCallWinProcCheckWow

    11 user32!DispatchClientMessage

    12 user32!__fnINDEVICECHANGE

    13 ntdll!KiUserCallbackDispatcher

    14 user32!_PeekMessage

    15 user32!PeekMessageW

    16 combase!CCliModalLoop::MyPeekMessage

    17 combase!CCliModalLoop::HandlePendingMessage

    18 combase!CCliModalLoop::HandleWakeForMsg

    19 combase!CCliModalLoop::BlockFn

    1a combase!ClassicSTAThreadWaitForHandles

    1b combase!CoWaitForMultipleHandles

    1c clr!MsgWaitHelper

    1d clr!Thread::DoAppropriateAptStateWait

    1e clr!Thread::DoAppropriateWaitWorker

    1f clr!Thread::DoAppropriateWait

    20 clr!CLREventBase::WaitEx

    21 clr!CLREventBase::Wait

    22 clr!WaitForEndOfShutdown_OneIteration

    23 clr!WaitForEndOfShutdown

    24 clr!EEShutDown

    25 clr!HandleExitProcessHelper

    26 clr!EEPolicy::HandleExitProcess

    27 clr!ForceEEShutdown

    28 clr!ExternalShutdownHelper

    29 clr!ShutdownRuntimeWithoutExiting

    2a mscoreei!RuntimeDesc::ShutdownAllActiveRuntimes

    2b mscoreei!CorExitProcess

    2c msvcr90!__crtCorExitProcess

    2d msvcr90!doexit

    2e msvcr90!exit

    2f Ax32!ExceptionFilterFunc

    30 KERNELBASE!UnhandledExceptionFilter

    31 ntdll!RtlpThreadExceptionFilter

    32 ntdll!__RtlUserThreadStart

    33 ntdll!_RtlUserThreadStart

But the root cause behind this is the dirty data in table SYSSERVERCONFIG, if the field SERVERID is incorrect or we have more than records in this table than the actual AOS number, Client will have a chance to connect to the wrong SERVERID and fail.
The actual error call stack in AX Client as below:

00 kernelbase!RaiseException

01 rpcrt4!RpcpRaiseException

02 rpcrt4!RpcRaiseException

03 rpcrt4!NdrGetBuffer

04 rpcrt4!NdrClientCall2

05 ax32!ServerGetLoadBalanceServers

06 ax32!GetLoadBalanceServers

07 ax32!CSessionMgr::GetLoadBalanceServers

08 ax32!Srv_DBSessionGet

09 ax32!CSessionMgr::CreateNewClientSession

0a ax32!CSessionMgr::CreateMainSession

0b ax32!gopts

0c ax32!xApp::init

0d ax32!AxWnd::AxMainFrame::OnXMInit

0e ax32!AxWnd::AxMainFrame::ProcessWindowMessage

0f ax32!WTL::CMDIFrameWindowImpl<AxWnd::AxMainFrame,WTL::CMDIWindow,ATL::CWinTraits<114229248,262400> >::MDIFrameWindowProc

10 user32!_InternalCallWinProc

11 user32!InternalCallWinProc

12 user32!UserCallWinProcCheckWow

13 user32!CallWindowProcAorW

14 user32!CallWindowProcW

15 ax32!ATL::CContainedWindowT<ATL::CWindow,ATL::CWinTraits<1442840576,0> >::DefWindowProcW

16 ax32!ATL::CContainedWindowT<ATL::CWindow,ATL::CWinTraits<1442840576,0> >::WindowProc

17 user32!_InternalCallWinProc

18 user32!InternalCallWinProc

19 user32!UserCallWinProcCheckWow

1a user32!DispatchMessageWorker

1b user32!DispatchMessageW

1c ax32!AxWnd::AxApp::go

1d ax32!AxWnd::AxApp::main

1e ax32!wWinMain

1f ax32!__tmainCRTStartup

20 ax32!DomainBoundILStubClass.IL_STUB_PInvoke()

21 clr!CallDescrWorkerInternal

22 clr!CallDescrWorkerWithHandler

23 clr!MethodDescCallSite::CallTargetWorker

24 clr!MethodDescCallSite::Call_RetArgSlot

25 clr!RunMain

26 clr!Assembly::ExecuteMainMethod

27 clr!SystemDomain::ExecuteMainMethod

28 clr!ExecuteEXE

29 clr!_CorExeMainInternal

2a clr!_CorExeMain

2b mscoreei!_CorExeMain

2c mscoree!ShellShim__CorExeMain

2d mscoree!_CorExeMain_Exported

2e kernel32!BaseThreadInitThunk

2f ntdll!__RtlUserThreadStart

30 ntdll!_RtlUserThreadStart

Solution:

Check the records in table SYSSERVERCONFIG and make sure you have the correct SERVERID, also have the same records as the actual AOS instances. After changes made in that table please restart AOS to take effect.