UAGateway stops when the user is logged off from the system

Questions regarding installing, running and configuring UaGateway.

Moderator: uagateway

Post Reply
Jaganathan
Jr. Member
Jr. Member
Posts: 1
Joined: 28 Feb 2024, 13:24

UAGateway stops when the user is logged off from the system

Post by Jaganathan »

Hello Team,

We are having this OPC UA gateway installed at a remote server located at a different region. This OPC UA gateway is placed alongside a different server where the UA server is running. Through OPC UA gateway service we are polling data from the server and use it for our client purposes. The problem we are facing is that the OPC UA gateway only polls or reads data from the UA server whenever a local or remote user is logged into the remote terminal server where the gateway is installed. Ideally we expect the gateway to function throughout the time period regardless of any user logging in or not. In the below trace logs you can see that the UA channel only connected when I logged into the server.

Has anyone experience this?

Trace logs:
13:43:10.177Z|4|2C68* CALL OpcUa_ClientApi_Read [Session=1] - watchdog read
13:43:15.243Z|4|2C68* DONE OpcUa_ClientApi_Read [ret=0x800a0000,status=0x0]

13:43:15.243Z|4|2C68* CALL SessionCallback::connectionStatusChanged (ConnectionWarningWatchdogTimeout) [Session=1]
13:43:15.243Z|6|2C68* New state = Warning state after watch dog timeout
13:43:15.243Z|4|2C68* DONE SessionCallback::connectionStatusChanged

13:43:20.258Z|4|2C68* CALL OpcUa_ClientApi_Read [Session=1] - watchdog read
13:43:29.147Z|6|318C* --> UaSession_ChannelConnectionStateChanged uStatus=0x0 event=2
13:43:29.147Z|3|318C* UaSession_ChannelConnectionStateChanged to Disconnected
13:43:29.147Z|6|318C* <-- UaSession_ChannelConnectionStateChanged
13:43:29.147Z|4|2C68* DONE OpcUa_ClientApi_Read [ret=0x80ad0000,status=0x0]

13:43:29.147Z|4|2C68* CALL SessionCallback::connectionStatusChanged (ConnectionErrorApiReconnect) [Session=1]
13:43:29.147Z|6|2C68* New state = Lost connection, trying reconnect
13:43:29.257Z|4|2C68* DONE SessionCallback::connectionStatusChanged
13:43:34.602Z|6|2C68* --> UaSessionPrivate::connectChannel
13:43:34.602Z|4|2C68* CALL OpcUa_Channel_Connect
13:43:39.616Z|4|2C68* DONE OpcUa_Channel_Connect [ret=0x800a0000]
13:43:39.616Z|6|2C68* <-- UaSessionPrivate::connectChannel [ret=0x800a0000]

----------------------------

13:46:40.671Z|6|2C68* --> UaSessionPrivate::connectChannel
13:46:40.671Z|4|2C68* CALL OpcUa_Channel_Connect
13:46:45.686Z|4|2C68* DONE OpcUa_Channel_Connect [ret=0x800a0000]
13:46:45.686Z|6|2C68* <-- UaSessionPrivate::connectChannel [ret=0x800a0000]
13:46:51.013Z|6|2C68* --> UaSessionPrivate::connectChannel
13:46:51.013Z|4|2C68* CALL OpcUa_Channel_Connect
13:46:51.013Z|4|2C68* DONE OpcUa_Channel_Connect [ret=0x0]
13:46:51.013Z|6|2C68* <-- UaSessionPrivate::connectChannel [ret=0x0]

13:46:51.013Z|6|2C68* --> UaSessionPrivate::activateSession [Session=1]
13:46:51.028Z|6|2C68* <-- UaSessionPrivate::activateSession [ret=0x0]

13:46:51.028Z|4|2C68* CALL SessionCallback::connectionStatusChanged (Connected)

13:46:51.153Z|4|2C68* DONE SessionCallback::connectionStatusChanged

User avatar
Support Team
Hero Member
Hero Member
Posts: 3072
Joined: 18 Mar 2011, 15:09

Re: UAGateway stops when the user is logged off from the system

Post by Support Team »

Hi,

the UaGateway is a windows NT-service with a dedicated service logon user running in session 0 of your Windows (not in session 1 where the user is logged in). This ensures that UaGateway will ALWAYS run (and always have a dedicated user context), even when nobody is logged in (or everybody has logged off). We have tested this in hundrets of installations, and it works like a charm. UaGateway is tested and recomended for use in native Windows installations (no Virtual Machine, because virtual network card may behave differently and no Terminal Server mode, because having COM/DCOM issues locally)

However your trace shows that the underlying UA server, where UaGateway is connected to, first has "timeout" on UARead call and thereafter does "not respond" at all. This makes UaGateway (totally correct) go into reconnect loop, 15 seconds after detecting timeout. Thereafter trying to reconnect with this underlying server every 5 seconds.

Please check with manufacturer of underlying UA server, why is not responding anymore when you log off the user. UaGateway seems to behave correctly.
Best regards
Unified Automation Support Team

Post Reply