BadSessionNotActivated issue #1297
Unanswered
m4rkisgrov3
asked this question in
Q&A
Replies: 1 comment 12 replies
-
|
what is the opcua server? |
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, please can anyone help?
I'm using the python-opcua library in a fairly simple way, so I've been surprised when I encountered this error.
I've written a Python client that subscribes to about 160 nodes. I create 1 handler, and subscribe to all the nodes in one go. As follows:
Of course, when any of the node values change, the handler is called. This has worked quite happily until I ramp up the number of nodes I subscribe to; I now subscribe to 160, I thought I'd be able to subscribe to 1000s. Also, note the 100 period value in create_subscription.
So, now when I run this whilst subscribing to more nodes, it falls over on the subscription with this error message:
_exception calling callback for
Traceback (most recent call last):
File "/usr/local/lib/python3.8/concurrent/futures/_base.py", line 328, in _invoke_callbacks
callback (self)
File "/root/.local/lib/python3.8/site-packages/opcua/client/ua_client.py", line 493, in call publish callback
self._uasocket uasocket.check_answer (data, "while waiting for publish response")
File "/root/.local/lib/python3.5/site-packages/opcua/client/ua_client.py", line 93, in check_answer
hdr. ServiceResult.check()
File "/root/.local/lib/python3.5/site-packages/opcua/ua/uatypes.py", line 218, in check
raise UaStatusCodeError (self.value)
opcua.ua.uaerrors.auto.BadSessionNotActivated: "The session cannot be used because Activate Session has not been called." (BadsessionNotActivated)
Note the error in the traceback, BadSessionNotActivated.
Please can someone help, with less nodes I subscribe to, all this works well and all data changes are captured, when I subscribe to more than 160 nodes, I get this error.
I'm thinking this could be a timing issue? I specify a value of 100 for the period when I create the subscription, is this enough? Or, another thing that crossed my mind is that should I be creating a session since it's telling me BadSessionNotActivated?
Many thanks for help, happy to provide more info if required.
Beta Was this translation helpful? Give feedback.
All reactions