Why does NAS stop?

AlishaAlisha Member Posts: 217
Hi,

I'm running NAS for a WebService on a customer server, but I don't know why it stops suddenly and a message appears : "Press any key to continue..". Before the message it was working fine, without errors...

Anyone knows the reason for this?

Thanks a lot, and merry christmas!

Comments

  • garakgarak Member Posts: 3,263
    edited 2005-12-28
    Can you see this message in the EventLog :?:
    Is the an confirm in your code :?:
    Can you reproduce this, when you start the NAS-CU manually:?:


    PS. Its deadly to show error, message, testfield, confirms or anything else when using the NAS! If your code will be use by nas and manually use [Ok:=] GUIALLOWED()

    regards
    Do you make it right, it works too!
  • DenSterDenSter Member Posts: 8,307
    NAS does not know how to handle user input, so if you have a 'press a key to continue' message, the logic is waiting for someone to press a key. Nas can't do that, so the logic just sits there forever.

    You will have to provide for a user-less way to handle this situation. There's a keyword in Navision that you can use called 'GUIALLOWED':
    IF GUIALLOWED THEN BEGIN
      // this is if you can have a user interface
      Ok := CONFIRM('are you sure?');
    END ELSE BEGIN
      // here is where you put your NAS code
      // NAS can't show the confirmation message
      // so you program the response yourself
      Ok := FALSE;
    END;
    
    It feels like your webservice returns something that you need to handle differently.
  • AlishaAlisha Member Posts: 217
    Now NAS is not running as a service, but in a console mode, so we can see the messages we put to debug... I have two NAS executing at the same time, and both of them stop at the same point.

    It happened last night, when no one was working, so I don't think that a confirm, error, or something like this is the cause.

    It stops the same way as when you press ESC to stop it manually.
  • DenSterDenSter Member Posts: 8,307
    In your initial post you said that it fails when it says "Press any key to continue..", which to me sounds like this program is waiting for user input. NAS will not continue running if you put logic like that in it, because it is not able to do that, due to the interface-less state of NAS.

    An ERROR will write the error message to the event log, and it will abort the process just like it would in a regular Navision session, so if you don't handle errors well enough in your code, it will stop the NAS.

    You will need to give us more information.
  • garakgarak Member Posts: 3,263
    Give some more informations please.
    Do you make it right, it works too!
  • AlishaAlisha Member Posts: 217
    I'm sorry.. I don't have more information. I only know that our customer called three times yesterday because he went to his server, and he saw the NAS as I told you, it had stopped and the message "Press a key to continue..." appeared. It's exactly the same as when I want to stop it and press ESC.

    The web service has just began to run this week, so we are still debugging errors. The NAS windows (we have one only to print PDF's and another one for everything else) show many messages, and sometimes errors like "overflow when converting text to code", and things like that, but it continues working.

    Is it possible that if may errors appear, it stops? I started it yesterday morning, and now it is still running, it hasn't stopped. I think there haven't been any error this time, so maybe this is the problem.

    This is everything I know.

    Thanks everyone!
  • kinekine Member Posts: 12,562
    "Press any key to continue.." - I think it is the message, which is used after NAS ends the run. For example, when the CU is not singleinstance...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • pduckpduck Member Posts: 147
    You must be careful when running NAS in the console. The console generally runs in Edit-Mode, and when the window gets the focus (moving mouse because of Screensavers, Virtual Key sends, Login via RDP session e.g.) the NAS will stop.

    Be sure that the Edit Options "Quick Edit Mode" and "Insert Mode" in the System Menu / Properties of your Console Window are deactivated!
Sign In or Register to comment.