-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
High frequent "Bad no subscription" errors in client #5687
Comments
This issue is becoming a real show stopper. Sometimes the applications start properly on each try, sometimes I get this issue each and every time the applications start. I really get the impression the issue is dependend on aliens, moon phases or what ever. |
Although the issue seemed to have vanished for some time it occures more often again now. Even for client applications which do NOT subscribe ANY variables from the remote servers. How can this happen? We really need to get this issue resolved. Please help me!! |
When this effect happens, the right ahead of it all there is status change notification with a status code of UA_STATUSCODE_GOODSUBSCRIPTIONTRANSFERRED. Maybe this points into a direction. |
There is no further additional info or inner status code or inner notification. |
I must correct myself. The effect still only happens for client application which actually do subscribe values from the remote server. I was mislead by a misinterpreted debug output. Sorry for that. |
In the meantime I added a StatusChange notification callback. The only thing it is able to output is a statuscode of UA_STATUSCODE_GOODSUBSCRIPTIONTRANSFERRED. Why does this happen? And what can I do about that or how should this situation be handled? |
I have this problem too. When clients connect at different times, everything works. But, if you turn off and turn on the server, then the clients immediately restore communication and somewhere such an error (internal) error occurs. With all this, retval = GOOD.
|
I was looking for a reason: we took our two clients and ua_expert for the test. In the server logs, in case of failures on the client, we saw how the subscription of one client was TRANSFERRED to the other client!
I started looking for what its "Transferred to this Session" and found a description of the structure UA_Subscription(src/server/ua_subscription.h):
From the description it is clear that the subscription is attached to the SessionName, and in all my clients this variable is empty! I began to look for how to change it and it turned out that in my version (v1.3.4) there is NO api to change it. Editing the library code(3 files):
After recompilation(lib), you need to add in your application:
This fixed my client's error:
|
Unfortunately this patch does not solve the issue for me. I still get these high frequent "BadNoSubscription" messages. |
In the meantime I found a workaround for this issue. It is not perfect and I really like to have a better approach, but for the time being I can live with this "fix". But why is the transfer of a subscription from one session to another session (which has NOT been initiated by my application) is required or necessary at all? My client sets up a single connection to a server. This connection should result in one single session. From my point of view there is no space for a transfer to another session, at least not to a session that my application never caused to be set up and hence cannot control. |
I have this problem as well, and it appears to be caused by having UaExpert running in parallel. Apparently UaExpert will after reconnection try to transfer its subscription from the previous session; but it will use the SubscriptionId that it used in the previous session, even though that SubscriptionId might now be used by some other client! This is quite similar to the description by @VictorManKBO in #5687 (comment) . I am able to reproduce this problem reliably, like this:
In this case, server and client are using open62541 1.3.9 and open62541pp 0.11.0, under Debian 12 (Bookworm). UaExpert is in version 1.7.1 540. I am not experienced with OPC-UA, so cannot really say who is at fault here:
Anyway, I guess the solution is not use UaExpert, or maybe set up a separate user account for UaExpert, or do not use the automatic reconnection in UaExpert? |
Description
From time to time we are facing the problem that an open62541 based client connects to an open62541 based server and then obviously something goes wrong with the subscription of variables. We set up a subscription and the put an arbitrary number of monitored items into that subscription. Usually this all works perfectly, but sometimes something goes wrong (without any readable notice) and then we get tons of these "BadNoSubscription" log messages right after a complain about a dropped StatusChangeNotification:
[11:03:51.731] WARN [warning|client ] Dropped a StatusChangeNotification since no callback is registered
[11:03:51.731] WARN [warning|client ] Received Publish Response with code BadNoSubscription
[11:03:51.731] WARN [warning|client ] Received Publish Response with code BadNoSubscription
[11:03:51.731] WARN [warning|client ] Received Publish Response with code BadNoSubscription
[11:03:51.731] WARN [warning|client ] Received Publish Response with code BadNoSubscription
[11:03:51.731] WARN [warning|client ] Received Publish Response with code BadNoSubscription
[11:03:51.731] WARN [warning|client ] Received Publish Response with code BadNoSubscription
[11:03:51.732] WARN [warning|client ] Received Publish Response with code BadNoSubscription
[11:03:51.732] WARN [warning|client ] Received Publish Response with code BadNoSubscription
.....
Upon the next start of our application everything is working again, at least in 98 of 100 times. No changes on either side inbetween. But in this situation neither side is really usable.
What is causing this behaviour and what can we do about it?
Used CMake options:
UA_ENABLE_AMALGAMATION:BOOL=ON
UA_ENABLE_ENCRYPTION:STRING=OPENSSL
UA_ENABLE_ENCRYPTION_OPENSSL:BOOL=ON
UA_MULTITHREADING:STRING=100
Checklist
Please provide the following information:
UA_LOGLEVEL
set as low as necessary) attachedThe text was updated successfully, but these errors were encountered: