Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual Machine installation failed: Chef run process exited unsuccessfully (exit code 1) because of undefined method 'python' #325

Closed
nicolatournay opened this issue May 25, 2017 · 11 comments

Comments

@nicolatournay
Copy link

Hello, I failed at installing the virtual machine. I thing it has to do with this undefined method 'python' but I don't know how to solve this issue on my own since I know little about programming. Can someone please help me? I would be immensely grateful.
PS: I followed every previous step carefully, and I'm using Windows 10, 64bit
=================================================================== ==> default: Recipe Compile Error in /var/chef/cache/cookbooks/python/attributes/default.rb ==> default: =================================================================== ==> default: ==> default: NoMethodError ==> default: ------------- ==> default: undefined method python' for #Chef::Node::Attribute:0x00000003337a90
==> default:
==> default: Cookbook Trace:
==> default: ---------------
==> default: /var/chef/cache/cookbooks/python/attributes/default.rb:23:in from_file' ==> default: ==> default: Relevant File Content: ==> default: ---------------------- ==> default: /var/chef/cache/cookbooks/python/attributes/default.rb: ==> default: ==> default: 16: # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ==> default: 17: # See the License for the specific language governing permissions and ==> default: 18: # limitations under the License. ==> default: 19: # ==> default: 20: ==> default: 21: default['python']['install_method'] = 'package' ==> default: 22: ==> default: 23>> if python['install_method'] == 'package' ==> default: 24: case platform ==> default: 25: when "smartos" ==> default: 26: default['python']['prefix_dir'] = '/opt/local' ==> default: 27: else ==> default: 28: default['python']['prefix_dir'] = '/usr' ==> default: 29: end ==> default: 30: else ==> default: 31: default['python']['prefix_dir'] = '/usr/local' ==> default: 32: end ==> default: System Info: ==> default: ------------ ==> default: chef_version=13.0.118 ==> default: platform=ubuntu ==> default: platform_version=12.04 ==> default: ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux] ==> default: program_name=chef-solo worker: ppid=1299;start=14:36:10; ==> default: executable=/opt/chef/bin/chef-solo ==> default: [2017-05-25T14:36:26+00:00] DEBUG: Re-raising exception: NoMethodError - undefined method python' for #Chef::Node::Attribute:0x00000003337a90
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/node.rb:267:in public_send' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/node.rb:267:in method_missing'
==> default: /var/chef/cache/cookbooks/python/attributes/default.rb:23:in from_file' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/mixin/from_file.rb:30:in instance_eval'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/mixin/from_file.rb:30:in from_file' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/dsl/include_attribute.rb:39:in block in include_attribute'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/dsl/include_attribute.rb:31:in each' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/dsl/include_attribute.rb:31:in include_attribute'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/run_context/cookbook_compiler.rb:213:in load_attribute_file' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/run_context/cookbook_compiler.rb:202:in load_attributes_from_cookbook'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/run_context/cookbook_compiler.rb:132:in block in compile_attributes' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/run_context/cookbook_compiler.rb:131:in each'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/run_context/cookbook_compiler.rb:131:in compile_attributes' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/run_context/cookbook_compiler.rb:74:in compile'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/run_context.rb:187:in load' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/policy_builder/expand_node_object.rb:97:in setup_run_context'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/client.rb:513:in setup_run_context' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/client.rb:281:in run'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application.rb:291:in block in fork_chef_client' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application.rb:279:in fork'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application.rb:279:in fork_chef_client' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application.rb:244:in block in run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/local_mode.rb:44:in with_server_connectivity' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application.rb:232:in run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application/client.rb:464:in sleep_then_run_chef_client' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application/client.rb:451:in block in interval_run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application/client.rb:450:in loop' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application/client.rb:450:in interval_run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application/client.rb:434:in run_application' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application.rb:59:in run'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application/solo.rb:225:in run' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/bin/chef-solo:25:in <top (required)>'
==> default: /usr/bin/chef-solo:58:in load' ==> default: /usr/bin/chef-solo:58:in

