NAS Debug

Hi,

I’m trying to debug NAS, but I’m having some difficulties on it.

I’m using the below command to start NAS on command line:

NASSQL STARTUPPARAMETER=“ADCS ADCSID=NAS1”,SERVERNAME=SERVER01,DATABASE=

CRONUS,COMPANY=TESTCOMPANY,DEBUG,breakpoints=C:\breaks.xml

But I always get a message in the command line:

‘Sim’ is not an option;

The existing options are:

No,Yes

And I have no idea what option is NAS complaining.

Another thing that I don’t have idea is how the NAS debug work.

If I only put the parameter debug, what should happen? The debug windows open? That didn’t happen, when I only use debug without the breakpoints parameter nothing happens.

If I use debug and breakpoints parameters, I made the same question, what should happen? The debug windows only opens when reaches the breakpoint?

Do I need to have the NAV client open?

As you can see, I don’t understand much of it, so any help is useful.

Thanks in advance,

Mestre

Here is a .bat file that I run when I debug one of our NAS’s:

“C:\Program Files\Microsoft Business Solutions-Navision\SQL NAS 6\nassql.exe” Debug, appservername=“SQL JobMgr2”, servername=10.1.1.72, database=SWKLive, company=SWKLive, startupparameter=“IRMS,JOBMGR 2 30000”

It consists of the following:

You need the path to the executable in my case “C:\Program Files\Microsoft Business Solutions-Navision\SQL NAS 6\nassql.exe”

Debug (This should follow the path to the executable and a space)

Appservername (You seem to be missing it)

Servername (SERVER01)

Database (CRONUS)

Company (TESTCOMPANY)

StartUpParamenter (ADCS ADCSID=NAS1)

You would end up with something like this (different directory obvioulsy):

“C:\Program Files\Microsoft Business Solutions-Navision\SQL NAS 6\nassql.exe” Debug, appservername="???", servername=SERVER01, database=CRONUS, company=TESTCOMPANY, startupparameter=“ADCS ADCSID=NAS1”

Make sure you have a developer license in the NAS directory as well. This is important!!!

When you run this batch file it will pop up a debug window and let you set a breakpoint if you want. Once you set a breakpoint you can then hit F5. The debug window will disappear until it hits that breakpoint again. At that point you can step through the code as you would when debugging a client.

Start with this and see if you still get that Sim message. That seems specific to Codeunit 1 NASHandler Function, are you sure you have the correct StartupParameter?

Hi Jason,

Thanks for your answer, I help me a lot, it was the license, I didn’t put a developer’s license file on NAS directory.

After that I can start the debug but I get some errors but it starts working. The problem now is to stop the debug in the right spot; I tried to use the breakpoints parameter, but then I get the Sim message again.

I think you can open a client (not NAS) and set the breakpoint and then close the client completely. I am not 100% sure but I think NAS will use the same breakpoint file that the client uses.

Otherwise you have to step through the code the first time until you get to the point where you want to set a breakpoint and then set it and close out of the debugger. When NAS encounters that line of code again it will open the debugger back up.

Finally you can edit the breakpoint file or copy one from another machine (create one with a regular client). I just can’t remember where and what the file is called but I am sure you can find it if you dig around.

Hi Jason,

I already did that, I open the regular client, and put some breakpoints where I want, anc copy the xml file to the NAS directory. The problem that I have is that I get some errors when is trying initialize NAS in codeunit 7700 ADCS NAS Startup in the function “ComComIn::MessageReceived”(InMessage)

The stream has returned a write error.

The stream has returned a read error.

The stream has returned a read error.

The stream has returned a read error.

The stream has returned a read error.

The stream has returned a read error.

The stream has returned a read error.

The previous 20 reported events were identical.

In order not to overcrowd the message logging system, identical events will not be logged until after the program reports a different event

After this last message I don’t receive any more messages until I start the telnet session, then I get more messages and between in the telnet session I get the a message that it lost communication with NAS.

And because of that I never could get the breakpoints that I really need.

Can you compile Codeunit 7700? This codeunit is using some automation servers that I am not familiar with. Your problem isn’t with NAS it is with that codeunit. If you ran that code from a client you would get the same message. You need someone familiar with ADCS to help you with this.

By the way any messages or errors are put in the application when NAS runs. What you are seeing ("In order to not overcrowd…) is what NAS does when it continues to get the same error over and over. This probably won’t solve your problem but make sure there is a license file in the NAS directory and make sure the user attached to the service has the correct permissions.

To debug in NAS in NEP I

  1. Used a .BAT file with the following info:

“D:\Program Files\Microsoft Dynamics NAV\Application Server\nassql.exe” Debug,Breakpoints=D:\Breakpoints.xml,appservername=-SQL,servername=servername,DATABASE=,company=,startupparameter=NEP-1

  1. In the debug window that appeared I unchecked the “Break on triggers” and pressed F5

  2. Ran the application

  3. Set a breakpoint where it encounters an error and breaks or created an error (e.g. ERROR(‘test’) )then set breakpoints. The breakpoints will be saved in the .XML which I created. [:)]