ptwobrussell / Mining-the-Social-Web-2nd-Edition

The official online compendium for Mining the Social Web, 2nd Edition (O'Reilly, 2013)
http://bit.ly/135dHfs
Other
2.9k stars 1.49k forks source link

Python issue installing VM #243

Open jknipp opened 9 years ago

jknipp commented 9 years ago

On OSX Yosemite host, ran into the following issue installing setup tools (ez_setup & pip). Looks like python was not linked as expected by Chef. Resolved it by running vagrant ssh and then sudo ln -s /usr/bin/python /bin/python.

After that I had to run vagrant provision.

==> default: ================================================================================ ==> default: Error executing action run on resource 'execute[install-setuptools]' ==> default: ================================================================================ ==> default: ==> default: ==> default: Mixlib::ShellOut::ShellCommandFailed ==> default: ------------------------------------ ==> default: Expected process to exit with [0], but received '127' ==> default: ---- Begin output of /bin/python ez_setup.py ==> default: ---- ==> default: STDOUT: ==> default: ==> default: STDERR: sh: 1: /bin/python: not found ==> default: ---- End output of /bin/python ez_setup.py ==> default: ---- ==> default: Ran /bin/python ez_setup.py ==> default: returned 127 ==> default: ==> default: Resource Declaration: ==> default: --------------------- ==> default: # In /tmp/vagrant-chef-5/chef-solo-1/cookbooks/python/recipes/pip.rb ==> default: ==> default: ==> default: ==> default: 48: execute "install-setuptools" do ==> default: ==> default: 49: cwd Chef::Config[:file_cache_path] ==> default: 50: command <<-EOF ==> default: 51: #{node['python']['binary']} ez_setup.py ==> default: 52: EOF ==> default: 53: not_if "#{node['python']['binary']} -c 'import setuptools'" ==> default: 54: end ==> default: 55: ==> default: ==> default: ==> default: ==> default: Compiled Resource: ==> default: ------------------ ==> default: # Declared in /tmp/vagrant-chef-5/chef-solo-1/cookbooks/python/recipes/pip.rb:48:in from_file' ==> default: ==> default: ==> default: ==> default: execute("install-setuptools") do ==> default: ==> default: action "run" ==> default: ==> default: retries 0 ==> default: ==> default: retry_delay 2 ==> default: ==> default: default_guard_interpreter :execute ==> default: command " /bin/python ez_setup.py\n" ==> default: ==> default: backup 5 ==> default: ==> default: cwd "/var/chef/cache" ==> default: returns 0 ==> default: ==> default: cookbook_name :python ==> default: ==> default: recipe_name "pip" ==> default: ==> default: not_if "/bin/python -c 'import setuptools'" ==> default: ==> default: end ==> default: ==> default: ==> default: ==> default: [2014-12-13T19:50:14+00:00] INFO: Running queued delayed notifications before re-raising exception ==> default: [2014-12-13T19:50:14+00:00] DEBUG: Re-raising exception: Mixlib::ShellOut::ShellCommandFailed - execute[install-setuptools] (python::pip line 48) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '127' ==> default: ---- Begin output of /bin/python ez_setup.py ==> default: ---- ==> default: STDOUT: ==> default: STDERR: sh: 1: /bin/python: not found ==> default: ---- End output of /bin/python ez_setup.py ==> default: ---- ==> default: Ran /bin/python ez_setup.py ==> default: returned 127 ==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.0.0/lib/mixlib/shellout.rb:267:ininvalid!' ==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.0.0/lib/mixlib/shellout.rb:254:in error!' ==> default: /opt/chef/embedded/apps/chef/lib/chef/mixin/shell_out.rb:50:inshell_out!' ==> default: /opt/chef/embedded/apps/chef/lib/chef/provider/execute.rb:60:in block in action_run' ==> default: /opt/chef/embedded/apps/chef/lib/chef/mixin/why_run.rb:52:incall' ==> default: /opt/chef/embedded/apps/chef/lib/chef/mixin/why_run.rb:52:in add_action' ==> default: /opt/chef/embedded/apps/chef/lib/chef/provider.rb:180:inconverge_by' ==> default: /opt/chef/embedded/apps/chef/lib/chef/provider/execute.rb:59:in action_run' ==> default: /opt/chef/embedded/apps/chef/lib/chef/provider.rb:145:inrun_action' ==> default: /opt/chef/embedded/apps/chef/lib/chef/resource.rb:654:in run_action' ==> default: /opt/chef/embedded/apps/chef/lib/chef/runner.rb:49:inrun_action' ==> default: /opt/chef/embedded/apps/chef/lib/chef/runner.rb:81:in block (2 levels) in converge' ==> default: /opt/chef/embedded/apps/chef/lib/chef/runner.rb:81:ineach' ==> default: /opt/chef/embedded/apps/chef/lib/chef/runner.rb:81:in block in converge' ==> default: /opt/chef/embedded/apps/chef/lib/chef/resource_collection/resource_list.rb:83:inblock in execute_each_resource' ==> default: /opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in call' ==> default: /opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:incall_iterator_block' ==> default: /opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:85:in step' ==> default: /opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:104:initerate' ==> default: /opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:55:in each_with_index' ==> default: /opt/chef/embedded/apps/chef/lib/chef/resource_collection/resource_list.rb:81:inexecute_each_resource' ==> default: /opt/chef/embedded/apps/chef/lib/chef/runner.rb:80:in converge' ==> default: /opt/chef/embedded/apps/chef/lib/chef/client.rb:315:inconverge' ==> default: /opt/chef/embedded/apps/chef/lib/chef/client.rb:400:in block in run' ==> default: /opt/chef/embedded/apps/chef/lib/chef/client.rb:399:incatch' ==> default: /opt/chef/embedded/apps/chef/lib/chef/client.rb:399:in run' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:261:inblock in fork_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:249:in fork' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:249:infork_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:215:in block in run_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/local_mode.rb:38:inwith_server_connectivity' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:201:in run_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:245:inblock in interval_run_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:234:in loop' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:234:ininterval_run_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:224:in run_application' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:58:inrun' ==> default: /opt/chef/embedded/apps/chef/bin/chef-solo:25:in <top (required)>' ==> default: /usr/bin/chef-solo:40:inload' ==> default: /usr/bin/chef-solo:40:in <main>' ==> default: [2014-12-13T19:50:14+00:00] ERROR: Running exception handlers ==> default: [2014-12-13T19:50:14+00:00] ERROR: Exception handlers complete ==> default: [2014-12-13T19:50:14+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out ==> default: [2014-12-13T19:50:14+00:00] DEBUG: Mixlib::ShellOut::ShellCommandFailed: execute[install-setuptools] (python::pip line 48) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '127' ==> default: ---- Begin output of /bin/python ez_setup.py ==> default: ---- ==> default: STDOUT: ==> default: STDERR: sh: 1: /bin/python: not found ==> default: ---- End output of /bin/python ez_setup.py ==> default: ---- ==> default: Ran /bin/python ez_setup.py ==> default: returned 127 ==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.0.0/lib/mixlib/shellout.rb:267:ininvalid!' ==> default: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.0.0/lib/mixlib/shellout.rb:254:in error!' ==> default: /opt/chef/embedded/apps/chef/lib/chef/mixin/shell_out.rb:50:inshell_out!' ==> default: /opt/chef/embedded/apps/chef/lib/chef/provider/execute.rb:60:in block in action_run' ==> default: /opt/chef/embedded/apps/chef/lib/chef/mixin/why_run.rb:52:incall' ==> default: /opt/chef/embedded/apps/chef/lib/chef/mixin/why_run.rb:52:in add_action' ==> default: /opt/chef/embedded/apps/chef/lib/chef/provider.rb:180:inconverge_by' ==> default: /opt/chef/embedded/apps/chef/lib/chef/provider/execute.rb:59:in action_run' ==> default: /opt/chef/embedded/apps/chef/lib/chef/provider.rb:145:inrun_action' ==> default: /opt/chef/embedded/apps/chef/lib/chef/resource.rb:654:in run_action' ==> default: /opt/chef/embedded/apps/chef/lib/chef/runner.rb:49:inrun_action' ==> default: /opt/chef/embedded/apps/chef/lib/chef/runner.rb:81:in block (2 levels) in converge' ==> default: /opt/chef/embedded/apps/chef/lib/chef/runner.rb:81:ineach' ==> default: /opt/chef/embedded/apps/chef/lib/chef/runner.rb:81:in block in converge' ==> default: /opt/chef/embedded/apps/chef/lib/chef/resource_collection/resource_list.rb:83:inblock in execute_each_resource' ==> default: /opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in call' ==> default: /opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:incall_iterator_block' ==> default: /opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:85:in step' ==> default: /opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:104:initerate' ==> default: /opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:55:in each_with_index' ==> default: /opt/chef/embedded/apps/chef/lib/chef/resource_collection/resource_list.rb:81:inexecute_each_resource' ==> default: /opt/chef/embedded/apps/chef/lib/chef/runner.rb:80:in converge' ==> default: /opt/chef/embedded/apps/chef/lib/chef/client.rb:315:inconverge' ==> default: /opt/chef/embedded/apps/chef/lib/chef/client.rb:400:in block in run' ==> default: /opt/chef/embedded/apps/chef/lib/chef/client.rb:399:incatch' ==> default: /opt/chef/embedded/apps/chef/lib/chef/client.rb:399:in run' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:261:inblock in fork_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:249:in fork' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:249:infork_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:215:in block in run_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/local_mode.rb:38:inwith_server_connectivity' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:201:in run_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:245:inblock in interval_run_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:234:in loop' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:234:ininterval_run_chef_client' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:224:in run_application' ==> default: /opt/chef/embedded/apps/chef/lib/chef/application.rb:58:inrun' ==> default: /opt/chef/embedded/apps/chef/bin/chef-solo:25:in <top (required)>' ==> default: /usr/bin/chef-solo:40:inload' ==> default: /usr/bin/chef-solo:40:in `

' ==> default: [2014-12-13T19:50:14+00:00] ERROR: execute[install-setuptools](python::pip line 48) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '127' ==> default: ---- Begin output of /bin/python ez_setup.py ==> default: ---- ==> default: STDOUT: ==> default: STDERR: sh: 1: /bin/python: not found ==> default: ---- End output of /bin/python ez_setup.py ==> default: ---- ==> default: Ran /bin/python ez_setup.py ==> default: returned 127 ==> default: [2014-12-13T19:50:15+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) Chef never successfully completed! Any errors should be visible in the output above. Please fix your recipes so that they properly complete.

cerealkill commented 9 years ago

I had the exact same problem and solved it the same way you did but it sttoped a while later either way. Did yours finished successfully after that?

jknipp commented 9 years ago

Mine finished successfully, what was the following error?

ebollwerk commented 9 years ago

Thank you, thank you jknipp for posting! Had the same issue on OSX Yosemite host today and this worked for me too.

applefreak commented 9 years ago

Can confirm after linking /bin/python, Chef works.

dnmurphy commented 9 years ago

Tried the above nad didn't work. the VM runs, I can SSh and run variious vagrant commands. BUt when I try the http://localhost:8888 it gives me nothing. I do get the following amidst the logging output.

==> default: Checking for guest additions in VM... default: The guest additions on this VM do not match the installed version of default: VirtualBox! In most cases this is fine, but in rare cases it can default: prevent things such as shared folders from working properly. If you see default: shared folder errors, please make sure the guest additions within the default: virtual machine match the version of VirtualBox you have installed on default: your host and reload your VM. default: default: Guest Additions Version: 4.2.0

default: VirtualBox Version: 4.3

It also says the following re the shared folders ==> default: Mounting shared folders... default: /vagrant => /Users/user/Mining-the-Social-Web-2nd-Edition default: /tmp/vagrant-chef-5/chef-solo-1/cookbooks => /Users/user/Mining-the-Social-Web-2nd-Edition/deploy/cookbooks

I have tried closing down the VM and restarting and provisioning but it does the same.

Oh, I am running mountain lion, i haven't dared move to yosemite yet.

theotherjdub commented 9 years ago

@dnmurphy I had the same problem but I was able to resolve it per https://github.com/ptwobrussell/Mining-the-Social-Web-2nd-Edition/wiki/Troubleshooting:-failed-install-of-VM as follows:

vagrant ssh sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions then exit back to your host OS vagrant halt vagrant up --provision

It took a long time to finish the provisioning but after that I could get to http://localhost:8888. Huzzah!

Note: I had already done the sudo ln -s /usr/bin/python /bin/python.

So in total to solve the problem you have to do 2 symlinks and then provision the vm again.

dnmurphy commented 9 years ago

many thanks, I will give this a go.

On Sun, Jan 4, 2015 at 10:20 PM, theotherjdub notifications@github.com wrote:

@dnmurphy https://github.com/dnmurphy I had the same problem but I was able to resolve it per https://github.com/ptwobrussell/Mining-the-Social-Web-2nd-Edition/wiki/Troubleshooting:-failed-install-of-VM as follows:

vagrant ssh sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions then exit back to your host OS vagrant halt vagrant up --provision

It took a long time to finish the provisioning but after that I could get to http://localhost:8888. Huzzah!

— Reply to this email directly or view it on GitHub https://github.com/ptwobrussell/Mining-the-Social-Web-2nd-Edition/issues/243#issuecomment-68652092 .

shibabu commented 9 years ago

For some reason 'vagrant up --provision' didn't work, so I had to keep the vm running without halting on the 2nd attempt and I ran 'vagrant provision' after adding the symlink for python and it worked. Thanks jknipp!

FrugalBoy commented 9 years ago

thank you jknipp!

ptwobrussell commented 9 years ago

It would be easy enough to add the linking command mentioned by @jknipp in the Chef recipe if this is now a recurring problem, but I'm confused as to why this would be necessary if we're all using the same precise64 Vagrant image.

Perhaps the issue isn't so much related to OS X 10.9.5 as it is that the Vagrant image that's referenced in the Vagrantfile at https://github.com/ptwobrussell/Mining-the-Social-Web-2nd-Edition/blob/master/Vagrantfile was updated? It must have been or else the original python binary would be available.

Update: Perhaps the Vagrant box image itself didn't change but apt-get has recently updated where it installs the python binary and the Chef recipe just needs to be updated to look somewhere else.

jknipp commented 9 years ago

@ptwobrussell I've run Ubuntu on my work machine for several years, if memory serves correct, the issue is with the Ubuntu image and how python is installed rather than the OSX host - I remember adding the link on at least one version of Ubuntu in the past.

When I entered this issue I wanted to give us much clarity as possible to my environment it case it was related. Hope that helps.

ptwobrussell commented 9 years ago

@jknipp - very helpful, thanks. I know that the precise64 image used to work (and thousands of people have used it over the past couple of years), so my best guess is that the latest updates that run when you start the image now use a later view of apt-get and perhaps apt-get is now installing python somewhere that it wasn't previously. This really isn't my area of expertise, but I think I have plenty enough info to get a patch in place for the general case. I appreciate your help on this!

On Thu, Jan 15, 2015 at 8:51 AM, Jared Knipp notifications@github.com wrote:

@ptwobrussell https://github.com/ptwobrussell I've run Ubuntu on my work machine for several years, if memory serves correct, the issue is with the Ubuntu image and how python is installed rather than the OSX host - I remember adding the link on at least one version of Ubuntu in the past.

When I entered this issue I wanted to give us much clarity as possible to my environment it case it was related. Hope that helps.

— Reply to this email directly or view it on GitHub https://github.com/ptwobrussell/Mining-the-Social-Web-2nd-Edition/issues/243#issuecomment-70096061 .

jknipp commented 9 years ago

Sure no problem!

I believe this it is related to the fact that both python 2.x and 3.x are installed now, but I don't know that definitively.

Excaliburst commented 9 years ago

Hi guys,

I see the problem installing via my Win7. So it must be Vagrant specific. Chef is not installing correctly.

I get this error... Hmm apparantly I cannot attach a txt file, only picture-files are supported. So I have no way of attaching my command line output during vagrant up...

Thanks Matthew for giving me link to this thread. I will try jknipp's solution and see if it can be done on Win7.

Will Vagrant SSH work? I have Git for Win with SSH feature installed.

ptwobrussell commented 9 years ago

"vagrant ssh" should work if you used the version of git that installed it and added it to your PATH.

On Thu, Jan 15, 2015 at 9:35 AM, Morten Enevoldsen <notifications@github.com

wrote:

Hi guys,

I see the problem installing via my Win7. So it must be Vagrant specific. Chef is not installing correctly.

I get this error... Hmm apparantly I cannot attach a txt file, only picture-files are supported. So I have no way of attaching my command line output during vagrant up...

Thanks Matthew for giving me link to this thread. I will try jknipp's solution and see if it can be done on Win7.

Will Vagrant SSH work? I have Git for Win with SSH feature installed.

— Reply to this email directly or view it on GitHub https://github.com/ptwobrussell/Mining-the-Social-Web-2nd-Edition/issues/243#issuecomment-70103615 .

Excaliburst commented 9 years ago

Hmm - OK. Apparantly Vagrant ssh gives an error saying that I should vagrant up first. And then I see this error:

Directory of Z:\Invest\Git_Repo\Mining-the-Social-Web-2nd-Edition

13-01-2015 22:31

. 13-01-2015 10:14 .. 13-01-2015 10:16 4.167 Vagrantfile 13-01-2015 10:17 ipynb 13-01-2015 10:16 3.312 CONTRIBUTING.md 13-01-2015 10:16 1.855 LICENSE.txt 13-01-2015 10:17 images 13-01-2015 10:16 11.414 README.md 13-01-2015 10:17 662 mtsw2e-requirements.txt 13-01-2015 10:16 deploy 5 File(s) 21.410 bytes 5 Dir(s) 325.603.549.184 bytes free

Z:\Invest\Git_Repo\Mining-the-Social-Web-2nd-Edition>vagrant ssh VM must be running to open SSH connection. Run vagrant up to start the virtual machine.

Z:\Invest\Git_Repo\Mining-the-Social-Web-2nd-Edition>vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Clearing any previously set forwarded ports... ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat ==> default: Forwarding ports... default: 8888 => 8888 (adapter 1) default: 5000 => 5000 (adapter 1) default: 27017 => 27017 (adapter 1) default: 27018 => 27018 (adapter 1) default: 27019 => 27019 (adapter 1) default: 28017 => 28017 (adapter 1) default: 22 => 2222 (adapter 1) ==> default: Running 'pre-boot' VM customizations... ==> default: Booting VM... ==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2222 default: SSH username: vagrant default: SSH auth method: private key default: Warning: Connection timeout. Retrying... ==> default: Machine booted and ready! ==> default: Checking for guest additions in VM... default: The guest additions on this VM do not match the installed version of default: VirtualBox! In most cases this is fine, but in rare cases it can default: prevent things such as shared folders from working properly. If you see default: shared folder errors, please make sure the guest additions within the default: virtual machine match the version of VirtualBox you have installed on default: your host and reload your VM. default: default: Guest Additions Version: 4.2.0 default: VirtualBox Version: 4.3 ==> default: Mounting shared folders... default: /vagrant => Z:/Invest/Git_Repo/Mining-the-Social-Web-2nd-Edition ==> default: Machine already provisioned. Run vagrant provision or use the --provision ==> default: to force provisioning. Provisioners marked to run always will still run.

Z:\Invest\Git_Repo\Mining-the-Social-Web-2nd-Edition>vagrant ssh ssh executable not found in any directories in the %PATH% variable. Is an SSH client installed? Try installing Cygwin, MinGW or Git, all of which contain an SSH client. Or use your favorite SSH client with the following authentication information shown below:

Host: 127.0.0.1 Port: 2222 Username: vagrant Private key: Z:/Invest/Git_Repo/Mining-the-Social-Web-2nd-Edition/.vagrant/machines/default/virtualbox/private_key

Z:\Invest\Git_Repo\Mining-the-Social-Web-2nd-Edition>sudo ln -s /usr/bin/python /bin/python 'sudo' is not recognized as an internal or external command, operable program or batch file.

Z:\Invest\Git_Repo\Mining-the-Social-Web-2nd-Edition>sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /u sr/lib/VBoxGuestAdditions 'sudo' is not recognized as an internal or external command, operable program or batch file.

Z:\Invest\Git_Repo\Mining-the-Social-Web-2nd-Edition>vagrant ssh ssh executable not found in any directories in the %PATH% variable. Is an SSH client installed? Try installing Cygwin, MinGW or Git, all of which contain an SSH client. Or use your favorite SSH client with the following authentication information shown below:

Host: 127.0.0.1 Port: 2222 Username: vagrant Private key: Z:/Invest/Git_Repo/Mining-the-Social-Web-2nd-Edition/.vagrant/machines/default/virtualbox/private_key

Z:\Invest\Git_Repo\Mining-the-Social-Web-2nd-Edition>


Then I try using the BASH from WinGit

Here I get another error: Welcome to Git (version 1.9.5-preview20141217)

Run 'git help git' to display the help index. Run 'git help ' to display help for specific commands.

Morten@TP530 ~ $ sudo ln -s /usr/bin/python /bin/python sh.exe": sudo: command not found

Morten@TP530 ~ $ vagrant ssh VM must be created before running this command. Run vagrant up first.

Morten@TP530 ~ $ sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBo xGuestAdditions sh.exe": sudo: command not found

Morten@TP530 ~ $ vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Box 'base' could not be found. Attempting to find and install... default: Box Provider: virtualbox default: Box Version: >= 0 ==> default: Adding box 'base' (v0) for provider: virtualbox default: Downloading: base default: An error occurred while downloading the remote file. The error message, if any, is reproduced below. Please fix this error and try again.

Couldn't open file /Users/Morten/base

Morten@TP530 ~ $ vagrant ssh VM must be created before running this command. Run vagrant up first.

Morten@TP530 ~ $


Well does anybody have any idea, what is going on? I am at my wits end, but would really like to exploits the great IPython Notebooks in this VM environment.

Thanks

FrugalBoy commented 9 years ago

I am on Win 7 and had the same error, and jknipp's fix worked for me.

Excaliburst commented 9 years ago

From where do you run vagrant ssh? Is it from a command prompt (Win7), or from winGit? I cannot seem to get into any SSH that will accept the symlink command...

ghost commented 9 years ago

Please someone explain in more detail how to fix the problem for win 7, thanks !!

On Fri, Jan 16, 2015 at 4:34 AM, Morten Enevoldsen <notifications@github.com

wrote:

From where do you run vagrant ssh? Is it from a command prompt (Win7), or from winGit? I cannot seem to get into any SSH that will accept the symlink command...

— Reply to this email directly or view it on GitHub https://github.com/ptwobrussell/Mining-the-Social-Web-2nd-Edition/issues/243#issuecomment-70228949 .

jknipp commented 9 years ago

@Excaliburst you would run vagrant ssh after vagrant up / vagrant provision, this would be from your 'terminal' / windows shell. This then creates the ssh connection to the VM. You will have to connect to the VM before you can run the sudo link command.

It's been a minute since I've worked on Win7, you might try Cygwin or even Putty. You will have to run vagrant ssh in the same directory as your project if you use one of the *nix shells.

Let me know if you need more help.

thankins commented 9 years ago

I'm not having any luck with these steps. After creating the symbolic links (both @jknipp's python, and @theotherjdub's VBoxGuestAdditions) I'm still getting

shared folders that chef requires are missing on the virtual machine. this is usually due to configuration changing after already booting the machine. the fix is to run a vagrant reload so that the proper shared folders will be prepared and mounted on the vm.

Yes. I tried 'vagrant reload'. Any ideas...?

My environment is OS X Yosemite Vagrant 1.7.2 VirtualBox 4.3.20

jknipp commented 9 years ago

@thankins you might try to do the following vagrant destroy git checkout . git pull vagrant up

Basically remove the existing vm, reset back to an initial state, and retry, I think the above will do that.

thankins commented 9 years ago

Thanks @jknipp! I don't know whether it was the reset, or the fact that I cloned to a different directory, but it's working.

peterrcook commented 9 years ago

This has worked for me too - thanks @jknipp.

I could see

    /bin/python: not found

in the vagrant output. I ssh'd in and set up the link as @jknipp suggested. I also had to use:

    vagrant reload
    vagrant provision

and it's now working!

@ptwobrussell very excited about working through the notebook examples! I think using Vagrant is a great idea and I expect its benefits will outweigh the occasional teething issue.

ncrockett commented 9 years ago

I'm able to ssh into the VM using vagrant and add the python symbolic link mentioned above. However, when I run vagrant provision (after running vagrant halt and vagrant up to reload things) I still get the message below. I've also tried vagrant reload then vagrant provision, but the outcome is the same. For some reason there are missing files on my VM that Chef requires but I have no idea what those files are because no additional output is given. Is anyone else experiencing this issue? I've destroyed the VM many times now and deleted and re-cloned the repository to no avail. I've even tried using older builds of VirtualBox (from 4.2) but the result is always the same. I'm on a macbook pro running OS X Yosemite (10.10.1).

==> default: Running provisioner: chef_solo... ==> default: Detected Chef (latest) is already installed Shared folders that Chef requires are missing on the virtual machine. This is usually due to configuration changing after already booting the machine. The fix is to run a vagrant reload so that the proper shared folders will be prepared and mounted on the VM.

PhyllisZimblerMiller commented 9 years ago

I ran into the same problem as @jknipp. I entered his solution: vagrant ssh and then sudo ln -s /usr/bin/python /bin/python

All's well, then I enter vagrant provision and get this message:

The program 'vagrant' is currently not installed. You can install it by typing: sudo apt-get install vagrant

Mind you, I'm currently in vagrant ssh so clearly vagrant is installed.

I have done vagrant destroy and vagrant up and I run into the same problem. I once again tried the solution and get the same message.

peterrcook commented 9 years ago

@PhyllisZimblerMiller I think you need to exit out of ssh and get back into your host command line.

PhyllisZimblerMiller commented 9 years ago

@prcweb You mean exit vagrant ssh when I destroy and up? I did that.

jknipp commented 9 years ago

@PhyllisZimblerMiller sounds like you were ssh'd into the vm with vagrant ssh. You will need to exit out so you are back in the git repo directory.

PhyllisZimblerMiller commented 9 years ago

@jknipp Exit out for which commands?

peterrcook commented 9 years ago

@PhyllisZimblerMiller I typed something like:

    vagrant ssh
    sudo ln -s /usr/bin/python /bin/python
    exit

    vagrant reload
    vagrant provision

The first three commands are in the virtual machine, whilst the latter two are in your own host machine.

jknipp commented 9 years ago

@PhyllisZimblerMiller exactly as @prcweb suggests, I couldn't type it fast enough :)

PhyllisZimblerMiller commented 9 years ago

@jknipp @prcweb

This time I did so and got this message:

==> default: Running provisioner: chef_solo... ==> default: Detected Chef (latest) is already installed Shared folders that Chef requires are missing on the virtual machine. This is usually due to configuration changing after already booting the machine. The fix is to run a vagrant reload so that the proper shared folders will be prepared and mounted on the VM.

Is it installed or not? Also, I don't understand the message as I just ran vagrant reload

yaelkmiller commented 9 years ago

Windows 7 64-bit. Wireless connection

How I solved this problem on my computer: Switched over from command line tool to git bash and ran the code from @jknipp @prcweb solution

Please note that it took over an hour for it to finish. I don't know exactly how long because I went out for dinner.

Excaliburst commented 9 years ago

I see the same problem as Phyllis.

Start SSHing into virtualbox, 127.0.01:2222 (used PuTTY for this). to do the link update sudo ln -s /usr/bin/python /bin/python

And then to the local Command prompt: vagrant up (runs a lot of commands, but ends in this error) ==> default: Machine already provisioned. Run vagrant provision or use the --provision ==> default: to force provisioning. Provisioners marked to run always will still run.

So I run Z:\python\Git_Repo\Mining-the-Social-Web-2nd-Edition>vagrant provision ==> default: Running provisioner: chef_solo... ==> default: Detected Chef (latest) is already installed Shared folders that Chef requires are missing on the virtual machine. This is usually due to configuration changing after already booting the machine. The fix is to run a vagrant reload so that the proper shared folders will be prepared and mounted on the VM.

So I run Z:\python\Git_Repo\Mining-the-Social-Web-2nd-Edition>vagrant reload ==> default: Attempting graceful shutdown of VM... ==> default: Clearing any previously set forwarded ports... ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat ==> default: Forwarding ports... default: 8888 => 8888 (adapter 1) default: 5000 => 5000 (adapter 1) default: 27017 => 27017 (adapter 1) default: 27018 => 27018 (adapter 1) default: 27019 => 27019 (adapter 1) default: 28017 => 28017 (adapter 1) default: 22 => 2222 (adapter 1) ==> default: Running 'pre-boot' VM customizations... ==> default: Booting VM... ==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2222 default: SSH username: vagrant default: SSH auth method: private key default: Warning: Connection timeout. Retrying... ==> default: Machine booted and ready! ==> default: Checking for guest additions in VM... default: The guest additions on this VM do not match the installed version of default: VirtualBox! In most cases this is fine, but in rare cases it can default: prevent things such as shared folders from working properly. If you see default: shared folder errors, please make sure the guest additions within the default: virtual machine match the version of VirtualBox you have installed on default: your host and reload your VM. default: default: Guest Additions Version: 4.2.0 default: VirtualBox Version: 4.3 ==> default: Mounting shared folders... default: /vagrant => Z:/python/Git_Repo/Mining-the-Social-Web-2nd-Edition ==> default: Machine already provisioned. Run vagrant provision or use the --provision ==> default: to force provisioning. Provisioners marked to run always will still run.

And I am back to square one. Running in circles here.... Any thoughts?

mikekoliha commented 9 years ago

I have having the same issue as Excaliburst above. Running around in circles without getting any results. I am on Windows 7 Pro - 64 bit install.

ghost commented 9 years ago

How can I apply the solution on windows ? I read a lot of mac solutions that I even help some one to do it on mac, but can´t help my self. Can you do a step by step explanation for dummies, for installing on win 7, Thank you :) !!

manusharma50 commented 9 years ago

Have to concur with the other Windows 7 users (and I have a similar config on the Win 7 OS + VirtualBox/Vagrant versions) who are stuck at square one... no matter what I try, I cannot get my virtual machine to work and keep getting the same errors as mentioned multiple times earlier in this thread. I don't see any obvious issues with my BIOS virtualization settings or admin access either. I would certainly like to use the IPython notebook, so would appreciate any help whatsoever. Thanks!

ghost commented 9 years ago

@manusharma50 If you really want to use the IPython notebook, install ubuntu or deepin on your machine. I have both ubuntu and windows 7 and have to say in ubuntu was really easy to install, I was surprise in discover this OS, no errors no modifications need it.

dan-king commented 9 years ago

I finally got it to work by uninstalling vagrant 1.7.2 and installing 1.7.1 instead.

Cornellio commented 9 years ago

Same here. I finally got it working with the VMWare provider thanks to all the help in this thread by downgrading Vagrant.

vybstat commented 9 years ago

Thank you @jknipp. That worked for me.

manusharma50 commented 9 years ago

Thank you, all! Downgrading to Vagrant 1.7.1 worked for me as well. Config: Windows 7, VirtualBox 4.3.20, Vagrant 1.7.1

ghost commented 9 years ago

