Jump to content

Recommended Posts

Posted

Hello everyone, we have been facing a problem for some time with the node "hanging" and disconnecting all sessions on it. I've encountered similar problems here on the forum, but all without concrete solutions.

Server Settings:
CPU 8X, 32GB, Windows server 2019 (Azure)
Unigui 1.90.0.1567 with Hyperserver exe 32-bits.
SSL: Yes (brhost)
Sql server database
Does not have anti-virus
Firewall ports open for application
We use 20 Nodes for an average of 170 connections.

We are suspicious that it has to do with routines that send files to the server, but it is random.
In the browser we receive error 503:

image.png.f84305829039286260d03dff15acced6.png

 

 

At this moment the hyperserver monitor records Suspended:
image.thumb.png.0c6432f262999a8349ae9936a7117675.png

Soon after, the hyperserver informs Purged and terminates the node with all connections
image.thumb.png.514868cf278e8a7700cc280e339f2b08.png

 

My hyperserver log file records like this:
image.thumb.png.473434e6ac82fbfbab0f6002ae3d211f.png

 

 

Has anyone gone through something similar? Do you have any solution?

Another question, I've seen users here on the forum informed about node logging, how can I enable this function on my server?


Yours sincerely

 

 

Posted

Below is an image of the node log at the time it gave the "Purgued" error.
Apparently the node log did not record any error messages during the period in which the failure occurred (11:44 to 11:45)

image.thumb.png.bbef6215fe3604a0f81256e2589d8ea8.png

 


I'm getting extremely worried about this glitch.

 

Yours sincerely

Posted

We just tracked down another crash failure. The node log does not provide more details about what happens at the time of the crash. In the example below, the file above is the hyperserver log and the one below is the node log (09:37 to 09:38)

image.thumb.png.78909c926f572be767c63d8409d0d939.png

Posted

@Farshad Mohajeri 
I found a failure in the windows event close to the log time. See below:
image.thumb.png.62970f6e1d6e99b7a35e9054ccacfc50.png

And information
image.thumb.png.0704fa196c141480613589cab03cd261.png

Information log details:
Version=1
EventType=BEX
EventTime=133620645023086464
ReportType=2
Consent=1
UploadTime=133620645026680222
ReportStatus=268435456
ReportIdentifier=3b435615-d40b-4c36-98ef-6a3200c41613
IntegratorReportIdentifier=a2cb4adf-1794-4bdb-8eda-bae0b50815bc
Wow64Host=34404

Wow64Guest=332
NsAppName=Client_Web.exe
AppSessionGuid=000055f8-0001-00e9-00de-6f1938b7da01
TargetAppId=W:00067eaa220da3364dc2687dac0e5b55c66b00000904!00001bf0dd153dc0c05b80c4b95732b67c0124b258dd!Client_Web.exe
TargetAppVer=2024//06//03:23:17:14!0!Client_Web.exe
BootId=4294967295
ServiceSplit=1998982016
TargetAsId=129657
IsFatal=1
EtwNonCollectReason=1
Response.BucketId=06a88a88e2c13caa15881789266123f1
Response.BucketTable=5
Response.LegacyBucketId=1551515949450994673
Response.type=4
Sig[0].Name=Nome do Aplicativo
Sig[0].Value=Client_Web.exe
Sig[1].Name=Versão do Aplicativo
Sig[1].Value=2.0.0.403
Sig[2].Name=Carimbo de Data//Hora do Aplicativo
Sig[2].Value=665e4efa
Sig[3].Name=Nome do Módulo de Falhas
Sig[3].Value=StackHash_db0d
Sig[4].Name=Versão do Módulo de Falhas
Sig[4].Value=0.0.0.0
Sig[5].Name=Carimbo de Data//Hora do Módulo de Falhas
Sig[5].Value=00000000
Sig[6].Name=Deslocamento de Exceção
Sig[6].Value=PCH_36_FROM_ntdll+0x00071C4C
Sig[7].Name=Código de Exceção
Sig[7].Value=c0000005
Sig[8].Name=Dados de Exceção
Sig[8].Value=00000008

 

 

From what we researched, the log points to memory corruption, that is, an access violation.However, we never received any reports of access violations in the application. I'll try to implement some exception logging tool so I can investigate further.
I would like to know if you have any tips that could help us identify this problem.


Thank you for your attention.

Posted

Hello, I'm still trying to solve the problem of my application closing unexpectedly.

I'm dealing with memory leak problems using (ReportMemoryLeaksOnShutdown := True;) and testing function by function. 

Even so, I think it may not be the solution to the problem, I'm trying to record all the application's exception logs but the class I use in the VCL doesn't apply to Unigui. An alternative would be to use the UniGUIServerModuleException event in ServerModule. I can detect the error through the AException.Message property but I can't know who triggered it. Is there a way to extract the "Form" source that generated the exception in UniGUIServerModuleException?

@Farshad Mohajeri

Thanks.

Posted
20 minutes ago, Fernando Silva said:

Olá, ainda estou tentando resolver o problema de meu aplicativo fechar inesperadamente.

Estou lidando com problemas de vazamento de memória usando ( ReportMemoryLeaksOnShutdown := True; ) e testando função por função. 

Mesmo assim, acho que pode não ser a solução para o problema, estou tentando registrar todos os logs de exceções da aplicação mas a classe que utilizo na VCL não se aplica ao Unigui. Uma alternativa seria usar o evento UniGUIServerModuleException  no ServerModule. Posso detectar o erro por meio da propriedade AException.Message , mas não consigo saber quem o acionou. Existe alguma forma de extrair a fonte do "Formulário" que gerou a exceção no UniGUIServerModuleException?

@Farshad Mohajeri

Obrigado.

EurekaLog

Posted

Hello everyone, thanks to @picyka help, I was able to adjust my ServerModule to record the exception information that I believe to be relevant.

 

procedure TUniServerModule.UniGUIServerModuleException(
  Sender: TUniGUIMainModule; AException: Exception; var Handled: Boolean);
...

    try
      lLog := TStringList.Create;
      lLog.Add('-----------------------------------------------------------------');
      lLog.Add('        Classe erro: ' + AException.ClassName);
      lLog.Add('     Messsagem erro: ' + AException.Message);

      if TUniGUIApplication(UniApplication) <> nil then begin

        lLog.Add('         Componente: ' + TUniGUIApplication(UniApplication).UniSession.CurrentComponent.Name +
         ' (' + TUniGUIApplication(UniApplication).UniSession.CurrentComponent.ClassName + ')');

        if TUniControl(TUniGUIApplication(UniApplication).UniSession.CurrentComponent).Owner <> nil then
         lLog.Add('            Parente: ' + TUniControl(TUniGUIApplication(UniApplication).UniSession.CurrentComponent).Owner.Name);

        lLog.Add('   Ult. Evento Ajax: ' + TUniGUIApplication(UniApplication).UniSession.LastAjaxEvent);

        lLog.Add('Navegador/Versão/OS: ' + TUniGUIApplication(UniApplication).ClientInfoRec.BrowserType + '/' +
         IntToStr(TUniGUIApplication(UniApplication).ClientInfoRec.BrowserVersion) + '/' +
          TUniGUIApplication(UniApplication).ClientInfoRec.OSType);
      end;
      lLog.Add('-------------------------------------------------------------------------------------');
    finally
      GravaLogErro(lLog.Text);
      lLog.Free;
    end;

;

...

Log File test:

11/06/2024 16:51:57 -----------------------------------------------------------------
        Classe erro: EAccessViolation
     Messsagem erro: Access violation at address 0141BC5E in module '***.exe'. Read of address 00000000
         Componente: UniButton10 (TUniButton)
            Parente: FrmTestesTI
   Ult. Evento Ajax: click
Navegador/Versão/OS: chrome/125/windows
-------------------------------------------------------------------------------------

11/06/2024 16:52:03 -----------------------------------------------------------------
        Classe erro: EAccessViolation
     Messsagem erro: Access violation at address 0141BC5E in module '***.exe'. Read of address 00000000
         Componente: UniButton10 (TUniButton)
            Parente: FrmTestesTI
   Ult. Evento Ajax: click
Navegador/Versão/OS: chrome/125/windows
-------------------------------------------------------------------------------------

11/06/2024 16:52:13 -----------------------------------------------------------------
        Classe erro: EInvalidOp
     Messsagem erro: Invalid floating point operation
         Componente: TMAutoIni (TUniTimer)
            Parente: FrmDashboardFinanceiro
   Ult. Evento Ajax: timer
Navegador/Versão/OS: chrome/125/windows
-------------------------------------------------------------------------------------

 

 

Now I'm going to go up to production and monitor it.

As I progress in analyzing the data, I will report it here to help other developers who may have similar problems.

Yours sincerely.

  • Like 1
  • Happy 1
  • Upvote 1
Posted

Hello @Weslley Capelari

Thanks for the answer. Unfortunately in my case, the project in question uses native HyperServer "exe" for application management and not IIS.
We even have other projects that run with ISAPI but we do not have the problem mentioned here in this topic.

Anyway, thanks again for your help, I'm sure this information will be of great help to other developers here on the forum.


Yours sincerely.

  • Like 1
  • 2 months later...
Posted

