Skip to content
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

Cosmetics: Exception when ServiceFault instead of PublishRepsonse arrives #49

Closed
jk987 opened this issue Oct 28, 2015 · 1 comment
Closed

Comments

@jk987
Copy link

jk987 commented Oct 28, 2015

http://ulozto.net/xiWcarrj/20151028-servicefault-instead-of-publishresponse-pcapng
password: ua1234

After I delete subscription (I'm doing this before disconnecting client) I can find following exception in log:

2015-10-28 10:11:39,013 - concurrent.futures - ERROR - exception calling callback for <Future at 0x546c870 state=finished returned Buffer>
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\concurrent\futures_base.py", line 298, in _invoke_callbacks
callback(self)
File "C:\Python27\lib\site-packages\opcua\binary_client.py", line 330, in _call_publish_callback
response = ua.PublishResponse.from_binary(future.result())
File "C:\Python27\lib\site-packages\opcua\uaprotocol_auto.py", line 10434, in from_binary
obj.Parameters = PublishResult.from_binary(data)
File "C:\Python27\lib\site-packages\opcua\uaprotocol_auto.py", line 10383, in from_binary
obj.SubscriptionId = unpack_uatype('UInt32', data)
File "C:\Python27\lib\site-packages\opcua\uatypes.py", line 134, in unpack_uatype
return struct.unpack(fmt, data.read(size))[0]
File "C:\Python27\lib\site-packages\opcua\utils.py", line 39, in read
raise Exception("No enough data left in buffer, request for {}, we have {}".format(size, self))
Exception: No enough data left in buffer, request for 4, we have Buffer(size:0, data:)

I doesn't bother me much because it is handled somewhere inside so my app doesn't know about this. That's why I didn't investigate it very much.
I only think that this happens when BinaryClient is expecting PublishResponse but he gets ServiceFault packet.

Here is another capture when I didn't call subscription.delete before client.disconnect:
http://ulozto.net/xDundii7/20151028-servicefault-instead-of-publishresponse-v2-pcapng

I humbly suggest that the message in log could be more accurate. It's not the problem "No enough data left...".

Maybe it is similar to issue #29. (?)

@oroulet
Copy link
Member

oroulet commented Oct 28, 2015

kepware sends extra notifications after session is closed!!! I added a line to parse for that and print a bit better warning

@oroulet oroulet closed this as completed Oct 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants