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

Improve the clarity of error messages for version incompatibility #332

Closed
comrumino opened this issue Jun 4, 2019 · 0 comments
Closed
Assignees

Comments

@comrumino
Copy link
Collaborator

comrumino commented Jun 4, 2019

There should be a unique exception which is thrown when using incompatible versions. Rather than using an exception hierarchy, once Python 2 support is dropped, RpycVersionError should suffice. So, support for this should be done in tandem with dropping Python 2 support.

Environment: RPyC versions

Original issue: #330
Client

  • RPyC 4.1.0
  • Python 3

Server

  • RPyC 4.0.2
  • Python 3
========= Remote Traceback (1) =========
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/rpyc/core/protocol.py", line 329, in _dispatch_request
    res = self._HANDLERS[handler](self, *args)
  File "/usr/lib/python3.7/site-packages/rpyc/core/protocol.py", line 594, in _handle_inspect
    return tuple(netref.inspect_methods(self._local_objects[oid]))
  File "/usr/lib/python3.7/site-packages/rpyc/lib/colls.py", line 86, in __getitem__
    return self._dict[key][0]
KeyError: (7696561775896, 'SlaveService', 'rpyc.core.service')
Environment: Python interpreter 2-3

Original issue: #327
Client

  • RPyC 4.1.0
  • Python 2

Server

  • RPyC 4.1.0
  • Python 3
Traceback (most recent call last):
  File "./matlabClient.py", line 17, in <module>
    r = c.root.performMatlab("gcd", *l)
  File "/home/lafayette/.local/lib/python2.7/site-packages/rpyc/core/netref.py", line 199, in __call__
    return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
  File "/home/lafayette/.local/lib/python2.7/site-packages/rpyc/core/netref.py", line 75, in syncreq
    return conn.sync_request(handler, proxy, *args)
  File "/home/lafayette/.local/lib/python2.7/site-packages/rpyc/core/protocol.py", line 471, in sync_request
    return self.async_request(handler, *args, timeout=timeout).value
  File "/home/lafayette/.local/lib/python2.7/site-packages/rpyc/core/async_.py", line 97, in value
    raise self._obj
rpyc.core.vinegar/builtins.TypeError: must be str, not bytes

========= Remote Traceback (1) =========
Traceback (most recent call last):
  File "/home/lafayette/.local/lib/python3.6/site-packages/rpyc/core/protocol.py", line 329, in _dispatch_request
    res = self._HANDLERS[handler](self, *args)
  File "/home/lafayette/.local/lib/python3.6/site-packages/rpyc/core/protocol.py", line 590, in _handle_call
    return obj(*args, **dict(kwargs))
  File "matlabService.py", line 162, in exposed_performMatlab
    return performMatlab(theMatlabFunc, *args, **kwargs)
  File "matlabService.py", line 121, in performMatlab
    " " + repr(args) + " " + repr(kwargs))
TypeError: must be str, not bytes
@comrumino comrumino self-assigned this Jun 6, 2019
YuvalEvron pushed a commit to weka/rpyc that referenced this issue Oct 27, 2019
* Added warning to _remote_tb when the major version of local and remote mismatch (tomerfiliba-org#332)

* Added `include_local_version` to DEFAULT_CONFIG to allow for configurable security controls (e.g. `include_local_traceback`)

* Update readme.txt

* Added break to client process loop when everything is dead

* Increased chunk size to improve multi-client response time and throughput of large data tomerfiliba-org#329

* Improved test for response of client 1 while transferring a large amount of data to client 2

* Cleaned up coding style of test_service_pickle.py

* Updated issue template

* added vs code testing cfgs; updated gitignore venv

* Changed settings.json to use env USERNAME

* Name pack casted in _unbox to fix IronPython bug. Fixed tomerfiliba-org#337

* Fixed netref.class_factory id_pack usage per tomerfiliba-org#339 and added test cases

* Added .readthedocs.yml and requirements to build

* Make OneShotServer terminates after client connection ends

* Added unit test for OneShotServer. Fixed tomerfiliba-org#343

* Fixed 2.6 backwards incompatibility for format syntax

* Updated change log and bumped version --- 4.1.1

* Added support for chained connections which result in netref being passed to get_id_pack. Fixed tomerfiliba-org#346

* Added tests for get_id_pack

* Added a test for issue tomerfiliba-org#346

* Corrected the connection used to inspect a netref

* Refactored __cmp__ getattr

* Extended rpyc over rpyc unit testing and removed port parameter from TestRestricted

* Added comment explaining the inspect for intermediate proxy. Fixed tomerfiliba-org#346

* Improved docstring for serve_threaded to address when and when not to use the method. Done tomerfiliba-org#345

* Release 4.1.2

* Fixed versions referred to in security.rst

* link docs instead of mitre

* set up logging with a better formatter

* fix bug when proxy context-manager is being exited with an exception (#1)

* logging: add a rotating file log handler

* fix bug when proxy context-manager is being exited with an exception (#1)

* logging: add a rotating file log handler
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

1 participant