Azure-Samples / iot-edge-opc-plc

Sample OPC UA server with nodes that generate random and increasing data, anomalies and much more ...
MIT License
223 stars 95 forks source link

OPC BadConnectionClosed Errors #187

Closed terrymandin closed 1 year ago

terrymandin commented 1 year ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Start the opcplc simulator:

docker run --rm -it -p 50000:50000 -p 8080:8080 --name opcplc mcr.microsoft.com/iotedge/opc-plc:latest --pn=50000 --autoaccept --sph --sn=5 --sr=10 --st=uint --fn=20 --fr=1 --ft=uint --ctb --scn --lid --lsn --ref --gn=5 --cdn 10.2.0.5

Connect via IoT Edge.

Copy the pn.json text from the opcplc startup:

[
  {
    "EndpointUrl": "opc.tcp://99405dd7830a:50000",
    "UseSecurity": false,
    "OpcNodes": [
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/Boiler;s=Boiler" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=StepUp" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=AlternatingBoolean" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=RandomSignedInt32" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=RandomUnsignedInt32" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=51b74e55-f2e3-4a4d-b79c-bf57c76ea67c" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=1313895e-c776-4201-b893-e514864c6692" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=84a537f5-3df8-4ab0-a33c-842bdeaf6cc9" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=c9f6d2b9-c681-4e31-9684-2014c4ec860c" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=20883862-eb87-4ef7-8f08-4892d74a121a" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=DipData" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt5" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt6" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt7" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt8" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt9" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt10" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt11" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt12" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt13" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt14" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt15" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt16" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt17" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt18" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt19" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt20" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=BadFastUInt1" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL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JKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=LongString10kB" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=LongString50kB" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=LongString100kB" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=LongString200kB" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=NegativeTrendData" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=PositiveTrendData" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=SlowUInt1", "OpcPublishingInterval": 10000 },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=SlowUInt2", "OpcPublishingInterval": 10000 },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=SlowUInt3", "OpcPublishingInterval": 10000 },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=SlowUInt4", "OpcPublishingInterval": 10000 },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=SlowUInt5", "OpcPublishingInterval": 10000 },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=BadSlowUInt1", "OpcPublishingInterval": 10000 },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=Special_\u0022!\u00A7$%\u0026/()=?\u0060\u00B4\\\u002B~*\u0027#_-:.;,\u003C\u003E|@^\u00B0\u20AC\u00B5{[]}" },
      { "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=SpikeData" }
    ]
  }
]

Install IoT Edge and configure with the pn.json above.

CONTAINER ID   IMAGE                                            COMMAND                   CREATED        STATUS          PORTS
                                                                                                           NAMES
3c1046b8c323   mcr.microsoft.com/iotedge/opc-publisher:latest   "./Microsoft.Azure.I…"    26 hours ago   Up 12 minutes   9702/tcp
                                                                                                           OPCPublisher
f0dbc3c2c235   mcr.microsoft.com/azureiotedge-hub:1.4           "/bin/sh -c 'echo \"$…"   41 hours ago   Up 12 minutes   0.0.0.0:443->443/tcp, :::443->443/tcp, 0.0.0.0:5671->5671/tcp, :::5671->5671/tcp, 0.0.0.0:8883->8883/tcp, :::8883->8883/tcp, 1883/tcp   edgeHub
ce681862f779   mcr.microsoft.com/azureiotedge-agent:1.4         "/bin/sh -c 'exec /a…"    41 hours ago   Up 13 minutes
                                                                                                           edgeAgent

No messages will show in the IoT Hub:

C:\Users\temandin>az iot hub monitor-events -n DataHubIoTHub
Starting event monitor, use ctrl-c to stop...

Any log messages given by the failure

Logs from OPC Publisher:

[2022-11-10 17:08:44.139 INF OpcUa] ChannelId 0: in Opening state.
[2022-11-10 17:08:44.140 INF OpcUa] ChannelId 0: Token #0 created. CreatedAt=17:08:44.140. Lifetime=3600000.
[2022-11-10 17:08:44.236 INF OpcUa] Security Policy: http://opcfoundation.org/UA/SecurityPolicy#None
[2022-11-10 17:08:44.236 INF OpcUa] Sender Certificate: (none)
[2022-11-10 17:08:44.250 INF OpcUa] ChannelId 1: Token #1 activated. CreatedAt=17:08:44.140. Lifetime=3600000.
[2022-11-10 17:08:44.250 INF OpcUa] ChannelId 1: in Open state.
[2022-11-10 17:08:44.250 INF OpcUa] ChannelId 1: Token Expiry 11/10/2022 18:08:44, renewal scheduled in 2699916 ms.
[2022-11-10 17:08:44.489 INF OpcUa] ChannelId 1: in Closing state.
[2022-11-10 17:08:44.502 WRN OpcUa] ChannelId 1: Force reconnect reason=BadConnectionClosed 'Remote side closed connection'
[2022-11-10 17:08:44.503 INF OpcUa] ChannelId 1: in Closed state.
[2022-11-10 17:08:44.503 INF OpcUa] ChannelId 1: CLIENTCHANNEL SOCKET CLOSED: 00606B2A
[2022-11-10 17:08:44.504 INF Microsoft.Azure.IIoT.OpcUa.Protocol.Services.DefaultSessionManager] Creating session 'opc.tcp://10.2.0.5:50000_9D63A23F' for endpoint 'opc.tcp://10.2.0.5:50000'...
[2022-11-10 17:08:44.511 INF OpcUa] ChannelId 0: in Connecting state.
[2022-11-10 17:08:44.515 INF OpcUa] ChannelId 0: in Opening state.
[2022-11-10 17:08:44.516 INF OpcUa] ChannelId 0: Token #0 created. CreatedAt=17:08:44.516. Lifetime=3600000.
[2022-11-10 17:08:44.517 INF OpcUa] Security Policy: http://opcfoundation.org/UA/SecurityPolicy#None
[2022-11-10 17:08:44.517 INF OpcUa] Sender Certificate: (none)
[2022-11-10 17:08:44.518 INF OpcUa] ChannelId 2: Token #1 activated. CreatedAt=17:08:44.516. Lifetime=3600000.
[2022-11-10 17:08:44.518 INF OpcUa] ChannelId 2: in Open state.
[2022-11-10 17:08:44.518 INF OpcUa] ChannelId 2: Token Expiry 11/10/2022 18:08:44, renewal scheduled in 2699997 ms.
[2022-11-10 17:08:44.526 INF OpcUa] ChannelId 2: in Closing state.
[2022-11-10 17:08:44.527 WRN OpcUa] ChannelId 2: Force reconnect reason=BadConnectionClosed 'Remote side closed connection'
[2022-11-10 17:08:44.528 INF OpcUa] ChannelId 2: in Closed state.
[2022-11-10 17:08:44.528 INF OpcUa] ChannelId 2: CLIENTCHANNEL SOCKET CLOSED: 037129C8
[2022-11-10 17:08:44.724 WRN OpcUa] Certificate Validation failed. Reason=BadCertificateUntrusted. [CN=OpcPlc] [415BF90C0E10EEF82E41DA4A8A7BF0D65DAC301A]
[2022-11-10 17:08:44.726 WRN Microsoft.Azure.IIoT.OpcUa.Protocol.Services.DefaultSessionManager] Accepting untrusted peer certificate 415BF90C0E10EEF82E41DA4A8A7BF0D65DAC301A, 'CN=OpcPlc' due to AutoAccept(UntrustedCertificates) set!
[2022-11-10 17:08:44.727 WRN OpcUa] Validation errors suppressed:  [CN=OpcPlc] [415BF90C0E10EEF82E41DA4A8A7BF0D65DAC301A]
[2022-11-10 17:08:44.729 INF OpcUa] ChannelId 0: in Connecting state.
[2022-11-10 17:08:44.734 INF OpcUa] ChannelId 0: in Opening state.
[2022-11-10 17:08:44.734 INF OpcUa] ChannelId 0: Token #0 created. CreatedAt=17:08:44.734. Lifetime=3600000.
[2022-11-10 17:08:45.139 INF OpcUa] Security Policy: http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256
[2022-11-10 17:08:45.140 INF OpcUa] Sender Certificate: [CN=OpcPlc] [415BF90C0E10EEF82E41DA4A8A7BF0D65DAC301A]
[2022-11-10 17:08:45.145 INF OpcUa] ChannelId 3: Token #1 activated. CreatedAt=17:08:44.734. Lifetime=3600000.
[2022-11-10 17:08:45.145 INF OpcUa] ChannelId 3: in Open state.
[2022-11-10 17:08:45.145 INF OpcUa] ChannelId 3: Token Expiry 11/10/2022 18:08:44, renewal scheduled in 2699691 ms.
[2022-11-10 17:08:45.204 INF OpcUa] Revised session timeout value: 60000.
[2022-11-10 17:08:45.204 INF OpcUa] Max response message size value: 4194304. Max request message size: 4194304
[2022-11-10 17:08:45.228 INF OpcUa] Empty results were received for the ActivateSession call.
[2022-11-10 17:08:45.275 INF Microsoft.Azure.IIoT.OpcUa.Protocol.Services.DefaultSessionManager] Session 'opc.tcp://10.2.0.5:50000_9D63A23F' created, loading complex type system ...
[2022-11-10 17:08:46.308 INF Microsoft.Azure.IIoT.OpcUa.Protocol.Services.DefaultSessionManager] Session 'opc.tcp://10.2.0.5:50000_9D63A23F' complex type system loaded
[2022-11-10 17:08:46.309 INF Microsoft.Azure.IIoT.OpcUa.Protocol.Services.DefaultSessionManager] Azure IIoT opc.tcp://10.2.0.5:50000_9D63A23F took 00:00:01.8034940.
[2022-11-10 17:08:46.309 INF Microsoft.Azure.IIoT.OpcUa.Protocol.Services.DefaultSessionManager] Connected to 'opc.tcp://10.2.0.5:50000'
[2022-11-10 17:08:46.320 WRN OpcUa] A smaller lifeTime 10000ms than session timeout 60000ms configured for subscription 0.
[2022-11-10 17:08:46.344 INF OpcUa] For subscription 1, Lifetime count was revised from 10000 to 3600
[2022-11-10 17:08:46.355 INF OpcUa] Subscription CREATED, Id=1, LastNotificationTime=17:08:46, GoodPublishRequestCount=1, PublishingInterval=1000, KeepAliveCount=10, PublishingEnabled=False, MonitoredItemCount=0
[2022-11-10 17:08:46.391 INF Microsoft.Azure.IIoT.OpcUa.Protocol.Services.SubscriptionServices+SubscriptionWrapper] Added 35 monitored items to subscription '1000'/'opc.tcp://10.2.0.5:50000_9D63A23F'
[2022-11-10 17:08:46.506 INF Microsoft.Azure.IIoT.OpcUa.Protocol.Services.SubscriptionServices+SubscriptionWrapper] Now monitoring 35 nodes in subscription '1000'/'opc.tcp://10.2.0.5:50000_9D63A23F'
[2022-11-10 17:08:46.507 WRN OpcUa] A smaller lifeTime 10000ms than session timeout 60000ms configured for subscription 0.
[2022-11-10 17:08:46.509 INF OpcUa] For subscription 2, Lifetime count was revised from 10000 to 360
[2022-11-10 17:08:46.509 INF OpcUa] Subscription CREATED, Id=2, LastNotificationTime=17:08:46, GoodPublishRequestCount=2, PublishingInterval=10000, KeepAliveCount=10, PublishingEnabled=False, MonitoredItemCount=0
[2022-11-10 17:08:46.509 INF Microsoft.Azure.IIoT.OpcUa.Protocol.Services.SubscriptionServices+SubscriptionWrapper] Added 6 monitored items to subscription '10000'/'opc.tcp://10.2.0.5:50000_9D63A23F'
[2022-11-10 17:08:46.557 INF Microsoft.Azure.IIoT.OpcUa.Protocol.Services.SubscriptionServices+SubscriptionWrapper] Now monitoring 6 nodes in subscription '10000'/'opc.tcp://10.2.0.5:50000_9D63A23F'
[2022-11-10 17:08:46.568 INF OpcUa] Subscription PUBLISHING ENABLED, Id=1, LastNotificationTime=17:08:46, GoodPublishRequestCount=2, PublishingInterval=1000, KeepAliveCount=10, PublishingEnabled=True, MonitoredItemCount=35
[2022-11-10 17:08:46.568 INF Microsoft.Azure.IIoT.OpcUa.Protocol.Services.SubscriptionServices+SubscriptionWrapper] Subscription '1000'/'opc.tcp://10.2.0.5:50000_9D63A23F' state actual(revised)/desired: PublishingEnabled True/True, PublishingInterval 1000/1000, KeepAliveCount 10/10, LifetimeCount 3600/10000
[2022-11-10 17:08:46.585 INF Microsoft.Azure.IIoT.OpcUa.Protocol.Services.SubscriptionServices+SubscriptionWrapper] Set monitoring to Reporting for 35 items in subscription '1000'/'opc.tcp://10.2.0.5:50000_9D63A23F'.
[2022-11-10 17:08:46.663 INF OpcUa] Subscription PUBLISHING ENABLED, Id=2, LastNotificationTime=17:08:46, GoodPublishRequestCount=2, PublishingInterval=10000, KeepAliveCount=10, PublishingEnabled=True, MonitoredItemCount=6
[2022-11-10 17:08:46.663 INF Microsoft.Azure.IIoT.OpcUa.Protocol.Services.SubscriptionServices+SubscriptionWrapper] Subscription '10000'/'opc.tcp://10.2.0.5:50000_9D63A23F' state actual(revised)/desired: PublishingEnabled True/True, PublishingInterval 10000/10000, KeepAliveCount 10/10, LifetimeCount 360/10000
[2022-11-10 17:08:46.664 INF Microsoft.Azure.IIoT.OpcUa.Protocol.Services.SubscriptionServices+SubscriptionWrapper] Set monitoring to Reporting for 6 items in subscription '10000'/'opc.tcp://10.2.0.5:50000_9D63A23F'.
[2022-11-10 17:09:47.441 INF Microsoft.Azure.IIoT.OpcUa.Edge.Publisher.Engine.DataFlowProcessingEngine]
DIAGNOSTICS INFORMATION for          : opc.tcp://10.2.0.5:50000_9D63A23F
# Ingestion duration                 :    00:00:00:59 (dd:hh:mm:ss)
# Ingress DataChanges (from OPC)     :             67 (All time ~1.12/s; 66 in last 60s ~1.1/s)
# Ingress ValueChanges (from OPC)    :          1,982 (All time ~33.03/s; 1947 in last 60s ~32.45/s)
# Ingress BatchBlock buffer size     :              0
# Encoding Block input/output size   :              0 | 0
# Encoder Notifications processed    :          1,887
# Encoder Notifications dropped      :             57
# Encoder IoT Messages processed     :             60
# Encoder avg Notifications/Message  :             31
# Encoder avg IoT Message body size  :        195,534 (75%)
# Encoder avg IoT Chunk (4 KB) usage :           47.7
# Estimated IoT Chunks (4 KB) per day:      4,147,230
# Outgress Batch Block buffer size   :              0
# Outgress input buffer count        :              0
# Outgress input buffer dropped      :              0
# Outgress IoT message count         :             60 (1/s)
# Connection retries                 :             96
# Opc endpoint connected?            :           True
# Monitored Opc nodes succeeded count:             41
# Monitored Opc nodes failed count   :              0

