MD-Studio / MDStudio

A general framework for microservice based distributed applications
Apache License 2.0
12 stars 0 forks source link

Unable to register component in python #119

Closed felipeZ closed 6 years ago

felipeZ commented 6 years ago

When installing the components using python 2 using pipenv I get the following error:

2018-04-10T14:05:29+0200 Unhandled error in Deferred:
2018-04-10T14:05:29+0200 Traceback (most recent call last):
Failure: autobahn.wamp.exception.ApplicationError: ApplicationError(error=<wamp.error.runtime_error>, args=[u'uri'], kwargs={}, enc_algo=None)

In python 3 there is not such error.

felipeZ commented 6 years ago

The source of the problem is that the core components in the docker container used python 3, then when I try to register a component from python 2, the endpoints receives the claims as bytecode instead of unicode. For instance when invoking the call method of the CommonSession, the claims used by the client are:

{'action': 'call', 'requestHash': u'05sgOqFT/a06cjQ1z8OTMdgvkyXkcdc0u9zEV5ZdjL+qUz2aLPMf1W91GUludDZyIx53LeDt2+UALmWjqHQD5Q==', 'vendor': 'mdgroup', 'uri': u'mdstudio.schema.endpoint.upload', 'asGroup': 'mdgroup'}

while the claims received by the endpoint are:

 {b'action': b'call', b'requestHash': '05sgOqFT/a06cjQ1
z8OTMdgvkyXkcdc0u9zEV5ZdjL+qUz2aLPMf1W91GUludDZyIx53LeDt2+UALmWjqHQD5Q==', b'vendor': b'mdgroup', b'uri':
 'mdstudio.schema.endpoint.upload', b'asGroup': b'mdgroup', 'username': 'mdadmin'}