Updating the topic, we can look at the browser console at the moment the node crashes, the message below is displayed:


image.thumb.png.fe63f36c643f7aa8196db71e9bbfe0f5.png


If anyone has been through this, could you give some tips?


Yours sincerely.

 

  • Like 1
  • 8 months later...
  • Administrators
Posted
On 8/29/2024 at 3:51 AM, Fernando Silva said:

Updating the topic, we can look at the browser console at the moment the node crashes, the message below is displayed:


image.thumb.png.fe63f36c643f7aa8196db71e9bbfe0f5.png


If anyone has been through this, could you give some tips?


Yours sincerely.

 

Hi,

As we have mentioned above the first place to look is log file of the crashed node.

Can you see anything meaningful there?

BTW, I recommend using FastMM for debugging and test your app in full debug mode.

https://www.unigui.com/doc/online_help/index.html?using-fastmm-in-full-debug-mod.htm

 

Posted

Hi Farshad, thank you very much for your reply.

As mentioned, there is no trace in the node log, only in the hyperserver log.
image.thumb.png.29b47b771c032a70348c1fb1f13d2385.png

Since our last contact, we have resolved all memory leak and AV issues.

 

Kind regards.

  • 3 weeks later...
Posted

Good afternoon @Farshad Mohajeri.

I still have the problem of node crashes. As previously reported, we solved all the AV and memory leak problems in the application, but the problem persists.

When there are few sessions, the error does not appear. It only starts to crash nodes after 90~100 sessions.

Do you have any tips that can help me find a solution to the problem?

I recently increased the server resource, which was already sufficient. I modified some hyperserve parameters in search of a solution, but nothing changed.


CFG:
[transport]
pool_size=0
command_timeout=60000
request_timeout=300000
connect_timeout=60000

[http_transport]
start_port=16384

[hyper_server]
binary_name=Web.exe
initial_nodes=2
max_nodes=25
max_sessions=0
sessions_per_nodes=0
prompt_login=1
persistent_node_zero=0
detailed_log=1
port=8877
bindings=
url_path=
url_referer=
ext_root=[ext]\
files_folder=files\
uni_mobile_root=[unim]\
uni_root=[uni]\
server_root=
framework_files_root=
uni_packages_root=[unipack]\
max_requests=2000
http_max_pool=1000
max_connections=1000
antiflood_per_ip=0
session_one_per_ip=0
server_title=
server_build=1.90.0.1567
dont_create_backup=0
allow_remote_config=1
domain_cookies=0
server_direct_url=
token=ddkwaasda6131611646161

[websockets]
enabled=0
aux_port=0
max_queue_length=1000
binding=
global_binding=
global_port=0
external_server_url=
external_server_token=
app_domain=

[node_recycling]
enabled=1
recycle_after_secs=3600
recycle_after_sessions=0
recycle_after_idle_seconds=600
recycle_when_empty=1


Use of certificate issued by CA brhost (cert, key, root). My ssl.cfg
object TUniHyperSSL
  SSL.Enabled = True
  SSL.SSLOptions.RootCertFile = 'root.pem'
  SSL.SSLOptions.CertFile = 'cert.pem'
  SSL.SSLOptions.KeyFile = 'key.pem'
  SSL.SSLOptions.Method = sslvTLSv1_2
  SSL.SSLOptions.SSLVersions = [sslvTLSv1_2]
  SSL.SSLOptions.Mode = sslmUnassigned
  SSL.SSLOptions.VerifyMode = []
  SSL.SSLOptions.VerifyDepth = 0
  SSL.SSLPort = 8877
end



I log several errors:

hyper_serverSN.exe: 00003024: 15:28:32 [Indy]:EIdSocketError : Socket Error # 10060
Connection timed out. : Addr: $0000000000EA53A8


and

hyper_serverSN.exe: 000033A0: 15:36:18 [Indy]:EIdOSSLAcceptError : Error accepting connection with SSL.
EOF was observed that violates the protocol : Addr: $0000000000F165CC