'
==> default:
==> default: Running handlers:
==> default: [2017-05-25T14:36:26+00:00] ERROR: Running exception handlers
==> default: Running handlers complete
==> default: [2017-05-25T14:36:26+00:00] ERROR: Exception handlers complete
==> default: Chef Client failed. 0 resources updated in 15 seconds
==> default: [2017-05-25T14:36:26+00:00] DEBUG: Server doesn't support resource history, skipping resource report.
==> default: [2017-05-25T14:36:26+00:00] DEBUG: Audit Reports are disabled. Skipping sending reports.
==> default: [2017-05-25T14:36:26+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> default: [2017-05-25T14:36:26+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
==> default: [2017-05-25T14:36:26+00:00] DEBUG: NoMethodError: undefined method python' for #<Chef::Node::Attribute:0x00000003337a90> ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/node.rb:267:in public_send'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/node.rb:267:in method_missing' ==> default: /var/chef/cache/cookbooks/python/attributes/default.rb:23:in from_file'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/mixin/from_file.rb:30:in instance_eval' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/mixin/from_file.rb:30:in from_file'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/dsl/include_attribute.rb:39:in block in include_attribute' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/dsl/include_attribute.rb:31:in each'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/dsl/include_attribute.rb:31:in include_attribute' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/run_context/cookbook_compiler.rb:213:in load_attribute_file'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/run_context/cookbook_compiler.rb:202:in load_attributes_from_cookbook' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/run_context/cookbook_compiler.rb:132:in block in compile_attributes'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/run_context/cookbook_compiler.rb:131:in each' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/run_context/cookbook_compiler.rb:131:in compile_attributes'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/run_context/cookbook_compiler.rb:74:in compile' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/run_context.rb:187:in load'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/policy_builder/expand_node_object.rb:97:in setup_run_context' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/client.rb:513:in setup_run_context'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/client.rb:281:in run' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application.rb:291:in block in fork_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application.rb:279:in fork' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application.rb:279:in fork_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application.rb:244:in block in run_chef_client' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/local_mode.rb:44:in with_server_connectivity'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application.rb:232:in run_chef_client' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application/client.rb:464:in sleep_then_run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application/client.rb:451:in block in interval_run_chef_client' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application/client.rb:450:in loop'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application/client.rb:450:in interval_run_chef_client' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application/client.rb:434:in run_application'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application.rb:59:in run' ==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/application/solo.rb:225:in run'
==> default: /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/bin/chef-solo:25:in <top (required)>' ==> default: /usr/bin/chef-solo:58:in load'
==> default: /usr/bin/chef-solo:58:in <main>' ==> default: [2017-05-25T14:36:26+00:00] ERROR: undefined method python' for #Chef::Node::Attribute:0x00000003337a90
==> default: [2017-05-25T14:36:26+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.
`

@petzi53
Copy link

petzi53 commented May 27, 2017

I have exactly the same error:

==> default: [2017-05-27T08:31:02+00:00] ERROR: undefined method `python' for #Chef::Node::Attribute:0x00000003bda7b0
==> default: [2017-05-27T08:31:02+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.`

During the processing of the command vagrant up I got several times messages that there is a problem with the guest additions version:

[default] GuestAdditions versions on your host (5.1.22) and guest (4.2.0) do not match.

Installing Virtualbox Guest Additions 5.1.22 - guest version is 4.2.0

An error occurred during installation of VirtualBox Guest Additions 5.1.22. Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.

Could not find the X.Org or XFree86 Window System, skipping.
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims: 4.2.0
VBoxService inside the vm claims: 5.1.22
Going on, assuming VBoxService is correct...
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims: 4.2.0
VBoxService inside the vm claims: 5.1.22
Going on, assuming VBoxService is correct...
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims: 4.2.0
VBoxService inside the vm claims: 5.1.22
Going on, assuming VBoxService is correct...
Restarting VM to apply changes...

All these messages above appear before Running chef-solo...


  • I am trying to use the virtual machine and followed the instruction in Appendix A.
  • I am using: MacOS Sierra 10.12.5
  • I have installed: Vagrant 1.9.5 and VirtualBox 5.1.22r115126

@rreben
Copy link

rreben commented May 28, 2017

With the current version of Chef (13.x), Chef will not tolerate some form of syntax. This lead to the compile errors in the skripts. As a quick fix force vagrant to use an older version of Chef (12.9.x).

Do so with adding the following:

config.vm.provision :chef_solo do |chef|
chef.version = '12.19.36'
      chef.json = ...

See rreben/basket4py#1 for more details.

@nicolatournay
Copy link
Author

Thank you for your prompt reply.
I copy-pasted the above lines of code, however it didn't work very well.

`User ~/Mining-the-Social-Web-2nd-Edition (master)
$ config.vm.provision :chef_solo do |chef|

chef.version = '12.19.36'
chef.json = ...bash: config.vm.provision: command not found
bash: chef: command not found
bash: chef.version: command not found

User ~/Mining-the-Social-Web-2nd-Edition (master)
$ chef.json = ...
bash: chef.json: command not found
`
As you can see, the command is not found. I am very new to Git Bash and programming in general so I guess I did something wrong but I can't tell what.

@rreben
Copy link

rreben commented May 30, 2017

Hm, I guess somehow you made a mistake in the vagrant file.

Post your vagrant file here.

You can also use the basket4py project, install this, copy the notebooks and insall twitter via pip. The procedure is in #317

@nicolatournay
Copy link
Author

Here is the content of my vagrant file. I can read in it that my chef_version = "11.6.0" thus I think I don't need to use an older version of the Chef finally. I will try the basket4py project even though it seems to be even more complicated. Better than doing nothing.

-- mode: ruby --

vi: set ft=ruby :

###########################################################################

This configuration file is the starting point for understanding how the

virtual machine is configured and provides a default provider that uses

Virtualbox to provide virtualization. It also contains an experimental

provider for using an AWS EC2 microinstance in the cloud. The AWS provider

works but is a bit bleeding edge and incomplete from the standpoint of

providing all of the functionality that it should at this time, so it should

only be used by hackers who are comfortable working in the cloud. After

filling in the necessary AWS credentials below use the --provider=aws

option to use the AWS provider. See https://github.com/mitchellh/vagrant-aws

for more details.

See http://docs.vagrantup.com/v2/vagrantfile/index.html for additional

details on Vagrantfile configuration in general.

###########################################################################

Vagrant.configure("2") do |config|

SSH forwarding: See https://help.github.com/articles/using-ssh-agent-forwarding

config.ssh.forward_agent = true

#########################################################################

Virtualbox configuration - the default provider for running a local VM

#########################################################################

config.vm.provider :virtualbox do |vb, override|

# The Virtualbox image
override.vm.box = "precise64"
override.vm.box_url = "http://files.vagrantup.com/precise64.box"

# Port forwarding details

# Note: Unfortunately, port forwarding currently is not implemented for
# the AWS provider plugin, so you'll need to manually open them through the 
# AWS console or with the EC2 CLI tools. (It would be possible to do it
# all through an additional Chef recipe that runs as part of MTSW2E, but
# just isn't implemented yet.) Only port 8888 is essential
# to initially access IPython Notebook and get started.

# IPython Notebook
override.vm.network :forwarded_port, host: 8888, guest: 8888

# Flask
override.vm.network :forwarded_port, host: 5000, guest: 5000

# MongoDB
override.vm.network :forwarded_port, host: 27017, guest: 27017
override.vm.network :forwarded_port, host: 27018, guest: 27018
override.vm.network :forwarded_port, host: 27019, guest: 27019
override.vm.network :forwarded_port, host: 28017, guest: 28017

# You can increase the default amount of memory used by your VM by
# adjusting this value below (in MB) and reprovisioning.
vb.customize ["modifyvm", :id, "--memory", "384"]

end

#########################################################################

AWS configuration - an experimental provider for running this VM in the

cloud. See https://github.com/mitchellh/vagrant-aws for configuration

details. User specific values for your own environment are referenced

here as MTSW_ environment variables that you could set (or hard code.)

#########################################################################

config.vm.provider :aws do |aws, override|
aws.access_key_id = ENV['MTSW_AWS_ACCESS_KEY_ID']
aws.secret_access_key = ENV['MTSW_AWS_SECRET_ACCESS_KEY']
aws.keypair_name = ENV['MTSW_KEYPAIR_NAME']

# A Precise64 Ubuntu image that will run as a microinstance in the
# region specified
aws.ami = "ami-fb68f8cb" 
aws.region = "us-west-2"
aws.instance_type = "t1.micro"

override.vm.box = "aws"
override.ssh.username = "ubuntu"
override.ssh.private_key_path = ENV['MTSW_KEYPAIR_PATH']

# "vagrant plugin install omnibus" to get Chef-Solo on vanilla AMI
override.omnibus.chef_version = "11.6.0"

end

Chef-Solo provisioning

config.vm.provision :chef_solo do |chef|
chef.log_level = :debug
chef.cookbooks_path = "deploy/cookbooks"
chef.json = {
:answer => "42",
}
chef.run_list = [
"recipe[mtsw2e::default]"
]
end

end

@rreben
Copy link

rreben commented Jun 2, 2017

Yes please try basket4py. The chef recipes in this https://github.com/ptwobrussell/Mining-the-Social-Web-2nd-Edition repo are completely outdated. Unfortunately there isn't any development in this repo, so I can't change them via pull request. ...
That was one of the reasons for starting basket4py

@nicolatournay
Copy link
Author

Hello, I have exactly the same problem with basket4py.

Following the instructions, I donwloaded the repo, I did a vagrant up then a vagrant provision, and now I am stuck again with more or less the same error message:
==> default: [2017-06-06T13:32:12+00:00] ERROR: undefined method python' for #<Chef::Node::Attribute:0x00000003e7b370> ==> default: [2017-06-06T13:32:12+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.

Needless to say I can't access to the Jupyter system and add the Twitter framework.

Thx @zyx954 for this instruction:
Go to https://github.com/rreben/basket4py
Download this repo
do a vagrant up (just like you did with the other two repos (original and fork)
...

With the other two repos? It is maybe the source of my bad luck: before doing the basket4py stuff, I remember having cloned only one repo git@github.com:ptwobrussell/Mining-the-Social-Web-2nd-Edition.git from here: https://github.com/ptwobrussell/Mining-the-Social-Web-2nd-Edition

@rreben
Copy link

rreben commented Jun 7, 2017

So basket4py is working now for you?

@nicolatournay
Copy link
Author

No.

@nicolatournay nicolatournay reopened this Jun 7, 2017
@rreben
Copy link

rreben commented Jun 7, 2017

That's too bad. The error message hints at the problem, that you are using chef 13.x (so are you sure you are using the vagrantfile from basket4py (not from Mining-the-Social-Web...)

Please do a vagrant destroy then start from scratch with basket4py. Try to get the sample notebook working before trying things from Mining-the-Social-Web...

@nicolatournay
Copy link
Author

Okay. Thank you for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants