NetTalk Central

Author Topic: NTWS sometimes exits without error! Help!  (Read 17318 times)

Jeffrey Kuijt

  • Full Member
  • ***
  • Posts: 142
    • View Profile
    • Email
NTWS sometimes exits without error! Help!
« on: May 29, 2012, 10:26:25 PM »
Hi Bruce,

Using Clarion 6.3 9058 EE (ABC) with NT 5.39 with TPS files.

My customer runs our NTWS application on a Windows 2003 SBS Server SP2.
The application and data (TPS files) are on a H-share which is on a Synology NAS (and it has to be on that location).
My customer has to restart our NTWS application once or twice a day.

They work with multiple people and suddenly their browser isn't responding anymore (connection lost), sometimes when they simply page through the records of a browse and sometimes when they click on OK to submit the form. They use IE8, IE9, Firefox 11, Chrome and Safari 5 on pc's and Macs as browser.

When the connection has lost, my customer looks at that moment on their server:
- At the right bottom, the taskbar icon (which I handle with WinEvent) of the NTWS is still shown, but when you hover with the mouse over it, the taskbar icon disappears.
- NTWS shows no errors at all.
- In the Windows Event Log of the server, also NO errors are found.
- I use CapeSoft MessageBox to log errors etc, but also NO errors in the log file.

Could it be the threading issue with the TopSpeed file driver on a multicore system?
Today I will touch the NTWS exe with imagecfg to bind the exe to 1 core and see if that helps.

I have also seen myself this issue on my own machine (with Intel Core i7), but very very rarely.

Bruce, do you have some advice?

Best regards
Jeffrey

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NTWS sometimes exits without error! Help!
« Reply #1 on: May 29, 2012, 11:48:05 PM »
Hi Jeffrey,

The "binding to 1 core" will be interesting, but it's not a long-term solution, because you most definitely want to use multiple cores.

a couple of things spring to mind though with regards to narrowing down the problem.

a) update to the latest NT5, or better yet NT6. There's a lot that gets fixed along the way, and 5.39 is some years old now. So it's possible you're encountering a problem that has already been sorted out.

b) do you have GPF Reporter in the app? If not it might be worth adding it. It will often record the error (which in turn helps to identify the cause) and it'll also restart the server automatically if it is actually GPF'ing.

c)add something in the "normal shutdown" embed to log that the program is "being closed normally". This will help determine if perhaps the app is being shutdown intentionally, either perhaps by your code (by mistake), by the user (by mistake) or by some other program running on the server.

d) monitor the RAM usage on the server. Windows will spit a program off it it is either using too much ram, or accumulating ram usage too quickly. Since a web server starts lots of threads, and each thread uses up ram, it is possible to overload the server if you haven't set the thread "limit" in some way. also uploading files (especially large files) could consume a lot of ram. So if the serer is using a lot of ram when it spits the program off, that's a sign as well.

there's no solver bullet to finding the cause, but each test eliminates some possibilities.

cheers
Bruce


Jeffrey Kuijt

  • Full Member
  • ***
  • Posts: 142
    • View Profile
    • Email
Re: NTWS sometimes exits without error! Help!
« Reply #2 on: May 30, 2012, 12:37:01 AM »
Hi Bruce,

> a) update to the latest NT5, or better yet NT6.
I will, soon.

> b) do you have GPF Reporter in the app?
No, I don't have GPF Reporter, but I think it won't help, because no errors are shown and no errors are logged in Windows Event Log and CS MessageBox.

> c) add something in the "normal shutdown" embed
I already have. When you exit the taskbar icon or close the NTWS screen, CS MessageBox writes an entry in the log file, but in this case, NO entry is written in the log file, because NTWS has "disappeared" suddenly.

> d) monitor the RAM usage on the server.
I already have done that and the usage is very low/normal.
No files are being uploaded in our application.

> ... it is possible to overload the server if you haven't set the thread "limit" in some way.
How can I set this? Where?