And the errors when the node crashes, as mentioned at the beginning of the topic:
hyper_serverSN.exe: 00002C14: 15:44:39 [167.16.34.78]:EUniHyperServerException : TUniHyperServer.HandleHTTPRequest(), Node:[22], EIdSocketError, Socket Error # 10061
Connection refused. : Addr: $0000000001157A26
hyper_serverSN.exe: 000014BC: 15:44:43 [SendCommand Error, Node: 22]:Socket Error # 10061
Connection refused.
hyper_serverSN.exe: 000014BC: 15:44:43 [Node #22]:Node Status request timed out. #3
hyper_serverSN.exe: 00002C14: 15:44:43 [167.16.34.78]:EUniHyperServerException : TUniHyperServer.HandleHTTPRequest(), Node:[22], EIdSocketError, Socket Error # 10061
Connection refused. : Addr: $0000000001157A26
hyper_serverSN.exe: 000014BC: 15:45:06 [SendCommand Error, Node: 22]:Socket Error # 10061
Connection refused.


 

If I update Indy, could this be a solution, or is the Indy that appears in the log specific to Unigui?

 

Kind regards.

  • Administrators
Posted
On 6/12/2025 at 10:09 PM, Fernando Silva said:

Good afternoon @Farshad Mohajeri.

I still have the problem of node crashes. As previously reported, we solved all the AV and memory leak problems in the application, but the problem persists.

When there are few sessions, the error does not appear. It only starts to crash nodes after 90~100 sessions.

Do you have any tips that can help me find a solution to the problem?

I recently increased the server resource, which was already sufficient. I modified some hyperserve parameters in search of a solution, but nothing changed.


CFG:
[transport]
pool_size=0
command_timeout=60000
request_timeout=300000
connect_timeout=60000

[http_transport]
start_port=16384

[hyper_server]
binary_name=Web.exe
initial_nodes=2
max_nodes=25
max_sessions=0
sessions_per_nodes=0
prompt_login=1
persistent_node_zero=0
detailed_log=1
port=8877
bindings=
url_path=
url_referer=
ext_root=[ext]\
files_folder=files\
uni_mobile_root=[unim]\
uni_root=[uni]\
server_root=
framework_files_root=
uni_packages_root=[unipack]\
max_requests=2000
http_max_pool=1000
max_connections=1000
antiflood_per_ip=0
session_one_per_ip=0
server_title=
server_build=1.90.0.1567
dont_create_backup=0
allow_remote_config=1
domain_cookies=0
server_direct_url=
token=ddkwaasda6131611646161

[websockets]
enabled=0
aux_port=0
max_queue_length=1000
binding=
global_binding=
global_port=0
external_server_url=
external_server_token=
app_domain=

[node_recycling]
enabled=1
recycle_after_secs=3600
recycle_after_sessions=0
recycle_after_idle_seconds=600
recycle_when_empty=1


Use of certificate issued by CA brhost (cert, key, root). My ssl.cfg
object TUniHyperSSL
  SSL.Enabled = True
  SSL.SSLOptions.RootCertFile = 'root.pem'
  SSL.SSLOptions.CertFile = 'cert.pem'
  SSL.SSLOptions.KeyFile = 'key.pem'
  SSL.SSLOptions.Method = sslvTLSv1_2
  SSL.SSLOptions.SSLVersions = [sslvTLSv1_2]
  SSL.SSLOptions.Mode = sslmUnassigned
  SSL.SSLOptions.VerifyMode = []
  SSL.SSLOptions.VerifyDepth = 0
  SSL.SSLPort = 8877
end



I log several errors:

hyper_serverSN.exe: 00003024: 15:28:32 [Indy]:EIdSocketError : Socket Error # 10060
Connection timed out. : Addr: $0000000000EA53A8


and

hyper_serverSN.exe: 000033A0: 15:36:18 [Indy]:EIdOSSLAcceptError : Error accepting connection with SSL.
EOF was observed that violates the protocol : Addr: $0000000000F165CC

And the errors when the node crashes, as mentioned at the beginning of the topic:
hyper_serverSN.exe: 00002C14: 15:44:39 [167.16.34.78]:EUniHyperServerException : TUniHyperServer.HandleHTTPRequest(), Node:[22], EIdSocketError, Socket Error # 10061
Connection refused. : Addr: $0000000001157A26
hyper_serverSN.exe: 000014BC: 15:44:43 [SendCommand Error, Node: 22]:Socket Error # 10061
Connection refused.
hyper_serverSN.exe: 000014BC: 15:44:43 [Node #22]:Node Status request timed out. #3
hyper_serverSN.exe: 00002C14: 15:44:43 [167.16.34.78]:EUniHyperServerException : TUniHyperServer.HandleHTTPRequest(), Node:[22], EIdSocketError, Socket Error # 10061
Connection refused. : Addr: $0000000001157A26
hyper_serverSN.exe: 000014BC: 15:45:06 [SendCommand Error, Node: 22]:Socket Error # 10061
Connection refused.


 

If I update Indy, could this be a solution, or is the Indy that appears in the log specific to Unigui?

 

Kind regards.

Hi,

So are there any errors in the Node log file?

Posted


Hello @Farshad Mohajeri, thank you for your reply.

There is no error reported in the file at the time of the node failure. I am sending you the node and hyperserver log files to your private contact with the topic name.

When you can, could you please do an analysis to see if I am missing something.

Thank you.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...