Skip to content
This repository has been archived by the owner on Mar 30, 2018. It is now read-only.

ImportError: No module named google.protobuf error only in Travis #2266

Closed
rameshthoomu opened this issue Jul 21, 2016 · 3 comments · Fixed by #2267
Closed

ImportError: No module named google.protobuf error only in Travis #2266

rameshthoomu opened this issue Jul 21, 2016 · 3 comments · Fixed by #2267

Comments

@rameshthoomu
Copy link
Contributor

Description

Observed google.protobuf error in travis builds while executing behave tests. This issue observed in almost all the Travis PR Builds after merge the PR #2213 (commit hyperledger/fabric@a511daa) in fabric master.

Binary available as build/bin/peer
Running behave tests
Exception ImportError: No module named google.protobuf
Traceback (most recent call last):
  File "/usr/local/bin/behave", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/behave/__main__.py", line 109, in main
    failed = runner.run()
  File "/usr/local/lib/python2.7/dist-packages/behave/runner.py", line 672, in run
    return self.run_with_paths()
  File "/usr/local/lib/python2.7/dist-packages/behave/runner.py", line 678, in run_with_paths
    self.load_step_definitions()
  File "/usr/local/lib/python2.7/dist-packages/behave/runner.py", line 658, in load_step_definitions
    exec_file(os.path.join(path, name), step_module_globals)
  File "/usr/local/lib/python2.7/dist-packages/behave/runner.py", line 304, in exec_file
    exec(code, globals, locals)
  File "steps/bdd_grpc_util.py", line 20, in <module>
    import devops_pb2
  File "/home/travis/gopath/src/github.com/hyperledger/fabric/bddtests/devops_pb2.py", line 6, in <module>
    from google.protobuf import descriptor as _descriptor
ImportError: No module named google.protobuf
make: *** [behave] Error 1
rm build/docker/bin/membersrvc build/docker/bin/peer

commit a511daa
Author: Jeronimo [email protected]
Date: Tue Jul 19 11:40:25 2016 -0300

Describe How to Reproduce

Travis Builds -
https://travis-ci.org/hyperledger/fabric/jobs/146260865
https://travis-ci.org/hyperledger/fabric/jobs/145844081

@juliancarrivick-ibm
Copy link
Contributor

I came across this yesterday afternoon too. From what I can tell there may be some version mismatches in the environment for the python packages. When the python packages are installed during scripts/provision/host.sh there are some failures (~Line 480 of Travis Behave Log):

Installing collected packages: futures, protobuf, grpcio
  Running setup.py install for protobuf
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-9xtqor/protobuf/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Nbx6EJ-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    protoc is not installed nor found in ../src.  Please compile it or install the binary package.
    Generating google/protobuf/pyext/python_pb2.py...

    ----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-9xtqor/protobuf/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Nbx6EJ-record/install-record.txt --single-version-externally-managed --compile" failed with error code 255 in /tmp/pip-build-9xtqor/protobuf

I'll have a crack at fixing this by modifying host.sh but I may be on the completely wrong track so please say so if I am!

@rameshthoomu
Copy link
Contributor Author

yes.. this fix works for Travis protobuf issue.. I see couple of open issues in Travis github related to protobuff version. Thanks for quick fix...

@juliancarrivick-ibm
Copy link
Contributor

Yesterday I found the issue to be very inconsistent - sometimes it would pass, sometimes it wouldn't.
I'll reverify a couple of times to be sure.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

3 participants