Works fine after a few hours, thanks to @jknipp and @prcweb ...

jlargentaye commented 9 years ago

@ptwobrussell

I just helped another user (my brother...) debug this problem. Having used Debian/Ubuntu for over a decade, and as far as I remember Python has always been in /usr/bin. Making the symlink is a workaround, but doesn't address the root cause.

I think the issue is instead in the interaction between the (old-ish) recipes copied into deploy/cookbooks in this repo, and recent versions of Vagrant and/or Chef.

If you check the attributes file deploy/cookbooks/python/attributes/default.rb, you'll find that it correctly specifies /usr/bin as the default prefix for the Python binary (lines 28 and 34). However when executing "vagrant up", it tries /bin/python, lacking the /usr prefix. While it doesn't show up in the logdump provided by jknipp (or one I tried copying in myself, I suspect Markdown formatting quirks), the log actually has three spaces between "of" and "/bin/" in Begin output of /bin/python ez_setup.py. I think that's a hint that some template filling didn't work in the recipe->vagrant->chef chain.

Unfortunately, I don't know Vagrant, Chef, or even Ruby, but hopefully these pointers can help someone more intimate with those tools find the actual bug.

astrego commented 9 years ago

After about 50 tries, I finally got it working with vagrant 1.7.0 with help from this post. First I did vagrant up. Got the error with the directories. Then: vagrant ssh sudo ln -s /usr/bin/python /bin/python sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions logout vagrant provision

