algo icon indicating copy to clipboard operation
algo copied to clipboard

python3 is missing

Open wisexie opened this issue 6 years ago • 13 comments

TASK [common : Gather facts] *************************************************** fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "/bin/sh: /usr/bin/python3: No such file or directory\n", "module_stdout": "", "msg": "The module failed to execute correctly, you probably need to set the interpreter.\nSee stdout/stderr for the exact error", "rc": 127} included: /root/algo-master/playbooks/rescue.yml for localhost

TASK [debug] ******************************************************************* ok: [localhost] => { "fail_hint": [ "Sorry, but something went wrong!", "Please check the troubleshooting guide.", "https://trailofbits.github.io/algo/troubleshooting.html" ] }

TASK [Fail the installation] *************************************************** fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed as requested from task"}

wisexie avatar Jun 15 '19 08:06 wisexie

Please post the output from your installation attempt where it says:

--> Please include the following block of text when reporting issues:

davidemyers avatar Jun 15 '19 11:06 davidemyers

I am getting this error as well. Running this on localhost, docker, Ubuntu 18.04.

TASK [common : Gather facts] fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "/bin/sh: /usr/bin/python3: not found\n", "module_stdout": "", "msg": "The module failed to execute correctly, you probably need to set the interpreter.\nSee stdout/stderr for the exact error", "rc": 127}

TASK [debug] 
ok: [localhost] => {
    "fail_hint": [
        "Sorry, but something went wrong!",
        "Please check the troubleshooting guide.",
        "https://trailofbits.github.io/algo/troubleshooting.html"
    ]
}

TASK [Fail the installation] 
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed as requested from task"}
PLAY RECAP 
localhost                  : ok=29   changed=3    unreachable=0    failed=2```

alexraskin avatar Jun 20 '19 19:06 alexraskin

Python3 is included by default in Ubuntu 18.04, and it seems you're using a custom image. What cloud provider do you use?

jackivanov avatar Jun 21 '19 15:06 jackivanov

I am using an unsupported hosting service. I am going to do some more troubleshooting today. What is strange is, if I run in this in python virtualenv the script runs no problem.

alexraskin avatar Jun 21 '19 16:06 alexraskin

Do you have python3 installed in the system? If not, try to install it and run Algo again, please

jackivanov avatar Jun 21 '19 16:06 jackivanov

I have python3 installed.

python3 -V Python 3.6.8

alexraskin avatar Jun 21 '19 16:06 alexraskin

And it's in /usr/bin/python3? run which python3

jackivanov avatar Jun 21 '19 16:06 jackivanov

which python3 /usr/bin/python3

alexraskin avatar Jun 21 '19 17:06 alexraskin

@alexraskin Have you found out where the problem is? I'm worrying whether we need to update the docs

jackivanov avatar Jul 04 '19 16:07 jackivanov

@jackivanov I have not... I haven't had a chance to try again. I am just running in DO for now. I am going to try again this weekend. I will update you when I do. Thanks

alexraskin avatar Jul 08 '19 23:07 alexraskin

@jackivanov I was not able to figure out the problem. I ended not using docker. Sorry..

alexraskin avatar Jul 24 '19 18:07 alexraskin

I run into the same issue when using the official docker image. How to reproduce:

  1. install the official configuration file from https://github.com/trailofbits/algo/blob/master/config.cfg into /tmp/algo and change the permission to 644 just in case.

  2. Run the official Docker image and don't select a provider by just pressing Return or choosing the local installation option. Every configuration option asked for shouldn't matter and the default is sufficient to trigger this bug.

docker run \                                                                                                                                                
   --cap-drop=all -it \                                                                                                                                 
   -v /tmp/algo:/data \                                                                                                            
   trailofbits/algo:latest

Algo tries to install the software on the local system but it fails at the gather facts part

TASK [common : Gather facts] *********************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "/bin/sh: /usr/bin/python3: not found\n", "module_stdout": "", "msg": "The module failed to execute correctly, you probably need to set the interpreter.\nSee stdout/stderr for the exact error", "rc": 127}

The root cause is that python is installed at /usr/local/bin in the Algo docker container:

$ docker run --rm -it --entrypoint /bin/sh trailofbits/algo:latest                                                                     
/algo # ls /usr/bin/python3                                                                                                                                  
ls: /usr/bin/python3: No such file or directory                                                                                                              
/algo # which python3                                                                                                                                        
/usr/local/bin/python3

volker-fr avatar Dec 14 '19 21:12 volker-fr

The key part of the Docker documentation is actually

While it is not possible to run your Algo server from within a Docker container, it is possible to use Docker to provision your Algo server.

But then it seems like the python3 path itself is hard coded and won't be found by the Gather facts step.

volker-fr avatar Dec 14 '19 21:12 volker-fr