BTW: My client is now testing a new version of my NTWS application which I have bound to 1 core with imagecfg.

Thanks and best regards
Jeffrey

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NTWS sometimes exits without error! Help!
« Reply #3 on: May 30, 2012, 05:43:31 AM »
>> No, I don't have GPF Reporter, but I think it won't help, because no errors are shown and no errors are logged in Windows Event Log and CS MessageBox.

Not all GPF's are visible, and If it _is_ a GPF (not yet determined in this case yet) then there's a good chance it'll show up in the GPF Reporter log not the Windows event log or MessageBox logs.

Let us know how the rest of the test goes.

cheers
Bruce

Jeffrey Kuijt

  • Full Member
  • ***
  • Posts: 142
    • View Profile
    • Email
Re: NTWS sometimes exits without error! Help!
« Reply #4 on: May 30, 2012, 05:53:38 AM »
Hi Bruce,

Thanks, so implementing GPF Reporter would be a good choice you think?

Question about GPF Reporter:
I think you can set an option in GPF Reporter to restart the exe when a gpf occurs, right?
If yes, is it possible to set the Startup folder in GPF Reporter?
In our case the exe is for example in the folder H:\APPLICATION\app.exe but the data is in the folder H:\DATA, so GPF Reporter needs to know where to find the data when it restarts the exe.

EDIT: My client just called me and saw this error of my NTWS application on the server, see jpg attachment: InPageError?
BUT my application (bound to 1 processor) is still running ok; so it looks like it's a message of a previous crash that now is shown on the screen (after he rebooted the server).


Best regards
Jeffrey


[attachment deleted by admin]
« Last Edit: May 30, 2012, 06:36:24 AM by Jeffrey Kuijt »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NTWS sometimes exits without error! Help!
« Reply #5 on: May 30, 2012, 07:54:38 AM »
Hi Jeffrey,

I think it's safe to say I have no idea what the error says, or what it means...

>> Thanks, so implementing GPF Reporter would be a good choice you think?

I think so yes. I have it in my server apps. Will it definitely find the problem? nope. Given that you're not actually seeing a GPF I'm not terribly hopeful that it will solve the problem. Of course if it does then that's good.

It's generally a good thing to add to servers though - I've found an awful lot of problems using it, and it's one of my favorite bits of kit.

>> Question about GPF Reporter:
>> I think you can set an option in GPF Reporter to restart the exe when a gpf occurs, right?

yes. The key thing of course being the "when a GPF occurs" bit.

>> If yes, is it possible to set the Startup folder in GPF Reporter?

nope.

>> In our case the exe is for example in the folder H:\APPLICATION\app.exe but the data is in the folder H:\DATA, so GPF Reporter needs to know where to find the data when it restarts the exe.

You're using the "start in" folder to determine the data directory? That's ok I guess, but not a great technique. It's much better for a program to determine the data location directly (ie load it from a INI file or whatever) when it runs. It can then set the "start in" directory itself (using SETPATH). Relying on the shortcut is considered "poor form".

cheers
Bruce

Jeffrey Kuijt

  • Full Member
  • ***
  • Posts: 142
    • View Profile
    • Email
Re: NTWS sometimes exits without error! Help!
« Reply #6 on: May 30, 2012, 09:18:09 AM »
Hi Bruce,

> Relying on the shortcut is considered "poor form".

Why is that?
I use multiple shortcuts to run multiple datasets with only one and the same exe, for example:

NTWS company A:
Target=h:\application\app.exe
Start in=h:\dataA

NTWS company B:
Target=h:\application\app.exe
Start in=h:\dataB

etc.

It's a pity that GPF Reporter cannot handle this.
How would you handle this with an INI file for multiple datasets?

Best regards
Jeffrey

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: NTWS sometimes exits without error! Help!
« Reply #7 on: May 30, 2012, 04:03:22 PM »
I find it easy to add it as a command switch to the shortcut.

Target=h:\application\app.exe /h:\dataA
Start in=h:\application