OSX 10.9.5

quarkRain commented 9 years ago

Thanks everyone for the posts. Downgrading to Vagrant 1.7.1 fixed it for me (Win 8).

@ptwobrussell - it took quite some effort/time to find this post and then fix the whole issue. It's great that you wanted to use this approach of a Vagrant VM and Py Notebooks but the number of people having issues is evidence that there's a need for a better solution. The brilliant scientist that you are, I'm hopeful you'll come up with something so more people don't have to go through this especially while getting started :)

PS - I commend (and thank) you for trying this approach compared to the old ways.

hugokoopmans commented 9 years ago

on linux mint 17 i can confirm this works First I did vagrant up. Got the error with the directories. Then: vagrant ssh sudo ln -s /usr/bin/python /bin/python logout vagrant provision

marco-ortega commented 9 years ago

Hi I have tried many times on Win 7 (32bits) but It's doesn't work. I follow all the steps suggest by @jknipp and @prcweb

sudo ln -s /usr/bin/python /bin/python sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions vagrant provision

But it doesn't fix the problem.

After VM created, I see "/usr/bin/python" doesn't exist (or was not created) and the VM install (or have) "/opt/VBoxGuestAdditions-4.2.0" not "VBoxGuestAdditions-4.3.10".

Environment: Win 7 (32bits) - Vagrant 1.7.1 - VirtualBox 4.3.20

