Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [milo-dev] server status node has wrong type

Ok, confirmed in debugger and Wireshark.

When Milo browses for type definitions in AddressSpace::readTypeDefinition (https://github.com/eclipse/milo/blob/b8967984e7d9642ebdbb9433a63243a47fa549cc/opc-ua-sdk/sdk-client/src/main/java/org/eclipse/milo/opcua/sdk/client/AddressSpace.java#L784-L808) FreeOpcUa server returns an empty browse result.

Attachment: asyncua-browse-type-definition.pcapng
Description: Binary data



On Sep 29, 2023, at 06:17, Kevin Herron <kevinherron@xxxxxxxxx> wrote:

I think what’s probably happening is the server doesn’t have the type definition configured for this Node, or something along those lines.

I’ll see if I can reproduce using the FreeOpcUa demo server.

On Sep 29, 2023, at 02:11, Lenovo K3 Owner <lenovo.k3.1.owner@xxxxxxxxx> wrote:

hi Kevin

thanks for quick reply
we have been using your library for quite a lot of time with different opcua servers and never had any problems
just recently we tried to connect to new opcua server made with help of https://github.com/FreeOpcUa/opcua-asyncio
and unexpectedly we see a problem when trying to read server status node


Caused by: java.util.concurrent.ExecutionException: java.lang.ClassCastException: class org.eclipse.milo.opcua.sdk.client.nodes.UaVariableNode cannot be cast to class org.eclipse.milo.opcua.sdk.client.model.nodes.variables.ServerStatusTypeNode (org.eclipse.milo.opcua.sdk.client.nodes.UaVariableNode and org.eclipse.milo.opcua.sdk.client.model.nodes.variables.ServerStatusTypeNode are in unnamed module of loader 'app')
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
at org.eclipse.milo.opcua.sdk.client.model.nodes.objects.ServerTypeNode.getServerStatusNode(ServerTypeNode.java:367)
... 1 more
Caused by: java.lang.ClassCastException: class org.eclipse.milo.opcua.sdk.client.nodes.UaVariableNode cannot be cast to class org.eclipse.milo.opcua.sdk.client.model.nodes.variables.ServerStatusTypeNode (org.eclipse.milo.opcua.sdk.client.nodes.UaVariableNode and org.eclipse.milo.opcua.sdk.client.model.nodes.variables.ServerStatusTypeNode are in unnamed module of loader 'app')
at org.eclipse.milo.opcua.sdk.client.model.nodes.objects.ServerTypeNode.lambda$getServerStatusNodeAsync$23(ServerTypeNode.java:376)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
at org.eclipse.milo.opcua.stack.client.UaStackClient.lambda$deliverResponse$5(UaStackClient.java:318)
at org.eclipse.milo.opcua.stack.core.util.ExecutionQueue$Task.run(ExecutionQueue.java:119)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)


i put a breakpoint at the line of code that fails and compared response returned from this new server with response we have from our internal server made using milo library and observed the difference in response: as per screenshots in previous email the value of node has different content
i am not sure what is the right behaviour per opcua ua specification, therefore was asking your help


---
Mikalai

On Thu, Sep 28, 2023 at 9:14 PM Kevin Herron <kevinherron@xxxxxxxxx> wrote:
What is the actual error you are seeing? I'm not sure I'm able to reproduce what you're seeing with the Milo example server.

This example makes the same calls to the same nodes to get the state that yours is and returns non-null values for everything: https://github.com/eclipse/milo/blob/b8967984e7d9642ebdbb9433a63243a47fa549cc/milo-examples/client-examples/src/main/java/org/eclipse/milo/examples/client/ReadNodeExample.java#L62-L66



On Thu, Sep 28, 2023 at 10:42 AM Lenovo K3 Owner via milo-dev <milo-dev@xxxxxxxxxxx> wrote:
hello Milo-dev

I've just run into unexpected problem when connected to opcua server and tried to access server status node


        ServerTypeNode serverNode = (ServerTypeNode) client1.getAddressSpace().getObjectNode(
                Identifiers.Server,
                Identifiers.ServerType
        );
        //and this line fails with ClassCastException
        ServerState state = serverNode.getServerStatusNode().getState();

we are using https://github.com/FreeOpcUa/opcua-asyncio as server and latest milo client 0.6.11

And upon investigation I can see the following difference in response returned from that "broken" server and reference server implementation (milo)

On screenshot attached you may see that python returns as value of node rather complex structure while milo server returns null

Not sure if python server does this according to specification and is there any way to mitigate the issue ?


---
Mikalai
_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/milo-dev



Back to the top