{"action":"created","issue":{"url":"https://api.github.com/repos/opensistemas-hub/osbrain/issues/117","repository_url":"https://api.github.com/repos/opensistemas-hub/osbrain","labels_url":"https://api.github.com/repos/opensistemas-hub/osbrain/issues/117/labels{/name}","comments_url":"https://api.github.com/repos/opensistemas-hub/osbrain/issues/117/comments","events_url":"https://api.github.com/repos/opensistemas-hub/osbrain/issues/117/events","html_url":"https://github.com/opensistemas-hub/osbrain/issues/117","id":222684068,"number":117,"title":"Something broke between 0.3.1 and 0.4.0 (and all following versions)","user":{"login":"one4many","id":19531845,"avatar_url":"https://avatars3.githubusercontent.com/u/19531845?v=3","gravatar_id":"","url":"https://api.github.com/users/one4many","html_url":"https://github.com/one4many","followers_url":"https://api.github.com/users/one4many/followers","following_url":"https://api.github.com/users/one4many/following{/other_user}","gists_url":"https://api.github.com/users/one4many/gists{/gist_id}","starred_url":"https://api.github.com/users/one4many/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/one4many/subscriptions","organizations_url":"https://api.github.com/users/one4many/orgs","repos_url":"https://api.github.com/users/one4many/repos","events_url":"https://api.github.com/users/one4many/events{/privacy}","received_events_url":"https://api.github.com/users/one4many/received_events","type":"User","site_admin":false},"labels":[{"id":407019364,"url":"https://api.github.com/repos/opensistemas-hub/osbrain/labels/invalid","name":"invalid","color":"e6e6e6","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-04-19T09:59:14Z","updated_at":"2017-04-26T14:47:02Z","closed_at":null,"body":"After updating to 0.4.3 I got the following exception in my project:\r\n```\r\n----------------------------------------------------\r\n EXCEPTION <class 'ValueError'>: too many values to unpack (expected 8)\r\n Extended stacktrace follows (most recent call last)\r\n----------------------------------------------------\r\nFile \"/home/alex/anaconda3/lib/python3.5/site-packages/osbrain/proxy.py\", line 149, in Proxy._pyroInvoke\r\nSource code:\r\n    methodname, args, kwargs, flags, objectId)\r\n----------------------------------------------------\r\nFile \"/home/alex/anaconda3/lib/python3.5/site-packages/osbrain/proxy.py\", line 185, in Proxy._remote_call\r\nSource code:\r\n    flags=flags, objectId=objectId)\r\nLocal values:\r\n    __class__ = <class 'osbrain.proxy.Proxy'>\r\n    args = ('comm1.Officer.dragon', '127.0.0.1:24242', '127.0.0.1', 'data1', 'data2')\r\n    flags = 0\r\n    kwargs = {}\r\n    methodname = 'addAgent'\r\n    objectId = None\r\n    safe_args = ['addAgent', 'comm1.Officer.dragon', '127.0.0.1:24242', '127.0.0.1', 'data1', 'data2']\r\n    self = <osbrain.proxy.Proxy at 0x7f82f35ce748, connected, for PYRONAME:comm1.Officer@127.0.0.1:24242>\r\n        self._pyroSeq = 2\r\n        self._pyroAttrs = set()\r\n        self._Proxy__pyroHmacKey = None\r\n        self._pyroOneway = {'run'}\r\n        self._Proxy__pyroConnLock = <unlocked _thread.RLock object owner=0 count=0 at 0x7f82f388fc30>\r\n        self._pyroConnection = <Pyro4.socketutil.SocketConnection object at 0x7f82f35c9288>\r\n        self._pyroMaxRetries = 0\r\n        self._Proxy__async = False\r\n        self._Proxy__pyroTimeout = 0.0\r\n        self._pyroRawWireResponse = False\r\n        self._pyroUri = <Pyro4.core.URI at 0x7f82f35ce780, PYRONAME:comm1.Officer@127.0.0.1:24242>\r\n        self._safe = True\r\n        self._default_safe = True\r\n        self._pyroMethods = {'execute_function', 'stop_all_timers', 'set_method', 'iterate', 'get_attr', 'send', 'recv', 'shutdownAgent', 'list_timers', 'kill', 'log_error', 'log_debug', 'retireAllAgents', 'registered', 'each', 'send_recv', 'close_sockets', 'on_init', 'set_attr', 'raise_exception', 'set_logger', 'safe_call', 'connect', 'register', 'addr', 'loop', 'stop', 'addAgent', 'run', 'shutdown', 'after', 'ping', 'getAgent', 'bind', 'log_warning', 'log_info', 'stop_timer', 'removeAgent', 'subscribe', 'iddle'}\r\n        self._pyroHandshake = 'hello'\r\n----------------------------------------------------\r\nFile \"/home/alex/anaconda3/lib/python3.5/site-packages/Pyro4/core.py\", line 426, in Proxy._pyroInvoke\r\nSource code:\r\n    raise data\r\nLocal values:\r\n    compressed = False\r\n    data = ValueError('too many values to unpack (expected 8)',)\r\n    flags = 0\r\n    kwargs = {}\r\n    methodname = 'safe_call'\r\n    msg = <Pyro4.message.Message at 7f82f3886828, type=5 flags=1 seq=2 datasize=14499 #ann=1>\r\n    objectId = None\r\n    self = <osbrain.proxy.Proxy at 0x7f82f35ce748, connected, for PYRONAME:comm1.Officer@127.0.0.1:24242>\r\n        self._pyroSeq = 2\r\n        self._pyroAttrs = set()\r\n        self._Proxy__pyroHmacKey = None\r\n        self._pyroOneway = {'run'}\r\n        self._Proxy__pyroConnLock = <unlocked _thread.RLock object owner=0 count=0 at 0x7f82f388fc30>\r\n        self._pyroConnection = <Pyro4.socketutil.SocketConnection object at 0x7f82f35c9288>\r\n        self._pyroMaxRetries = 0\r\n        self._Proxy__async = False\r\n        self._Proxy__pyroTimeout = 0.0\r\n        self._pyroRawWireResponse = False\r\n        self._pyroUri = <Pyro4.core.URI at 0x7f82f35ce780, PYRONAME:comm1.Officer@127.0.0.1:24242>\r\n        self._safe = True\r\n        self._default_safe = True\r\n        self._pyroMethods = {'execute_function', 'stop_all_timers', 'set_method', 'iterate', 'get_attr', 'send', 'recv', 'shutdownAgent', 'list_timers', 'kill', 'log_error', 'log_debug', 'retireAllAgents', 'registered', 'each', 'send_recv', 'close_sockets', 'on_init', 'set_attr', 'raise_exception', 'set_logger', 'safe_call', 'connect', 'register', 'addr', 'loop', 'stop', 'addAgent', 'run', 'shutdown', 'after', 'ping', 'getAgent', 'bind', 'log_warning', 'log_info', 'stop_timer', 'removeAgent', 'subscribe', 'iddle'}\r\n        self._pyroHandshake = 'hello'\r\n    serializer = <Pyro4.util.DillSerializer object at 0x7f82f5a45400>\r\n    vargs = ['addAgent', 'comm1.Officer.dragon', '127.0.0.1:24242', '127.0.0.1', 'data1', 'data2']\r\n----------------------------------------------------\r\n EXCEPTION <class 'ValueError'>: too many values to unpack (expected 8)\r\n----------------------------------------------------\r\n +--- This exception occured remotely (Pyro) - Remote traceback:\r\n | ----------------------------------------------------\r\n |  EXCEPTION <class 'ValueError'>: too many values to unpack (expected 8)\r\n |  Extended stacktrace follows (most recent call last)\r\n | ----------------------------------------------------\r\n | File \"/home/alex/anaconda3/lib/python3.5/site-packages/Pyro4/core.py\", line 1176, in Daemon.handleRequest\r\n | Source code:\r\n |     data = method(*vargs, **kwargs)  # this is the actual method call to the Pyro object\r\n | ----------------------------------------------------\r\n | File \"/home/alex/anaconda3/lib/python3.5/site-packages/osbrain/agent.py\", line 312, in CommunicationsOfficer.safe_call\r\n | Source code:\r\n |     return self._loopback_reqrep('inproc://_loopback_safe', data)\r\n | Local values:\r\n |     args = ('comm1.Officer.dragon', '127.0.0.1:24242', '127.0.0.1', 'data1', 'data2')\r\n |     data = b'\\x80\\x03X\\x08\\x00\\x00\\x00addAgentq\\x00(X\\x14\\x00\\x00\\x00comm1.Officer.dragonq\\x01X\\x0f\\x00\\x00\\x00127.0.0.1:24242q\\x02X\\t\\x00\\x00\\x00127.0.0.1q\\x03X#\\x00\\x00\\x00data1q\\x04X\\x80\\x00\\x00\\x00data2q\\x05tq\\x06}q\\x07\\x87q\\x08.'\r\n |     kwargs = {}\r\n |     method = 'addAgent'\r\n |     self = <__main__.CommunicationsOfficer object at 0x7f4e2f497320>\r\n |         self._pyroId = 'obj_c5f9c060e75d4523b47e2b6340fa17c0'\r\n |         self.serializer = None\r\n |         self.running = True\r\n |         self.address = {<zmq.sugar.socket.Socket object at 0x7f4e2f35aa08>: AgentAddress(inproc, loopback, REP, server, pickle), <zmq.sugar.socket.Socket object at 0x7f4e2f35ab28>: AgentAddress(inproc, _loopback_safe, REP, server, pickle), 'loopback': AgentAddress(inproc, loopback, REP, server, pickle), AgentAddress(inproc, loopback, REP, server, pickle): AgentAddress(inproc, loopback, REP, server, pickle), AgentAddress(inproc, _loopback_safe, REP, server, pickle): AgentAddress(inproc, _loopback_safe, REP, server, pickle), '_loopback_safe': AgentAddress(inproc, _loopback_safe, REP, server, pickle), <zmq.sugar.socket.Socket object at 0x7f4e2f35afa8>: AgentAddress(ipc, 246bfaff-8c59-40bf-8f6b-8aeb71d27a75, PUB, server, pickle), 'comm1.Officer.Communications': AgentAddress(ipc, 246bfaff-8c59-40bf-8f6b-8aeb71d27a75, PUB, server, pickle), AgentAddress(ipc, 246bfaff-8c59-40bf-8f6b-8aeb71d27a75, PUB, server, pickle): AgentAddress(ipc, 246bfaff-8c59-40bf-8f6b-8aeb71d27a75, PUB, server, pickle)}\r\n |         self.handler = {<zmq.sugar.socket.Socket object at 0x7f4e2f35aa08>: <function Agent._handle_loopback at 0x7f4e2f326620>, <zmq.sugar.socket.Socket object at 0x7f4e2f35ab28>: <function Agent._handle_loopback_safe at 0x7f4e2f3266a8>}\r\n |         self._async_req_uuid = {}\r\n |         self.cache_loanOrders = {}\r\n |         self.polo = <poloniexApi.Poloniex object at 0x7f4e2f497400>\r\n |         self._pending_requests = {}\r\n |         self.transport = None\r\n |         self.poloAgents = {'comm1.Officer.dragon': <osbrain.proxy.Proxy at 0x7f4e2f42f518, connected, for PYRONAME:comm1.Officer.dragon@127.0.0.1:24242>}\r\n |         self.socket = {'loopback': <zmq.sugar.socket.Socket object at 0x7f4e2f35aa08>, AgentAddress(inproc, loopback, REP, server, pickle): <zmq.sugar.socket.Socket object at 0x7f4e2f35aa08>, AgentAddress(inproc, _loopback_safe, REP, server, pickle): <zmq.sugar.socket.Socket object at 0x7f4e2f35ab28>, '_loopback_safe': <zmq.sugar.socket.Socket object at 0x7f4e2f35ab28>, 'comm1.Officer.Communications': <zmq.sugar.socket.Socket object at 0x7f4e2f35afa8>, AgentAddress(ipc, 246bfaff-8c59-40bf-8f6b-8aeb71d27a75, PUB, server, pickle): <zmq.sugar.socket.Socket object at 0x7f4e2f35afa8>}\r\n |         self.poller = <zmq.sugar.poll.Poller object at 0x7f4e2f497390>\r\n |         self._pyroDaemon = <Pyro4.core.Daemon at 0x7f4e2f37bb00, 127.0.0.1:44316, 2 objects>\r\n |         self._DEBUG = False\r\n |         self.uuid = '14e3ab82bd464c2781df6e1f6fe2288d'\r\n |         self._shutdown_now = False\r\n |         self.poll_timeout = 1000\r\n |         self.keep_alive = True\r\n |         self._timer = {}\r\n |         self.name = 'comm1.Officer'\r\n |         self.debug = False\r\n |         self.context = <zmq.sugar.context.Context object at 0x7f4e2f4c1b38>\r\n |         self.host = '127.0.0.1'\r\n |         self._async_req_handler = {}\r\n | ----------------------------------------------------\r\n | File \"/home/alex/anaconda3/lib/python3.5/site-packages/osbrain/agent.py\", line 280, in CommunicationsOfficer._loopback_reqrep\r\n | Source code:\r\n |     response = loopback.recv_pyobj()\r\n | Local values:\r\n |     data_to_send = b'\\x80\\x03X\\x08\\x00\\x00\\x00addAgentq\\x00(X\\x14\\x00\\x00\\x00comm1.Officer.dragonq\\x01X\\x0f\\x00\\x00\\x00127.0.0.1:24242q\\x02X\\t\\x00\\x00\\x00127.0.0.1q\\x03X#\\x00\\x00\\x00data1q\\x04X\\x80\\x00\\x00\\x00data2q\\x05tq\\x06}q\\x07\\x87q\\x08.'\r\n |     loopback = <zmq.sugar.socket.Socket object at 0x7f4e2f3897c8>\r\n |     self = <__main__.CommunicationsOfficer object at 0x7f4e2f497320>\r\n |         self._pyroId = 'obj_c5f9c060e75d4523b47e2b6340fa17c0'\r\n |         self.serializer = None\r\n |         self.running = True\r\n |         self.address = {<zmq.sugar.socket.Socket object at 0x7f4e2f35aa08>: AgentAddress(inproc, loopback, REP, server, pickle), <zmq.sugar.socket.Socket object at 0x7f4e2f35ab28>: AgentAddress(inproc, _loopback_safe, REP, server, pickle), 'loopback': AgentAddress(inproc, loopback, REP, server, pickle), AgentAddress(inproc, loopback, REP, server, pickle): AgentAddress(inproc, loopback, REP, server, pickle), AgentAddress(inproc, _loopback_safe, REP, server, pickle): AgentAddress(inproc, _loopback_safe, REP, server, pickle), '_loopback_safe': AgentAddress(inproc, _loopback_safe, REP, server, pickle), <zmq.sugar.socket.Socket object at 0x7f4e2f35afa8>: AgentAddress(ipc, 246bfaff-8c59-40bf-8f6b-8aeb71d27a75, PUB, server, pickle), 'comm1.Officer.Communications': AgentAddress(ipc, 246bfaff-8c59-40bf-8f6b-8aeb71d27a75, PUB, server, pickle), AgentAddress(ipc, 246bfaff-8c59-40bf-8f6b-8aeb71d27a75, PUB, server, pickle): AgentAddress(ipc, 246bfaff-8c59-40bf-8f6b-8aeb71d27a75, PUB, server, pickle)}\r\n |         self.handler = {<zmq.sugar.socket.Socket object at 0x7f4e2f35aa08>: <function Agent._handle_loopback at 0x7f4e2f326620>, <zmq.sugar.socket.Socket object at 0x7f4e2f35ab28>: <function Agent._handle_loopback_safe at 0x7f4e2f3266a8>}\r\n |         self._async_req_uuid = {}\r\n |         self.cache_loanOrders = {}\r\n |         self.polo = <poloniexApi.Poloniex object at 0x7f4e2f497400>\r\n |         self._pending_requests = {}\r\n |         self.transport = None\r\n |         self.poloAgents = {'comm1.Officer.dragon': <osbrain.proxy.Proxy at 0x7f4e2f42f518, connected, for PYRONAME:comm1.Officer.dragon@127.0.0.1:24242>}\r\n |         self.socket = {'loopback': <zmq.sugar.socket.Socket object at 0x7f4e2f35aa08>, AgentAddress(inproc, loopback, REP, server, pickle): <zmq.sugar.socket.Socket object at 0x7f4e2f35aa08>, AgentAddress(inproc, _loopback_safe, REP, server, pickle): <zmq.sugar.socket.Socket object at 0x7f4e2f35ab28>, '_loopback_safe': <zmq.sugar.socket.Socket object at 0x7f4e2f35ab28>, 'comm1.Officer.Communications': <zmq.sugar.socket.Socket object at 0x7f4e2f35afa8>, AgentAddress(ipc, 246bfaff-8c59-40bf-8f6b-8aeb71d27a75, PUB, server, pickle): <zmq.sugar.socket.Socket object at 0x7f4e2f35afa8>}\r\n |         self.poller = <zmq.sugar.poll.Poller object at 0x7f4e2f497390>\r\n |         self._pyroDaemon = <Pyro4.core.Daemon at 0x7f4e2f37bb00, 127.0.0.1:44316, 2 objects>\r\n |         self._DEBUG = False\r\n |         self.uuid = '14e3ab82bd464c2781df6e1f6fe2288d'\r\n |         self._shutdown_now = False\r\n |         self.poll_timeout = 1000\r\n |         self.keep_alive = True\r\n |         self._timer = {}\r\n |         self.name = 'comm1.Officer'\r\n |         self.debug = False\r\n |         self.context = <zmq.sugar.context.Context object at 0x7f4e2f4c1b38>\r\n |         self.host = '127.0.0.1'\r\n |         self._async_req_handler = {}\r\n |     socket = 'inproc://_loopback_safe'\r\n | ----------------------------------------------------\r\n | File \"/home/alex/anaconda3/lib/python3.5/site-packages/zmq/sugar/socket.py\", line 492, in Socket.recv_pyobj\r\n | Source code:\r\n |     return self._deserialize(msg, pickle.loads)\r\n | Local values:\r\n |     flags = 0\r\n |     msg = b'\\x80\\....too much data deleted.....\\x94b.'\r\n |     self = <zmq.sugar.socket.Socket object at 0x7f4e2f3897c8>\r\n |         self._shadow = False\r\n | ----------------------------------------------------\r\n | File \"/home/alex/anaconda3/lib/python3.5/site-packages/zmq/sugar/socket.py\", line 419, in Socket._deserialize\r\n | Source code:\r\n |     return load(recvd)\r\n | Local values:\r\n |     load = <built-in function loads>\r\n |     recvd = b'\\x80\\....too much data deleted.....\\x94b.'\r\n |     self = <zmq.sugar.socket.Socket object at 0x7f4e2f3897c8>\r\n |         self._shadow = False\r\n | ----------------------------------------------------\r\n | File \"/home/alex/anaconda3/lib/python3.5/site-packages/osbrain/proxy.py\", line 104, in Proxy.__setstate__\r\n | Source code:\r\n |     super().__setstate__(state)\r\n | Local values:\r\n |     __class__ = <class 'osbrain.proxy.Proxy'>\r\n |     self = <ERROR>\r\n |     state = (<Pyro4.core.URI at 0x7f4e2f42f8d0, PYRONAME:comm1.Officer.dragon@127.0.0.1:24242>, {'run'}, {'stop', 'toggleAutoRenew', 'recv, 'loop', 'register', 'raise_exception', 'registered', 'send', 'setup', 'set_method', 'log_info', 'addr', 'bind', 'ping', 'log_warning', 'close_sockets', 'iddle', 'log_error', 'set_logger', 'iterate', 'kill', 'run', 'send_recv', 'shutdown', 'log_debug', 'set_attr', 'connect', 'stop_timer', 'list_timers', 'returnData', 'get_attr', 'after', 'on_init', 'stop_all_timers', 'subscribe', 'each', 'execute_function', 'safe_call'}, set(), 0.0, None, 'hello', 0, True, True)\r\n | ----------------------------------------------------\r\n | File \"/home/alex/anaconda3/lib/python3.5/site-packages/Pyro4/core.py\", line 311, in Proxy.__setstate__\r\n | Source code:\r\n |     self._pyroUri, self._pyroOneway, self._pyroMethods, self._pyroAttrs, _, self._pyroHmacKey, self._pyroHandshake, _ = state\r\n | Local values:\r\n |     self = <ERROR>\r\n |     state = (<Pyro4.core.URI at 0x7f4e2f42f8d0, PYRONAME:comm1.Officer.dragon@127.0.0.1:24242>, {'run'}, {'stop', 'toggleAutoRenew', 'recv, 'loop', 'register', 'raise_exception', 'registered', 'send', 'setup', 'set_method', 'log_info', 'addr', 'bind', 'ping', 'log_warning', 'close_sockets', 'iddle', 'log_error', 'set_logger', 'iterate', 'kill', 'run', 'send_recv', 'shutdown', 'log_debug', 'set_attr', 'connect', 'stop_timer', 'list_timers', 'returnData', 'get_attr', 'after', 'on_init', 'stop_all_timers', 'subscribe', 'each', 'execute_function', 'safe_call'}, set(), 0.0, None, 'hello', 0, True, True)\r\n | ----------------------------------------------------\r\n |  EXCEPTION <class 'ValueError'>: too many values to unpack (expected 8)\r\n | ----------------------------------------------------\r\n +--- End of remote traceback\r\n```\r\nI traced back the problem to the __setstate__ function (in pyro4) which expects 8 values in but gets 9. There seems to be rouge {'run'} in front of the _pyroMethods. My guess it there somewhere in between the patches from 0.3.1 to 0.4.0 a problem has been introduced.\r\n\r\nUnfortunately I can not create an example script which triggers this."},"comment":{"url":"https://api.github.com/repos/opensistemas-hub/osbrain/issues/comments/297432141","html_url":"https://github.com/opensistemas-hub/osbrain/issues/117#issuecomment-297432141","issue_url":"https://api.github.com/repos/opensistemas-hub/osbrain/issues/117","id":297432141,"user":{"login":"Peque","id":526577,"avatar_url":"https://avatars2.githubusercontent.com/u/526577?v=3","gravatar_id":"","url":"https://api.github.com/users/Peque","html_url":"https://github.com/Peque","followers_url":"https://api.github.com/users/Peque/followers","following_url":"https://api.github.com/users/Peque/following{/other_user}","gists_url":"https://api.github.com/users/Peque/gists{/gist_id}","starred_url":"https://api.github.com/users/Peque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Peque/subscriptions","organizations_url":"https://api.github.com/users/Peque/orgs","repos_url":"https://api.github.com/users/Peque/repos","events_url":"https://api.github.com/users/Peque/events{/privacy}","received_events_url":"https://api.github.com/users/Peque/received_events","type":"User","site_admin":false},"created_at":"2017-04-26T14:47:02Z","updated_at":"2017-04-26T14:47:02Z","body":"@one4many Thanks for sharing that information. I have tried to pass our current test suite with versions `4.47` or lower and it fails. However, with versions `4.48` and later all tests pass.\r\n\r\nWould you mind confirming if `4.48` works fine for you too? (just like `4.59`) If so, we will instantly rise up the requirements to that version."}}
{"actor":{"display_login":"Peque"}}