Search code examples
ubuntuhyperledger-sawtooth

When I use the "sawtooth" command, I got an error


When I run the script sawtooth keygen my_key, I got:

   Traceback (most recent call last):
  File "/usr/bin/sawtooth", line 11, in <module>
    load_entry_point('sawtooth-cli==1.2.6', 'console_scripts', 'sawtooth')()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 480, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2693, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2324, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2330, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3/dist-packages/sawtooth_cli/main.py", line 33, in <module>
    from sawtooth_cli.batch import add_batch_parser
  File "/usr/lib/python3/dist-packages/sawtooth_cli/batch.py", line 27, in <module>
    from sawtooth_cli.protobuf import batch_pb2
  File "/usr/lib/python3/dist-packages/sawtooth_cli/protobuf/batch_pb2.py", line 15, in <module>
    from sawtooth_cli.protobuf import transaction_pb2 as sawtooth__cli_dot_protobuf_dot_transaction__pb2
  File "/usr/lib/python3/dist-packages/sawtooth_cli/protobuf/transaction_pb2.py", line 22, in <module>
    serialized_pb=_b('\n\'sawtooth_cli/protobuf/transaction.proto\"\xd5\x01\n\x11TransactionHeader\x12\x1a\n\x12\x62\x61tcher_public_key\x18\x01 \x01(\t\x12\x14\n\x0c\x64\x65pendencies\x18\x02 \x03(\t\x12\x13\n\x0b\x66\x61mily_name\x18\x03 \x01(\t\x12\x16\n\x0e\x66\x61mily_version\x18\x04 \x01(\t\x12\x0e\n\x06inputs\x18\x05 \x03(\t\x12\r\n\x05nonce\x18\x06 \x01(\t\x12\x0f\n\x07outputs\x18\x07 \x03(\t\x12\x16\n\x0epayload_sha512\x18\t \x01(\t\x12\x19\n\x11signer_public_key\x18\n \x01(\t\"H\n\x0bTransaction\x12\x0e\n\x06header\x18\x01 \x01(\x0c\x12\x18\n\x10header_signature\x18\x02 \x01(\t\x12\x0f\n\x07payload\x18\x03 \x01(\x0c\"5\n\x0fTransactionList\x12\"\n\x0ctransactions\x18\x01 \x03(\x0b\x32\x0c.TransactionB*\n\x15sawtooth.sdk.protobufP\x01Z\x0ftransaction_pb2b\x06proto3')
TypeError: __new__() got an unexpected keyword argument 'serialized_options'

My system is ubuntu 18.04. And I installed the sawtooth following:https://sawtooth.hyperledger.org/docs/core/releases/latest/app_developers_guide/ubuntu.html


Solution

  • This issue happens due to outdated protobuf as listed in many sawtooth forum. The same issue is already answered here. You can check this answer too.