hyperledger-cacti / cacti

Hyperledger Cacti is a new approach to the blockchain interoperability problem
https://wiki.hyperledger.org/display/cactus
Apache License 2.0
338 stars 283 forks source link

Getting error subprocess.CalledProcessError: Command '['pip', 'install', 'pyzmq==18.1.0', '--install-option=--zmq=bundled']' returned non-zero exit status 2 #2500

Closed vinayverismart closed 1 year ago

vinayverismart commented 1 year ago

After running "make image" when line RUN cd indy-plenum && python3 setup.py install is executed, I am getting this error

ERROR [15/21] RUN cd indy-plenum && python3 setup.py install                                                                                                                                              1.6s                                                                                                                                                                                                       
 > [15/21] RUN cd indy-plenum && python3 setup.py install:                                                                                                                                                         
#0 1.200 running install                                                                                                                                                                                           
#0 1.211 running pyzmq                                                                                                                                                                                             
#0 1.394                                                                                                                                                                                                           
#0 1.394 Usage:                                                                                                                                                                                                    
#0 1.394   pip install [options] <requirement specifier> [package-index-options] ...
#0 1.394   pip install [options] -r <requirements file> [package-index-options] ...
#0 1.394   pip install [options] [-e] <vcs project url> ...
#0 1.394   pip install [options] [-e] <local project path> ...
#0 1.394   pip install [options] <archive url/path> ...
#0 1.394 
#0 1.394 no such option: --install-option
#0 1.435 Traceback (most recent call last):
#0 1.435   File "setup.py", line 67, in <module>
#0 1.435     setup(
#0 1.435   File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 144, in setup
#0 1.435     return distutils.core.setup(**attrs)
#0 1.435   File "/usr/lib/python3.8/distutils/core.py", line 148, in setup
#0 1.435     dist.run_commands()
#0 1.435   File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands
#0 1.435     self.run_command(cmd)
#0 1.435   File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
#0 1.435     cmd_obj.run()
#0 1.435   File "setup.py", line 55, in run
#0 1.435     install.run_command(self, command='pyzmq')
#0 1.435   File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
#0 1.435     self.distribution.run_command(command)
#0 1.435   File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
#0 1.435     cmd_obj.run()
#0 1.435   File "setup.py", line 48, in run
#0 1.435     subprocess.check_call(command)
#0 1.435   File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
#0 1.435     raise CalledProcessError(retcode, cmd)
#0 1.435 subprocess.CalledProcessError: Command '['pip', 'install', 'pyzmq==18.1.0', '--install-option=--zmq=bundled']' returned non-zero exit status 2.

Dockerfile:24
  22 |     RUN python3 -m pip uninstall -y indy-node
  23 |     
  24 | >>> RUN cd indy-plenum && python3 setup.py install
  25 |     
  26 |     WORKDIR /usr/src/indy_projects/indy-node
ERROR: failed to solve: process "/bin/sh -c cd indy-plenum && python3 setup.py install" did not complete successfully: exit code: 1
Reaping losing child 0x5602fc1975f0 PID 79214 
make: *** [Makefile:2: image] Error 1
Removing child 0x5602fc1975f0 PID 79214 from chain.

Steps to reproduce

  1. Clone https://github.com/hyperledger-labs/weaver-dlt-interoperability -b main
  2. Go to tests/network-setups/indy
  3. Run make image

Docker version 23.0.5, build bc4487a docker-compose version 1.29.2, build unknown

rudranshsharma123 commented 1 year ago

Hi, So I ran into the same issue while doing make image. Now, since it’s a container and nothing is being directly installed on my bare metal I had to look up the exact config of setup.py which seems to be the one causing the issues. Fortunately, the dockerfile had the link to the codebase it was referring which is - https://github.com/ghoshbishakh/indy-plenum/blob/master/setup.py#L113 I have pasted the exact setup.py which was causing all the issues. Since no other alternative came to mind, I chose to manually install all the dependencies needed instead of using this file. So, the updated line 25 of the Dockerfile now looks like this:

RUN pip3 install jsonpickle==0.9.6 ujson==1.33 prompt_toolkit==0.57 pygments==2.2.0 rlp==0.5.1 sha3==0.2.1 leveldb ioflo==1.5.4 semver==2.7.9 base58==1.0.0 orderedset==2.0.3 sortedcontainers==1.5.7 psutil==5.6.6 importlib_metadata>=2.0 portalocker==0.5.7 libnacl==1.6.1 six==1.11.0 intervaltree==2.1.0 msgpack-python==0.4.6 python-rocksdb==0.6.9 python-dateutil==2.6.1 pympler==0.8 packaging==19.0 python-ursa==0.1.1 pyzmq==18.1.0

I used pip3 instead of pip because there was a strict requirement for python3 and I figured pip3 would work the best. So, running make image again now yielded no errors, and the docker image was successfully built.