marco-ortega commented 9 years ago

Hi It seems now the problem is with the recipes (mtsw2e). I'm using Win7 + Vagrant 1.7.1 + VirtualBox 4.3.20. Please any help This is the error ==> default: [2015-03-13T14:04:03+00:00] INFO: Running queued delayed notificati ons before re-raising exception ==> default: [2015-03-13T14:04:03+00:00] ERROR: Converge failed with error messa ge apt_repositorymongodb-10gen had an error: Mixlib:: ShellOut::ShellCommandFailed: executeinstall-key 7F0CEB10 had an error: Mixlib ::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2' ==> default: ---- Begin output of apt-key adv --keyserver keyserver.ubuntu.com - -recv 7F0CEB10 ---- ==> default: STDOUT: Executing: gpg --ignore-time-conflict --no-options --no-def ault-keyring --secret-keyring /tmp/tmp.vFhiOeb1q4 --trustdb-name /etc/apt/trustd b.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --ke yserver keyserver.ubuntu.com --recv 7F0CEB10 ==> default: STDERR: gpg: requesting key 7F0CEB10 from hkp server keyserver.ubun tu.com ==> default: gpg: keyserver timed out ==> default: gpg: keyserver receive failed: keyserver error ==> default: ---- End output of apt-key adv --keyserver keyserver.ubuntu.com --r ecv 7F0CEB10 ---- ==> default: Ran apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 re turned 2 ==> default: [2015-03-13T14:04:03+00:00] DEBUG: Re-raising exception: Chef::Exce ptions::RunFailedWrappingError - Found 1 errors, they are stored in the backtrac e ==> default: 1) Mixlib::ShellOut::ShellCommandFailed - apt_repositorymongodb-1 0gen had an error: Mixlib::ShellOut::ShellCommandFaile d: executeinstall-key 7F0CEB10 had an error: Mixlib::ShellOut::ShellCommandFai led: Expected process to exit with [0], but received '2' ==> default: ---- Begin output of apt-key adv --keyserver keyserver.ubuntu.com - -recv 7F0CEB10 ---- ==> default: STDOUT: Executing: gpg --ignore-time-conflict --no-options --no-def ault-keyring --secret-keyring /tmp/tmp.vFhiOeb1q4 --trustdb-name /etc/apt/trustd b.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --ke yserver keyserver.ubuntu.com --recv 7F0CEB10 ==> default: STDERR: gpg: requesting key 7F0CEB10 from hkp server keyserver.ubun tu.com ==> default: gpg: keyserver timed out ==> default: gpg: keyserver receive failed: keyserver error ==> default: ---- End output of apt-key adv --keyserver keyserver.ubuntu.com --r ecv 7F0CEB10 ----