Errors will begin to show in the opcplc log:

17:08:40 INF] PLC simulation started, press Ctrl+C to exit ...
[17:08:45 ERR] OPC: Certificate Validation failed. Reason=BadCertificateUntrusted. [CN=Micorosft.Azure.IIoT, C=DE, S=Bav, O=Microsoft, DC=DataHubEdge] [B9D119501682AE069CBFDBD1D00BE4A57593CDD0]
[17:08:45 ERR] OPC: 11/10/2022 17:08:45.118 Certificate Validation failed. Reason=BadCertificateUntrusted. [CN=Micorosft.Azure.IIoT, C=DE, S=Bav, O=Microsoft, DC=DataHubEdge] [B9D119501682AE069CBFDBD1D00BE4A57593CDD0]
[17:08:45 INF] Certificate 'CN=Micorosft.Azure.IIoT, C=DE, S=Bav, O=Microsoft, DC=DataHubEdge' will be trusted, because of corresponding command line option.
[17:08:45 ERR] OPC: Validation errors suppressed:  [CN=Micorosft.Azure.IIoT, C=DE, S=Bav, O=Microsoft, DC=DataHubEdge] [B9D119501682AE069CBFDBD1D00BE4A57593CDD0]
[17:08:45 ERR] OPC: 11/10/2022 17:08:45.119 Validation errors suppressed:  [CN=Micorosft.Azure.IIoT, C=DE, S=Bav, O=Microsoft, DC=DataHubEdge] [B9D119501682AE069CBFDBD1D00BE4A57593CDD0]

Expected/desired behavior

Messages will show in the IoT Hub

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?) From IoT Hub diagnostics:

.NET/1.36.6 (.NET 6.0.9; Linux 5.15.0-1022-azure #27~20.04.1-Ubuntu SMP Mon Oct 17 02:03:50 UTC 2022; X64) EdgeHub/1.4.2.61356014

Versions

see above

Mention any other details that might be useful


Thanks! We'll be in touch soon.

luiscantero commented 1 year ago

Thanks, #186 fixes the issues with the Boiler and deterministic GUIDs not being picked up correctly.

luiscantero commented 1 year ago

@mregen please see OPC UA stack errors here.

luiscantero commented 1 year ago

Update: The telemetry issue was caused by missing routing information in the Edge device's configuration.

luiscantero commented 1 year ago

Remaining issue fixed by #196