python-opcua icon indicating copy to clipboard operation
python-opcua copied to clipboard

Error: Number of acknowledgement results (0) does not match number of acknowledgements(1)

Open Cesaario opened this issue 6 years ago • 18 comments
trafficstars

I'm new to freeopcua and I'm getting an error that I can't get rid of. My server works fine, and I can read the values at UaExpert, but I'm recieving several "Error: Number of acknowledgement results (0) does not match number of acknowledgements(1)" This is my server: `from opcua import Server from random import randint import time import sys

server = Server()

server.set_endpoint("opc.tcp://localhost:4840")

addspace = server.register_namespace("OPCUA")

node = server.get_objects_node()

Param = node.add_object(addspace, "Parametros")

Temp = Param.add_variable(addspace, "Temp", 0)

Temp.set_writable()

server.start() print("Server iniciado...")

while True: try: val_temp = randint(0,100) Temp.set_value(val_temp) print(val_temp) time.sleep(5) except KeyboardInterrupt: print("Finalizando servidor...") break

server.stop()`

Should I be worried about this error?

Cesaario avatar Feb 26 '19 03:02 Cesaario

Not sure. What client are you using?

oroulet avatar Feb 26 '19 04:02 oroulet

Not sure. I'm using Unified Automation UaExpert.

Cesaario avatar Feb 27 '19 12:02 Cesaario

I had/have the same error. On one of my PCs I get these errors and on an other PC I didn´t get the errors with the same server. It has no impact on the functionality so you shouldn care about it I think.

mar-ar avatar Feb 28 '19 10:02 mar-ar

I see the same error using Unified Automation UaExpert 1.5.1. I don't notice any other negative effects but it would be nice to know what causes the error.

EEflow avatar Jun 26 '19 07:06 EEflow

I ended up here for the same reason, also using Unified Automation UaExpert 1.5.1. 2019-08-02_11-40-32

dannmartens avatar Aug 02 '19 09:08 dannmartens

I do not get that error with uaexpert 1.4..... can it be something new with uaexpert 1.5.1?

oroulet avatar Aug 02 '19 12:08 oroulet

I do not get the error using MySin variable in server-example.py dragged into "DataAccess view" in uaexpert . Should I do something else to reproduce this?

oroulet avatar Aug 02 '19 12:08 oroulet

I do not get the error using MySin variable in server-example.py dragged into "DataAccess view" in uaexpert . Should I do something else to reproduce this?

Nothing else is needed, subscription to MySin var should produce the error:

I can't test it with an older uaxport version, since these are not available for download anymore.

EEflow avatar Aug 02 '19 13:08 EEflow

I cannot reproduce with 1.5.1 either... Do you use master from GitHub?

oroulet avatar Aug 02 '19 13:08 oroulet

I have used pip to install this version:

opcua                     0.98.7                   pypi_0    pypi

EEflow avatar Aug 02 '19 13:08 EEflow

Can you try master then. I kind of remember some changes there...

oroulet avatar Aug 03 '19 11:08 oroulet

I am currently building against HEAD of master: I do see that error in UaExpert.

I see we're dicsussing this in the python-opcua project, it's worth noting that I am using opcua-asyncio. I got here after searching for this problem on-line.

dannmartens avatar Aug 03 '19 15:08 dannmartens

I also see this message. opcua 0.98.7
UaExpert 1.5.0

There are nodes in the tree with EventNotifier. Screenshot from 2019-08-28 12-28-11

maxim-s-barabash avatar Aug 28 '19 09:08 maxim-s-barabash

I also see the message in UaExpert 1.5.1. With opcua 0.98.7 as well as with asyncua 0.5.1

ralphswork avatar Aug 28 '19 14:08 ralphswork

Same Error

yilmaznaslan avatar Dec 03 '19 08:12 yilmaznaslan

Error message is caused by missing PublishResult.Results acknowledgements.

Background:

  1. client subscribes to one or more datachanges.
  2. client sends publication request to server.
  3. datachange event: server sends publication response, with incremental "notification id"
  4. client sends new publication request to server, acks each "notification id"
  5. datachange event: publication response + statuscode of processing for each above ack This is the missing part in freeopcua at this moment.

The OPCUA spec is somewhat vague about the implementation at this point. From what I understand, the only way this ack/confirm procedure can work is when the client sends a publication request after each publication response. This request can then be used as "token" (ie increment notification id) for the next publication response.

The way freeopcua works at the moment is that datachanges are published whenever data changes (throttled and multiple changes are bundeled at regular intervals), however this implies that e.g. 2 or more datachange publication-responses may be sent to the client while the client expects a sequential PublishResult.Results for each ack in the publish request, in the order they were issued by the client (flaw in the OPCUA spec imho).

I did some testing and this stops the errors in uaexpert, however it has considerable impact on the way freeopcua currently implements datachange events. Also, this server-client-server roundtrip basically kills concurrency and fast updates. On the other hand, ignoring this floods the UaExpert log with Error messages.

Edit: it seems that multiple requests can be issued without response, so the server can use these as tokens to send a response (in the order they were issued).

https://documentation.unified-automation.com/uasdkc/1.4.0/html/L2UaSubscription.html

There are two settings which affect the Subscription itself. After each Publishing Interval notifications collected in the queues are delivered to the client in a Notification Message (Publish Response). The Client must insure that the server has received enough Publish Tokens (Publish Requests), so that whenever the Publish Interval elapsed and a notification is ready to send, the server uses such a token and sends the data within a Publish Response. In case that there is nothing to report (e.g. no values have changed) the server will send a KeepAlive notification to the Client, which is an empty Publish, to indicate that the server is still alive. The sending of the Notification Message can be enabled or disabled by changing the Publish Enabled setting.

brubbel avatar Mar 15 '20 21:03 brubbel

Hi together

I got the same error here, however I understand from you answer that its not a quickfix. I just want to add that the "Prosys OPC UA Client" does not log errormessages, but this client does not update the opc ua variables when they change. So it can be, depending on the implementation of the client that its not properly working.

With UA Expert, I just get the message as in the thread's titel, but the value is refreshed.

So depending on the client implementation this error can be more severe.

aschaepper avatar Sep 14 '20 08:09 aschaepper

Hi, is there any updates for this issue? Will it be fixed, or any walk around?

yichenj avatar Feb 08 '21 04:02 yichenj