==> default: /usr/bin/chef-solo:52:in load' ==> default: /usr/bin/chef-solo:52:in' ==> default: ==> default: [2015-03-13T14:04:03+00:00] ERROR: Running exception handlers ==> default: [2015-03-13T14:04:03+00:00] ERROR: Exception handlers complete ==> default: [2015-03-13T14:04:03+00:00] FATAL: Stacktrace dumped to /var/chef/c ache/chef-stacktrace.out ==> default: [2015-03-13T14:04:03+00:00] DEBUG: Chef::Exceptions::RunFailedWrapp ingError: Found 1 errors, they are stored in the backtrace ==> default: 1) Mixlib::ShellOut::ShellCommandFailed - apt_repositorymongodb-1 0gen had an error: Mixlib::ShellOut::ShellCommandFaile d: executeinstall-key 7F0CEB10 had an error: Mixlib::ShellOut::ShellCommandFai led: Expected process to exit with [0], but received '2'

==> default: /usr/bin/chef-solo:52:in load' ==> default: /usr/bin/chef-solo:52:in' ==> default: [2015-03-13T14:04:03+00:00] ERROR: Found 1 errors, they are stored in the backtrace ==> default: [2015-03-13T14:04:03+00:00] FATAL: Chef::Exceptions::ChildConvergeE rror: Chef run process exited unsuccessfully (exit code 1) Chef never successfully completed! Any errors should be visible in the output above. Please fix your recipes so that they properly complete.