hyperledger-archives / education-sawtooth-simple-supply

https://wiki.hyperledger.org/display/LMDWG
Apache License 2.0
51 stars 61 forks source link

protobuf error? #24

Closed faizol closed 6 years ago

faizol commented 6 years ago

Hi, I'm a newbie and just started learning about sawtooth. I tried to run the containers as instructed in the README.md, but I got these errors on the console;

simple-supply-subscriber    | TypeError: __new__() got an unexpected keyword argument 'serialized_options'

simple-supply-rest-api      | TypeError: __new__() got an unexpected keyword argument 'serialized_options'

simple-supply-tp            | TypeError: __new__() got an unexpected keyword argument 'serialized_options'

Googling around I think it is related to protobuf (protoc version and protobuf runtime version). How can I fix these errors?

Thanks.

Best regards,

RakeshDevUK commented 6 years ago

hi Faizol, i am also getting the same error . struggling to find out the solution... ;( Tried all the option mentioned on various blogs to update the python protobuf version, still no luck? Did you find any solution ?

faizol commented 6 years ago

@RakeshDevUK Hi, The problem happened as the protobuf runtime lib version supplied/installed by Dockerfile is older than protoc. So to solve the problem, just make sure that the containers update the runtime lib by modifying Dockerfile in their respective folder. For Dockerfile in processor folder, make sure to also install "python3-pip" (add to the end of line 22). Then for Dockerfile in all three folders (processor, rest_api, simple_supply_subscriber), add "RUN pip3 install -U protobuf" to update the installed protobuf runtime lib.

Hope that helps.

lorepieri8 commented 6 years ago

@faizol perhaps create a pull request with the fix?

danintel commented 5 years ago

This issue is closed, but for the record, it looks the protobuf library is older than the protoc compiler.

You can have a protobuf library newer than your protoc compiler, but not older (the protobuf library is backward compatible, but not forward (future) compatible.

See also issue #26, which is at least partly a duplicate of this issue.

danintel commented 5 years ago

A fix for this error is in PR #30. Basically the fix is to remove the serialized_options arguments from the protobufs/*/*_pb2.py files.. The serialized_options argument requires Protobuf 3.6.0 or above to support serialized_options, but repo.sawtooth.me is only at Protobuf 3.4.1 for Sawtooth 1.0 and 1.1 at least.

thackerronak commented 4 years ago

@RakeshDevUK Hi, The problem happened as the protobuf runtime lib version supplied/installed by Dockerfile is older than protoc. So to solve the problem, just make sure that the containers update the runtime lib by modifying Dockerfile in their respective folder. For Dockerfile in processor folder, make sure to also install "python3-pip" (add to the end of line 22). Then for Dockerfile in all three folders (processor, rest_api, simple_supply_subscriber), add "RUN pip3 install -U protobuf" to update the installed protobuf runtime lib.

Hope that helps.

working fine after these changes.