{"action":"created","issue":{"url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/295","repository_url":"https://api.github.com/repos/FreeOpcUa/python-opcua","labels_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/295/labels{/name}","comments_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/295/comments","events_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/295/events","html_url":"https://github.com/FreeOpcUa/python-opcua/issues/295","id":172942528,"number":295,"title":"Intermittent observation of error UaError: Wrong sequence (server bug or replay attack)","user":{"login":"danieljfarrell","id":112847,"avatar_url":"https://avatars.githubusercontent.com/u/112847?v=3","gravatar_id":"","url":"https://api.github.com/users/danieljfarrell","html_url":"https://github.com/danieljfarrell","followers_url":"https://api.github.com/users/danieljfarrell/followers","following_url":"https://api.github.com/users/danieljfarrell/following{/other_user}","gists_url":"https://api.github.com/users/danieljfarrell/gists{/gist_id}","starred_url":"https://api.github.com/users/danieljfarrell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danieljfarrell/subscriptions","organizations_url":"https://api.github.com/users/danieljfarrell/orgs","repos_url":"https://api.github.com/users/danieljfarrell/repos","events_url":"https://api.github.com/users/danieljfarrell/events{/privacy}","received_events_url":"https://api.github.com/users/danieljfarrell/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2016-08-24T12:48:22Z","updated_at":"2016-11-05T21:47:40Z","closed_at":null,"body":"I am observing an intermittent error,\n\n `UaError: Wrong sequence 25336 -> 26016 (server bug or replay attack)`.\n\nThe system will run fine for several hours then the following error will occur. \n\nThe setup: freeopcua client with a KEPware server. Please let me know what specific information would be helpful to include. I am using the latest source code directly from the master branch as of today.\n\nBefore updating to the master branch I was observing the same errors as reported here,\nhttps://github.com/FreeOpcUa/python-opcua/issues/201 and possibly this one too, https://github.com/FreeOpcUa/python-opcua/issues/157\n\nThe error I am observing is raised from the same function that was patched in #201 and #157, https://github.com/FreeOpcUa/python-opcua/blob/14a33c98b0bd67a9e0edfcca3e7d40e00e81e122/opcua/ua/uaprotocol_hand.py#L619\n\nPlease let me know how I can help and what you think could be the cause. I stress, this only occurs after running for several hours.\n\n> 2016-08-24 13:27:18,724 INFO     [opcua.client.ua_client:278] read\n> 2016-08-24 13:27:18,798 INFO     [opcua.uaprotocol:663] received header: Header(type:MSG, chunk_type:F, body_size:59, channel:2334074276)\n> 2016-08-24 13:27:18,798 ERROR    [opcua.client.ua_client.Socket:99] Protocol Error\n> Traceback (most recent call last):\n>   File \"build\\bdist.win32\\egg\\opcua\\client\\ua_client.py\", line 94, in _run\n>     self._receive()\n>   File \"build\\bdist.win32\\egg\\opcua\\client\\ua_client.py\", line 103, in _receive\n>     msg = self._connection.receive_from_socket(self._socket)\n>   File \"build\\bdist.win32\\egg\\opcua\\ua\\uaprotocol_hand.py\", line 667, in receive_from_socket\n>     return self.receive_from_header_and_body(header, utils.Buffer(body))\n>   File \"build\\bdist.win32\\egg\\opcua\\ua\\uaprotocol_hand.py\", line 639, in receive_from_header_and_body\n>     return self._receive(chunk)\n>   File \"build\\bdist.win32\\egg\\opcua\\ua\\uaprotocol_hand.py\", line 670, in _receive\n>     self._check_incoming_chunk(msg)\n>   File \"build\\bdist.win32\\egg\\opcua\\ua\\uaprotocol_hand.py\", line 620, in _check_incoming_chunk\n>     .format(self._peer_sequence_number, num))\n> UaError: Wrong sequence 25336 -> 26016 (server bug or replay attack)\n"},"comment":{"url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/comments/258642881","html_url":"https://github.com/FreeOpcUa/python-opcua/issues/295#issuecomment-258642881","issue_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/295","id":258642881,"user":{"login":"oroulet","id":2564046,"avatar_url":"https://avatars.githubusercontent.com/u/2564046?v=3","gravatar_id":"","url":"https://api.github.com/users/oroulet","html_url":"https://github.com/oroulet","followers_url":"https://api.github.com/users/oroulet/followers","following_url":"https://api.github.com/users/oroulet/following{/other_user}","gists_url":"https://api.github.com/users/oroulet/gists{/gist_id}","starred_url":"https://api.github.com/users/oroulet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oroulet/subscriptions","organizations_url":"https://api.github.com/users/oroulet/orgs","repos_url":"https://api.github.com/users/oroulet/repos","events_url":"https://api.github.com/users/oroulet/events{/privacy}","received_events_url":"https://api.github.com/users/oroulet/received_events","type":"User","site_admin":false},"created_at":"2016-11-05T21:47:40Z","updated_at":"2016-11-05T21:47:40Z","body":"Make a pr. I will try to have a look again tomorrow\n\nOn Sat, Nov 5, 2016, 22:10 jk987 <notifications@github.com> wrote:\n\n> I'm getting closer so couple notices:\n>\n> It is very good to shorten period of calling OpenSecureChannel. Then the\n> probability of collision is much higher (couple seconds after start).\n>\n> ...\n> WriteRequest is sent.\n> OpenSecureChannelRequest is sent.\n> OpenSecureChannelResponse is received by UASocketClient._receive() then\n> callback is called and UASocketClient.open_secure_channel() gets its\n> response.\n> But before the SecureConnection.set_channel() is called the other\n> SecureConnection._check_incoming_chunk() with WriteResponse throws\n> exception.\n>\n> Looks like problem with swapping two threads.\n> One thread is Keepalive. The second one is UASocketClient? Is it possible\n> to block the thread with WriteResponse until the OpenSecureChannelResponse\n> is completely handled? I guess it would solve the problem.\n>\n> —\n> You are receiving this because you commented.\n>\n>\n> Reply to this email directly, view it on GitHub\n> <https://github.com/FreeOpcUa/python-opcua/issues/295#issuecomment-258640877>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/ACcfzjokDScTtYXWyl5Ls70ZRDCaswgVks5q7PDOgaJpZM4Jr95A>\n> .\n>\n"}}
{"actor":{"display_login":"oroulet"}}