plc4x icon indicating copy to clipboard operation
plc4x copied to clipboard

OPC UA silently fails to handle subscription response

Open ottlukas opened this issue 3 years ago • 1 comments

While test of OPC UA simulator coming from freeopcua I found out that our client doesn't work with it. Maybe it is an issue of how they encode payload, maybe it is inconsistency in the spec, not sure - the end result is that actual response processing error gets swallowed and driver hangs.

Guilty code is in OpcuaSubscriptionHandle:


for (MonitoredItemCreateResult result : responseMessage.getResults().toArray(new MonitoredItemCreateResult[0]))
{
    if (OpcuaStatusCode.enumForValue(result.getStatusCode().getStatusCode()) != OpcuaStatusCode.Good)
{
        LOGGER.error("Invalid Field {}, subscription created without this field", fieldNames.get((int)
result.getMonitoredItemId()));
    } else {
        LOGGER.debug("Field {} was added to the subscription",
fieldNames.get((int) result.getMonitoredItemId() - 1)); // !monitored item id might be inconsistent!

   }
}

Copy of traffic causing issue in attachment.

Imported from Jira PLC4X-342. Original Jira may contain additional context. Reported by: ldywicki.

ottlukas avatar Nov 09 '22 10:11 ottlukas

Its going to be addressed by #1007.

splatch avatar Dec 18 '23 12:12 splatch

This issue should be addressed in PR mentioned above. @ottlukas Please spin freeopcua tests again and reopen issue if its still valid.

splatch avatar Jul 05 '24 09:07 splatch