Hi,
Upgraded to 0.6.4 to be able to adjust maxReferences. Got surprise with my UA server code:
java.lang.ExceptionInInitializerError
at org.eclipse.milo.opcua.stack.core.serialization.OpcUaXmlStreamDecoder.<init>(OpcUaXmlStreamDecoder.java:86)
at org.eclipse.milo.opcua.sdk.server.namespaces.loader.VariableNodeLoader.loadNode0(VariableNodeLoader.java:71)
at org.eclipse.milo.opcua.sdk.server.namespaces.loader.VariableNodeLoader.loadAllNodes(VariableNodeLoader.java:12987)
at org.eclipse.milo.opcua.sdk.server.namespaces.loader.NodeLoader.loadNodes(NodeLoader.java:33)
at org.eclipse.milo.opcua.sdk.server.namespaces.OpcUaNamespace.loadNodes(OpcUaNamespace.java:152)
at org.eclipse.milo.opcua.sdk.server.namespaces.OpcUaNamespace.lambda$new$2(OpcUaNamespace.java:88)
at org.eclipse.milo.opcua.sdk.server.LifecycleManager$1.startup(LifecycleManager.java:95)
at java.base/java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:807)
at org.eclipse.milo.opcua.sdk.server.LifecycleManager.onStartup(LifecycleManager.java:49)
at org.eclipse.milo.opcua.sdk.server.AbstractLifecycle.startup(AbstractLifecycle.java:32)
at org.eclipse.milo.opcua.sdk.server.api.ManagedNamespaceWithLifecycle.startup(ManagedNamespaceWithLifecycle.java:42)
at org.eclipse.milo.opcua.sdk.server.OpcUaServer.<init>(OpcUaServer.java:122)
at syncrontech.link.opc.ua.server.UaService.onActivate(UaService.java:212)
at syncrontech.common.cluster.ClusterServiceImpl.start(ClusterServiceImpl.java:74)
at syncrontech.common.cluster.ClusterGroupImpl$7.run2(ClusterGroupImpl.java:953)
at syncrontech.common.cluster.ClusterGroupImpl$TxnHelper.run(ClusterGroupImpl.java:76)
at syncrontech.common.storage.TxnInfo.runInExistingTxn(TxnInfo.java:164)
at syncrontech.common.cluster.ClusterGroupImpl.addService(ClusterGroupImpl.java:947)
at syncrontech.link.opc.OpcTestEnvResource.beforeAll(OpcTestEnvResource.java:145)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllCallbacks$10(ClassBasedTestDescriptor.java:381)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeBeforeAllCallbacks(ClassBasedTestDescriptor.java:381)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:205)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:80)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:148)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:95)
at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:91)
at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:60)
at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:98)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
Caused by: java.lang.IllegalArgumentException: Not supported:
http://javax.xml.XMLConstants/property/accessExternalDTD
at org.apache.xalan.processor.TransformerFactoryImpl.setAttribute(TransformerFactoryImpl.java:571)
at org.eclipse.milo.opcua.stack.core.util.SecureXmlUtil.<clinit>(SecureXmlUtil.java:49)
... 60 more
What might be the problem here ?
Ari S.
From: Ari Suutari
Sent: keskiviikko 16. helmikuuta 2022 17.05
To: milo developer discussions <milo-dev@xxxxxxxxxxx>
Subject: RE: [milo-dev] Max chunk count exceeded
Yes, I figured already out that those are related.
Ari S.
Ari,
Take a look at the EncodingLimits implementation to see how maxChunkCount, maxChunkSize, and maxMessageSize all somewhat relate to each other.
I was trying to figure out why UaExpert worked by Milo didn’t. It seems that maxChunkCount default
is different. Milo ends up with 64, UaExpert has 5000. Haven’t tried setting it to 5000 in Milo with the problematic
server yet but will try as it might be a viable workaround now.
Ari S.
Yes, it would only affect things on the wire. You should receive all references still.
Great !
If I set this limit will I still receive all references, ie. this affects only how things travel in the wire ?
I have been experimenting a bit with EncodingOptions, but still haven’t find settings large enough
for things to work.
Ari S.
I think we can assume this is the issue.
In the code you're calling in Milo, we're not specifying any max for the number of References returned, and it appears the server is not taking the max message size into account
when assembling its response.
For now, I think setting larger EncodingLimits is your best workaround. I will add a "maxReferences" parameter to the BrowseOptions structure that AddressSpace::browseNodes and
the other overloads accept and probably set it to some fixed value to avoid interop problems with servers like this.
When browsing to folder causing the problems there are roughly 64000 tags under it.
Is there any debug logging related to browsing that I could turn on in Milo ?
Ari S.
When you browse the problematic Node in UaExpert how many References are returned?
Hi,
I don’t really remember how I ended up with that code (it has been working just fine for other cases).
Any other way that would give me nodeId, display name and nodeClass would be just fine. Looking
at examples, there seem to be two different ones, BrowseExample and BrowseNodeExample. The
later one looks much like my code.
Unfortunately it is difficult to debug against the problematic server as it’s a production system
at customer and I don’t have direct network access to it from development environment
☹
Ari S.
Okay, that's a good hint.
Do you need to be using the browse call that returns UaNode instances?
Can you step through in the debugger to see where it fails? This call can do quite a bit - it calls Browse, possibly BrowseNext, then reads a bunch of attributes so it can create
all the UaNode instances that it returns.
It's possible the Browse is failing because the server is trying to return more References than fits. It's also possible one of the subsequent Read calls for attributes is failing,
but I think that's less likely since they are only grouped per-Node.
Unfortunately no exposed setting for that right now.
Hi,
I can do that, but it seems that the problem occurs only when I call
client.getAddressSpace().browseNodes(parentNodeId);
At that point the client doesn’t have anything else going on, this is done just after
connection has been opened. So there is no subscription yet.
The server is a very large one, I think that there are thousands of tags.
(Browsing with UaExpert works, but is slow due to amount of tags).
Ari S.
Can you turn the logger for org.eclipse.milo.opcua.sdk.client.subscriptions.OpcUaSubscriptionManager to DEBUG level and then tell me if you get any messages about "Publish service
failure"? Or do you have any other timeout messages that occur during or soon after this decoding error?
You can probably work around by increasing encoding limits but I'd like to narrow it down a little bit. If it's the occasional PublishResponse that is too large then decreasing
the"maxNotificationsPerPublish" parameter when creating a subscription may help.
Hi,
Any workarounds what I could try on my own code if I cannot get capture ?
OpcUaClientConfigBuilder.setEncodingLimits() ?
Ari S.
Maybe if the server allows MessageSecurityMode.sign, but not it it’s only SignAndEncrypt.
Hi,
The server requires encryption on. Would wireshark capture still be interesting ?
Ari S.
It looks like the server is responding with a message that is larger than the agreed upon max message size / max chunk count.
While I think this is ultimately a server issue, if you can get a Wireshark capture then perhaps we can see what kind of Response this is and what Request from the client is provoking
this issue.
Hi,
I’m working with connection to ABB’s RTDB OPC UA server (version 5.0). Otherwise things seem to be working just fine, except
when trying to browse for tags things break like this:
2022-02-03 12:12:25.933 [milo-netty-event-loop-5] ERROR [remote=IMPI3/10.16.16.41:4841]
Exception caught: UaException: status=Bad_TcpMessageTooLarge, message=max chunk count exceeded (64)io.netty.handler.codec.DecoderException: UaException: status=Bad_TcpMessageTooLarge, message=max chunk count exceeded (64) at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:471)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276) at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at java.base/java.lang.Thread.run(Thread.java:829)Caused by: org.eclipse.milo.opcua.stack.core.UaException: max chunk count exceeded (64) at org.eclipse.milo.opcua.stack.client.transport.uasc.UascClientMessageHandler.accumulateChunk(UascClientMessageHandler.java:426)
at org.eclipse.milo.opcua.stack.client.transport.uasc.UascClientMessageHandler.onSecureMessage(UascClientMessageHandler.java:608) at org.eclipse.milo.opcua.stack.client.transport.uasc.UascClientMessageHandler.decodeMessage(UascClientMessageHandler.java:399)
at org.eclipse.milo.opcua.stack.client.transport.uasc.UascClientMessageHandler.decode(UascClientMessageHandler.java:383) at io.netty.handler.codec.ByteToMessageCodec$1.decode(ByteToMessageCodec.java:42) at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:501)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:440) ... 17 common frames omitted
I wonder what I should do to fix this ? Or is this some kind of problem at server side ?
Ari S.
_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/milo-dev
_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/milo-dev
_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/milo-dev
_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/milo-dev
_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/milo-dev
_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/milo-dev
_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/milo-dev
_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/milo-dev