Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
OPC UA Browser goes into endless loop at connection setup
December 15, 2023
23:25, EET
Avatar
undroidwish
Member
Members
Forum Posts: 4
Member Since:
December 16, 2023
sp_UserOfflineSmall Offline

When some OPC/UA server reports misleading information on ReadRequests regarding
ArrayDimensions vs real arity of data, this message can be observed:

Caused by: com.prosysopc.ua.stack.encoding.a: Bad_DecodingError (code=0x80070000, description=”Variant’s ArrayDimensions [0, 0] total size of 0 does not match defined ArrayLength of 1. Variant value was: [i=0]”)
at com.prosysopc.ua.stack.encoding.binary.a.fOM(SourceFile:1382) ~[application-5.0.0-173.jar:5.0.0-173]

The final outcome is that the browser is stuck in some infinite loop, i.e. does not recover
from this problem e.g. by ignoring it.

December 15, 2023
23:34, EET
Avatar
undroidwish
Member
Members
Forum Posts: 4
Member Since:
December 16, 2023
sp_UserOfflineSmall Offline

How to reproduce:

* fetch a vaniilatclsh for the platform of your choice from http://www.ch-werner.de/LUCK/
* run it like “vanillatclsh… builtin:ckua 4840” which makes it into an OPC/UA server on port 4840
* connect to it using Prosys OPC UA Browser

December 18, 2023
9:29, EET
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 321
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

That decoding error you got means that the Server is encoding array values incorrectly. In OPC UA Binary, the total number of elements is encoded as Int32 for arrays. Additionally, the total number of dimensions is encoded as Int32 and the length of each dimension is encoded as Int32 element in an Int32 array. See https://reference.opcfoundation.org/Core/Part6/v105/docs/5.2.5 and https://reference.opcfoundation.org/Core/Part6/v105/docs/5.2.2.16 for more information.

In your case, the decoding error claims that the total number of elements (ArrayLength in the error) was 1 and the lengths of dimensions (ArrayDimensions in the error) were [0,0], which is an invalid combination. The decoding error also points out that actual value of the Variant indeed was an array with one element ([i=0]), which means that the lengths of dimensions were encoded incorrectly.

While I do not know why this decoding error would cause Browser to get stuck in an infinite loop, I was able to reproduce that behavior. While we will need to further investigate why this happens, you should contact the developer of that Server to let them know that it is encoding array values incorrectly.

December 18, 2023
9:47, EET
Avatar
undroidwish
Member
Members
Forum Posts: 4
Member Since:
December 16, 2023
sp_UserOfflineSmall Offline

Matti,

thanks for looking into this. Meanwhile I know the culprit: it’s me, of course. And fair enough the open62541 library doesn’t prevent me shooting in my own feet, I mean from writing bogus array data. However would I appreciate if the Prosys OPC UA Browser were tolerant regarding this issue, i.e. gracefully recover from the exception and continue with its connection setup. In my Tcl binding to open62541 I’ve already added some logic to make the array dimension issue less problematic (check-in https://www.androwish.org/home/info/38747b01a0630b77) but still it is possible to write bogus information. I bet this can happen out in the wild with arbitrary servers, too, thus in any case it’s a good idea to address this issue.

December 18, 2023
10:17, EET
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 321
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

We agree that Browser shouldn’t get stuck on an error like this. We will be investigating this error in more detail. However, the end of the year vacation season has already started, so a fix for this issue won’t be available this year.

December 18, 2023
10:20, EET
Avatar
undroidwish
Member
Members
Forum Posts: 4
Member Since:
December 16, 2023
sp_UserOfflineSmall Offline

Matti,

thank you, take all time required for fixing this issue and have a nice vacation season in the first place!

All the best,
Christian

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
23 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 682

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1