Jeffrey Kuijt

  • Full Member
  • ***
  • Posts: 142
    • View Profile
    • Email
Re: NTWS sometimes exits without error! Help!
« Reply #8 on: May 30, 2012, 10:10:11 PM »
Hi,

Do you know how GPF Reporter restarts the exe when it has crashed?
And when the exe has crashed, is there some way to get the data directory so that I could do a SETPATH and after that the exe will be restarted with the correct data folder?

Best regards
Jeffrey

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NTWS sometimes exits without error! Help!
« Reply #9 on: May 31, 2012, 02:19:15 AM »
Hi Jeffrey,

I _think_ that it restarts the exe with all the command line parameters that it was started with. ie I _think_ Kevin's approach would work - although it's been a long time since I last needed to check this level of detail.

>> And when the exe has crashed, is there some way to get the data directory so that I could do a SETPATH and after that the exe will be restarted with the correct data folder?

you can do some stuff (ie embed some code) when a program crashes, but there are some limitations because, well, the program has actually crashed, so some functionality is off-limits.

that said, I'm not sure how easy it is to set the "start in" folder when running one program from another. Personally I'd probably recommend a simpler approach if I were you.

cheers
Bruce

Jeffrey Kuijt

  • Full Member
  • ***
  • Posts: 142
    • View Profile
    • Email
Re: NTWS sometimes exits without error! Help!
« Reply #10 on: May 31, 2012, 02:55:33 AM »
Hi Bruce,

> I _think_ that it restarts the exe with all the command line parameters that it was started with.
> ie I _think_ Kevin's approach would work - although it's been a long time since I last needed to check this level of detail.


Well, in order to buy GPF Reporter, it would be very important for us to know if the exe will restart with all the command line parameters that it was started with.
So that we could use it in our situation.  ;)

Can you check this please?

Best regards
Jeffrey

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: NTWS sometimes exits without error! Help!
« Reply #11 on: May 31, 2012, 04:17:30 AM »
Hi Jeffrey,

Is it GPFing or just shutting down?

If you have self service there is an example proj called connection checker which will restart the exe if it detects it not running (not GPF'd)

In that case I would be inclined to move the setpath to an ini file and read/set the path at startup.

HTH's

Kevin

Jeffrey Kuijt

  • Full Member
  • ***
  • Posts: 142
    • View Profile
    • Email
Re: NTWS sometimes exits without error! Help!
« Reply #12 on: May 31, 2012, 04:29:50 AM »
Hi Kevin,

We get no GPF, NTWS just "disappears", also from the Task Manager.
At this moment we don't have GPF Reporter and SelfService.

We have multiple shortcuts (as I described above) to run multiple administrations (datasets) with one and the same exe.
So in Task Manager you see:
- app.exe (which starts in h:\dataA)
- app.exe (which starts in h:\dataB)
- app.exe (which starts in h:\dataC)
- etc.

So the problem/question is:
How can we tell to GPF Reporter or SelfService to restart the administration (for example CompanyA = h:\dataA) that is "disappearing"?

Best regards
Jeffrey

bruce2

  • Full Member
  • ***
  • Posts: 108
    • View Profile
    • Email
Re: NTWS sometimes exits without error! Help!
« Reply #13 on: May 31, 2012, 06:28:09 AM »
>> if the exe will restart with all the command line parameters that it was started with.

yes, I checked, it does.

>> How can we tell to GPF Reporter or SelfService to restart the administration (for example CompanyA = h:\dataA) that is "disappearing"?

use a command line parameter, rather than the "start in" approach to determine which data set it should use. the COMMAND and SETPATH clarion commands will be useful here.

cheers
Bruce

Jeffrey Kuijt

  • Full Member
  • ***
  • Posts: 142
    • View Profile
    • Email
Re: NTWS sometimes exits without error! Help!
« Reply #14 on: May 31, 2012, 06:39:04 AM »
Thanks Bruce!

Best regards
Jeffrey