NetTalk Central

Author Topic: Failing on Loc:Err = RM.Open()?  (Read 1143 times)

JohanR

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Failing on Loc:Err = RM.Open()?
« on: June 06, 2023, 02:26:26 AM »

Hi,

I have a NTWS that after some time, anything between 1 and 10mins stops serving any page with file access.
Server not hanging, just any page with file access is a problem, it executes and I have traced it to the RM.Open() line

Static pages no issue

any idea on how to debug this greatly appreciated

thanks
Johan


####################
CODE
####################

p_web.OpenFile PROCEDURE(FILE p_file)

ReturnValue          LONG,AUTO

! Start of "NetTalk Method Data Section"
! [Priority 2000]

RM      &RelationManager
Loc:Err Long(-1)
! [Priority 7000]

! End of "NetTalk Method Data Section"

  CODE
  ! Start of "NetTalk Method Executable Code Section"
  ! [Priority 2000]
    p_web.trace('p_web.OpenFile:' & 'zaq1')
    RM &= NetWebRelationManager(p_File)
    p_web.trace('p_web.OpenFile:' & 'zaq2')
    If NOT RM &= Null
       p_web.trace('p_web.OpenFile:' & 'zaq3')   
       Loc:Err = RM.Open()
       p_web.trace('p_web.OpenFile:' & 'zaq4')   !<<<<<<<<<<<<<<<< does not reach zaq4 !
       self.SetErrors()
       p_web.trace('p_web.OpenFile:' & 'zaq5')
    else
       p_web.trace('p_web.OpenFile:' & 'zaq6')
    End
    p_web.trace('p_web.OpenFile:' & 'zaq7')
    Return Loc:Err
    p_web.trace('p_web.OpenFile:' & 'zaq8')


####################
Debug trace
####################
[st] [netTalk][thread=57] _NetAll._LoggingSetup - Initialisation
TVC_check_alive_111:Entry Not Found
TVC_check_alive_666:Entry Not Found
TVC_check_alive_a1:Entry Not Found
[st] [netTalk][thread=57] p_web.OpenFile:zaq1
[st] [netTalk][thread=57] p_web.OpenFile:zaq2
[st] [netTalk][thread=57] p_web.OpenFile:zaq3   <<<<<<<<<<<<<<<< does not go beyond zaq3
[NetDLL] [2] CallBackWindowClientCallBack() :  Count=1 p_wMsg = 8180 wParam = 1136 (lParam = 8) = Loc:WSAGetSelect.Err = 0 & Loc:WSAGetSelect.Event = 8. p_hWnd = 2033774
[NetDLL] [2] SimpleServer_Accept() : Server FD_ACCEPT ------
[NetDLL] [2] SimpleServer_Accept() : a1 num connections= 1
[NetDLL] [2] SimpleServer_Accept() : a2 num connections= 1
[NetDLL] [2] SimpleServer_Accept() : a3 num connections= 1
[NetDLL] [2] SimpleServer_Accept() : a4 num connections= 1
[NetDLL] [2] SimpleServer_Accept() : Before GetNextMessageNumber
[NetDLL] [2] SimpleServer_Accept - GetNextMessageNumber() : loc:ux = 1 NETDLL:WM:CurrentSimpleServerConnections = 10537
[NetDLL] [2] SimpleServer_Accept - GetNextMessageNumber() : Before Clear
[NetDLL] [2] SimpleServer_Accept - GetNextMessageNumber() : After Clear - Before Assign
[NetDLL] [2] SimpleServer_Accept - GetNextMessageNumber() : After Assign - Before Get
[NetDLL] [2] SimpleServer_Accept - GetNextMessageNumber() : After Get - Before Er_Code
[NetDLL] [2] SimpleServer_Accept - GetNextMessageNumber() : loc:OurErr = 30
[NetDLL] [2] SimpleServer_Accept() : After GetNextMessageNumber
[NetDLL] [2] SimpleServer_Accept() : About to accepted new connection on current listening server port socket using = 1136 WinMsg (for callback on this socket) = 10537
[NetDLL] [2] SimpleServer_Accept() : num connections= 1
[NetDLL] [2] SimpleServer_Accept() : Accepted new socket connection on listening port = 80 new Socket = 3048 SockID = 359 from IP = 127.0.0.1 (Remote Port = 1908) WinMsg (for callback on this socket) = 10537
[NetDLL] [2] SimpleClearInQueue() : Start of function. IP = 0.0.0.0 Socket = 3048 SockID = 359
[NetDLL] [2] SimpleClearInQueue() : Normal check. (Nothing deleted)
[NetDLL] [2] SimpleClearOutQueues() : Start of function. IP = 0.0.0.0 Socket = 3048 SockID = 359
[NetDLL] [2] SimpleClearOutQueues() : Normal check. (Nothing deleted)
[NetDLL] [2] SimpleServer_Accept() : a6 num connections= 1
[NetDLL] [2] SimpleServer_Accept() : a7 num connections= 1
[NetDLL] [2] SimpleServer_Accept() : This socket is connected using Local IP = 127.0.0.1
[NetDLL] [2] SimpleServer_Accept() : The number of total connections on all NetSimple listening ports is now records(qSimpleServerConnections) = 2
[NetDLL] [2] SimpleServer_Accept() : Posted Notification of new connection. _DebugPacketNumber = 1069 Thread = 1 Event = 2053
[NetDLL] [2] CallBackWindowClientCallBack() : End of Function - will Return (1)
[st] [netTalk][thread=1] NetWebServer._GarbageCollector - SessionID = tXzjOOod1lp5dY6r3l1nwS08EFvhIB has expired.


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11158
    • View Profile
Re: Failing on Loc:Err = RM.Open()?
« Reply #1 on: June 06, 2023, 11:44:31 PM »
sounds like the server is unable to open a file.
which means you may have lost your connection to your database.
What backend are you using?

JohanR

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Re: Failing on Loc:Err = RM.Open()?
« Reply #2 on: June 07, 2023, 04:26:04 AM »
Hi Bruce

IPserver,
data connection is my deduction as well.
currently doing some file access tests, and adding more trace lines
but also trying to see how to post message to user if something similar occurs.

thanks

Johan


JohanR

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Re: Failing on Loc:Err = RM.Open()?
« Reply #3 on: June 07, 2023, 04:51:34 AM »
Hi Bruce

Are there any do's and dont's for data/file handling in a NTWS?

I have added a bunch of code all over the show along with functions that do calculations and lots of data access and concerned that I've slipped in some data access code that could be mangling things and confusing the RelationShipManager.
eg.
correct way to open and close files, in a NTWS server procedure and then also in a standalone function

regards

Johan


JohanR

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Re: Failing on Loc:Err = RM.Open()?
« Reply #4 on: June 07, 2023, 05:24:10 AM »
Hi,

I have found some posts on Nettalkcentral relating to file handling.


thanks

Johan

 

seanh

  • Jr. Member
  • **
  • Posts: 83
    • View Profile
    • Email
Re: Failing on Loc:Err = RM.Open()?
« Reply #5 on: June 09, 2023, 10:48:47 PM »
A slight problem with NTWS is that if the file operation fails, you don't always know about it. 
I've had a few problems with relational constraints in the DB, and a few other things, that just sort of fail silently.
While using MessageBox catches some, it doesn't catch any that don't notify.
I only found them by turning on the Clarion driver trace and looking at that.

JohanR

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Re: Failing on Loc:Err = RM.Open()?
« Reply #6 on: June 10, 2023, 06:24:12 AM »
Hi Sean

Thanks for the info

Johan