OPC connection fail from OPC Tag browser to designer

When using Kepware OPC and importing tags using the Designer OPC Browser the Ignition Gateway disconnects from Kepware OPC Server Connection. Below is the error:

UaException: status=Bad_RequestTypeInvalid, message=The security token request type is not valid.

at org.eclipse.milo.opcua.stack.client.handlers.UaTcpClientAcknowledgeHandler.onError(UaTcpClientAcknowledgeHandler.java:232)

at org.eclipse.milo.opcua.stack.client.handlers.UaTcpClientAcknowledgeHandler.decode(UaTcpClientAcknowledgeHandler.java:128)

at io.netty.handler.codec.ByteToMessageCodec$1.decode(ByteToMessageCodec.java:42)

at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:387)

at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:245)

at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:292)

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:278)

at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:962)

at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)

at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:528)

at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:485)

at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:399)

at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:371)

at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)

at java.lang.Thread.run(Thread.java:748)
1 Like

If you edit/save your connection to Kepware it should work again.

The underlying cause is an unexpected/incorrect StatusCode returned from Kepware, and a workaround for this was implemented in 7.9.7.

1 Like

We are currently on version 7.9.6 so we will give that a try, thank you.

Thank you for posting this. I ran into the same issue and you gave me the solution. Thanks again!!

Thanks for this post, just had the same issue & an edit/save regained connectivity.


We are using Kepware to connect to OPC UA server and exactly after 1 hour of establishing the connection we are facing the following error :

o.o.ua.transport.tcp.io.TcpConnection /*..*.:49320 Error
org.opcfoundation.ua.common.ServiceResultException: Bad_RequestTypeInvalid (code=0x80530000, description=“The security token request type is not valid.”)
at org.opcfoundation.ua.transport.tcp.io.TcpConnection$ReadThread.run(TcpConnection.java:782)

and after every 30 mins of retrying it is throwing the below error :

2018-12-05 10:23:44,995 ERROR [Blocking-Work-Executor-40] o.o.ua.transport.tcp.io.SecureChannelTcp -560875045 Failed to renew security token.
org.opcfoundation.ua.common.ServiceResultException: Bad_ServerNotConnected (code=0x800D0000, description=“The operation could not complete because the client is not connected to the server.”)
at org.opcfoundation.ua.transport.tcp.io.TcpConnection.sendRequest(TcpConnection.java:1083)
at org.opcfoundation.ua.transport.tcp.io.SecureChannelTcp.createSecureChannel(SecureChannelTcp.java:673)
at org.opcfoundation.ua.transport.tcp.io.SecureChannelTcp.access$500(SecureChannelTcp.java:97)
at org.opcfoundation.ua.transport.tcp.io.SecureChannelTcp$8.run(SecureChannelTcp.java:1214)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Can anyone check what would be possible cause of the issue ?

@osashidhar does this question have anything to do with Ignition?

Hi Kevin,

No we are not using Ignition but using the same opc-ua foundation java code deployed and connecting to opc - UA servers to receive tag data. We are facing the exact sane error but couldnt find any resolution to apply in production.So I was curious if there is any cause/resolution to this issue.

Thanks for your response.

@osashidhar We are not using any OPC UA foundation Java code in our product so I don’t know if this will help.

I think we saw Kepware returning this StatusCode when we would reconnect after a connection break and try to resume the previous secure channel. This is not really the right StatusCode for Kepware to return and it was worked around in our software by treating Bad_RequestTypeInvalid the same as other secure channel errors at this stage and assuming it meant the secure channel needs to be re-created.