Can't find external cookbooks, Vagrant with Chef Solo - vagrant

I inherited a project that hasn’t been deployed in a couple of years. It was originally set-up for local deployment on a Vagrant machine using Chef.
When I run the the vagrant up command, I get an error that it is not finding some cookbooks. First it was not finding cookbooks in the cookbooks directory specified in the Vagrantfile. I fixed this by adding a metadata.rb file to the cookbook i was trying to run. It looks like
#cookbooks/app/metadata.rb
depends "openssl" # this is in the cookbooks directory
depends "build-essential" # this in the cookbooks directory
depends "git" # this in the cookbooks directory
Now when I run vagrant up it breaks in the git cookbook because it cannot find one of it’s dependencies, dmg (which I don’t even need).
So how do I install these cookbooks dependencies so that it will run. Should these cookbooks be installed on my host machine (i.e. my Mac which hosts the Vagrant box) or on the Vagrant itself.
I have downloaded the ChefDK and have Berkshelf but am not sure how to use it on and existing project. Also based on the solo.rb file it looks like it is looking for cookbooks in /etc/chef/cookbooks.
# solo.rb
log_level :info
cookbook_path "/etc/chef/cookbooks"
json_attribs "/etc/chef/cookbooks/node_staging.json"
role_path "/etc/chef/roles"
Here is sample output from running vagrant up.
==> default: Running chef-solo...
==> default: stdin: is not a tty
==> default: [2015-11-30T19:46:31+00:00] INFO: Forking chef instance to converge...
==> default: [2015-11-30T19:46:31+00:00] WARN:
==> default: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
==> default: SSL validation of HTTPS requests is disabled. HTTPS connections are still
==> default: encrypted, but chef is not able to detect forged replies or man in the middle
==> default: attacks.
==> default:
==> default: To fix this issue add an entry like this to your configuration file:
==> default:
==> default: ```
==> default: # Verify all HTTPS connections (recommended)
==> default: ssl_verify_mode :verify_peer
==> default:
==> default: # OR, Verify only connections to chef-server
==> default: verify_api_cert true
==> default: ```
==> default:
==> default: To check your SSL configuration, or troubleshoot errors, you can use the
==> default: `knife ssl check` command like so:
==> default:
==> default: ```
==> default: knife ssl check -c /tmp/vagrant-chef/solo.rb
==> default: ```
==> default:
==> default: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
==> default: Starting Chef Client, version 11.18.12
==> default: [2015-11-30T19:46:31+00:00] INFO: *** Chef 11.18.12 ***
==> default: [2015-11-30T19:46:31+00:00] INFO: Chef-client pid: 1844
==> default: [2015-11-30T19:46:32+00:00] INFO: Setting the run_list to ["role[vagrant]"] from CLI options
==> default: [2015-11-30T19:46:32+00:00] INFO: Run List is [role[vagrant]]
==> default: [2015-11-30T19:46:32+00:00] INFO: Run List expands to [app::default]
==> default: [2015-11-30T19:46:32+00:00] INFO: Starting Chef Run for geosurvey
==> default: [2015-11-30T19:46:32+00:00] INFO: Running start handlers
==> default: [2015-11-30T19:46:32+00:00] INFO: Start handlers complete.
==> default: Compiling Cookbooks...
==> default:
==> default: Running handlers:
==> default: [2015-11-30T19:46:32+00:00] ERROR: Running exception handlers
==> default: Running handlers complete
==> default:
==> default: [2015-11-30T19:46:32+00:00] ERROR: Exception handlers complete
==> default: [2015-11-30T19:46:32+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> default: Chef Client failed. 0 resources updated in 1.06392657 seconds
==> default: [2015-11-30T19:46:32+00:00] ERROR: Cookbook dmg not found. If you're loading dmg from another cookbook, make sure you configure the dependency in your metadata
==> default: [2015-11-30T19:46:32+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.

Vagrant on its own doesn't support Berkshelf integration. There is a plugin available for it (vagrant-berkshelf) which will pull in dependencies and sync them to the VM, but it isn't recommended given that it can be a bit flaky. Test Kitchen (with kitchen-vagrant) is generally easier. You can also do it manually by using the berks vendor command to download the deps and dump them into a folder structure chef-solo can use.

I have similar problems and managed to solved them party.
Installing vagrant berkshelf plugin solves it party. As I understand one has to go through each cookbook and type barks install appart from configuring vagrant barkshelf like this:
config.berkshelf.enabled = true
config.berkshelf.berksfile_path = "./cookbooks/database/Berksfile"
But I'm exploring this vendor solution that didn't work quite well.
As far I understand to coderanger if I had a a directory named "./cookbooks-source" and within have a bunch of cookbooks (cb1, cb2, cb3, ...) I would have to iterate each of them and type something like
berks vendor ../../cookbooks
but then each of these cookbooks dependencies might conflict with each other ? Plus I find it quite inconvenient. Also exploring berks package but just don't know how to hook it up to vagrant.

Related

Can't connect to MiniKF landing page on http://10.10.10.10 after installing MiniKF

I am trying to run an example machine learning pipeline on premise (meaning: locally on a Windows 10 laptop) using MiniKF and Kubeflow Pipelines, following this tutorial, but I can't reach the site that should appear at http://10.10.10.10.
I installed:
Virtualbox 6.1.4
Vagrant 2.2.7
Then, in a CMD prompt, I ran:
C:\Users\jervan\Documents\minikf>vagrant init arrikto/minikf
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
C:\Users\jervan\Documents\minikf>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Using C:/Users/jervan/Documents/minikf/minikf-user-data.vdi for persistent storage.
==> default: Importing base box 'arrikto/minikf'...
==> default: Generating MAC address for NAT networking...
==> default: Using C:/Users/jervan/Documents/minikf/minikf-user-data.vdi for persistent storage.
==> default: Checking if box 'arrikto/minikf' version '20200305.1.0' is up to date...
==> default: Setting the name of the VM: minikf_default_1584993248035_85721
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 32123 (guest) => 32123 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Using C:/Users/jervan/Documents/minikf/minikf-user-data.vdi for persistent storage.
==> default: Running 'pre-boot' VM customizations...
==> default: Using C:/Users/jervan/Documents/minikf/minikf-user-data.vdi for persistent storage.
==> default: ** Creating persistent storage **
==> default: Using C:/Users/jervan/Documents/minikf/minikf-user-data.vdi for persistent storage.
==> default: ** Attaching persistent storage **
==> 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 reset. Retrying...
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> 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: 6.0.14_Ubuntu r132055
default: VirtualBox Version: 6.1
==> default: Using C:/Users/jervan/Documents/minikf/minikf-user-data.vdi for persistent storage.
==> default: ** Managing persistent storage **
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => C:/Users/jervan/Documents/minikf
==> default: Machine 'default' has a post `vagrant up` message. This is a message
==> default: from the creator of the Vagrantfile, and not from Vagrant itself:
==> default:
==> default: Welcome to MiniKF!
==> default: Visit http://10.10.10.10/ to get started.
==> default:
But when I visit http://10.10.10.10 I get an "This site can’t be reached. 10.10.10.10 took too long to respond." error.
My Virtualbox settings look like this:
I can ssh into the box like so:
C:\Users\jervan\Documents\minikf>vagrant ssh
Last login: Mon Mar 23 13:14:17 2020 from 10.0.2.2
Welcome to MiniKF!
Type "minikf" to ensure everything is up and running.
vagrant#minikf:~$
and when I type minikf I get the MiniKF Provisioing tool (which is what you would normally see embedded in the MiniKF landing page).
After provisioning the software, I see pods starting up and the message "Kubeflow is deployed". But after the "exposing services" stage, I see errors popping up:
If I click on enter then the errors disappear, and the "Provisioning completed." screen with username and password appears.
If I go to VirtualBox and click on the green arrow, then it shows me the ubuntu login page, but I don't manage to login with the credentials shown in the previous step.
I had a similar issue.
First time around, it fails to start and after I run vagrant up again it starts, but I cannot access 10.10.10.10
errors I had
Then I went into the vm itself and shut it down like this :
shutting down the VM
After shutting it down manually, I did vagrant up again and now I can access 10.10.10.10

Custom Chef Resource to start newrelic-infra in ubuntu

Initially I started looking at Configure New Relic Infrastructure using Chef to setup newrelic infra chef cookbook for my project using chef solo, after some research I found that the dependencies in the cookbook is no longer supported.
So I decided to write a custom resource in the recipe so I can utilize chef idempotency.
I have tried the following steps under Install for Ubuntu in my ubuntu box and verified new relic-infra installation:
Now I am trying write a chef resource like this:
Step1: Create a configuration file, and add your license key:
echo "license_key: YOUR_LICENSE_KEY" | sudo tee -a /etc/newrelic-infra.yml
Added this resource block in my recipe for Step1:
file '/etc/newrelic-infra.yml' do
content 'license_key: added_key_here'
mode '0755'
owner 'root'
group 'root'
end
Step2: Enable New Relic's GPG key:
curl https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg | sudo apt-key add -
Added this resource block in my recipe for Step2:
apt_repository 'newrelic_key' do
uri 'https://download.newrelic.com/infrastructure_agent/gpg'
trusted true
key 'https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg'
end
I verified this step in the local box by listing the keys using this command:
sudo apt-key list
Step3: Create the agent's apt repo using the command for your distribution version:
printf "deb [arch=amd64] https://download.newrelic.com/infrastructure_agent/linux/apt bionic main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
Added this resource block in my recipe for Step3:
file '/etc/apt/sources.list.d/newrelic-infra.list' do
content 'deb [arch=amd64] https://download.newrelic.com/infrastructure_agent/linux/apt bionic main'
mode '0755'
owner 'root'
group 'root'
end
Step4: Update your apt cache and Run the install script:
sudo apt-get update
sudo apt-get install newrelic-infra -y
Added this resource block in my recipe for Step4:
apt_update
apt_package 'newrelic-infra'
Error:
But the install fails with the following error:
===============================================================================
default: Error executing action `update` on resource 'apt_update[newrelic-infra]'
default: ================================================================================
default:
default: Mixlib::ShellOut::ShellCommandFailed
default: ------------------------------------
default: execute[apt-get -q update] (/opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.4.56/lib/chef/provider/apt_update.rb line 70) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '100'
default: ---- Begin output of ["apt-get", "-q", "update"] ----
default: STDOUT:
default:
default: STDERR: E: Malformed entry 1 in list file /etc/apt/sources.list.d/newrelic-infra.list (Component)
default:
default:
default: * apt_package[newrelic-infra] action install
default: * No candidate version available for newrelic-infra
default:
default:
default: ================================================================================
default:
default: Error executing action `install` on resource 'apt_package[newrelic-infra]'
default:
default: ================================================================================
default:
default:
default:
default:
default: Chef::Exceptions::Package
default: -------------------------
default: No candidate version available for newrelic-infra
default:
default: Resource Declaration:
default: ---------------------
default: # In /etc/chef/local-mode-cache/cache/cookbooks/repo/recipes/default.rb
default:
default: 38: apt_package 'newrelic-infra'
default: 39:
default:
default: Compiled Resource:
default: ------------------
default: # Declared in /etc/chef/local-mode-cache/cache/cookbooks/repo/recipes/default.rb:38:in `from_file'
default:
default: apt_package("newrelic-infra") do
default: package_name "newrelic-infra"
default: action [:install]
default: default_guard_interpreter :default
default:
default: declared_type :apt_package
default:
default:
default: cookbook_name "repo"
default: recipe_name "default"
default: end
default:
default: System Info:
default: ------------
default: chef_version=14.4.56
default: platform=ubuntu
default: platform_version=18.04
default: ruby=ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
default: program_name=/usr/bin/chef-solo
default: executable=/opt/chefdk/bin/chef-solo
default:
default:
default: Running handlers:
default: [2019-08-30T18:19:30+00:00] ERROR: Running exception handlers
default: Running handlers complete
default: [2019-08-30T18:19:30+00:00] ERROR: Exception handlers complete
default: Chef Client failed. 6 resources updated in 48 seconds
default: [2019-08-30T18:19:30+00:00] FATAL: Stacktrace dumped to /etc/chef/local-mode-cache/cache/chef-stacktrace.out
default: [2019-08-30T18:19:30+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
default: [2019-08-30T18:19:30+00:00] FATAL: Chef::Exceptions::Package: apt_package[newrelic-infra] (repo-deploy::default line 38) had an error: Chef::Exceptions::Package: No candidate version available for newrelic-infra
I ran my vagrant file and it works for every step successfully but fails in the final install step... What am I doing wrong? Any troubleshooting tips would be helpful. Thanks!
firstly, you can combine together steps 2 and 3 using apt_repository by utilizing the arch and distribution.
if you read apt_repository documentation, you can see that you can even drop the apt update in step 4
Adding a new repository will update the APT package cache immediately.
secondly, back to your question...
from looking at your logs, specifically
default: execute[apt-get -q update] (/opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.4.56/lib/chef/provider/apt_update.rb line 70) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '100'
it appears that you do not run chef-client on your node, rather you are using chef-dk. make sure that you are running chef-client (or chef infra client nowadays) within the node that you like to converge.
you can run chef-client in higher log level to reveal more about the execution by specifying the log_level
The level of logging to be stored in a log file. Possible levels: auto (default), debug, info, warn, error, or fatal. Default value: warn (when a terminal is available) or info (when a terminal is not available).
i hope it will help you solving your issue
Thanks again #Mr for providing your input. If anyone is wondering about the custom resource for new relic infra, here you go:
file '/etc/newrelic-infra.yml' do
content 'license_key: added my license key here'
mode '0755'
owner 'root'
group 'root'
end
apt_repository 'newrelic-infra' do
uri 'https://download.newrelic.com/infrastructure_agent/linux/apt'
trusted true
arch 'amd64'
components ['main']
distribution 'bionic'
key 'https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg'
end

Installation of MediaWiki Vagrant - error logs

I try to install MediaWiki Vagrant. Also, I follow this page.
I'm on a very new Ubuntu 16.04 installation and I've got this error message :
==> default: Error: /usr/local/bin/multiversion-install /vagrant/mediawiki --wiki wiki --dbname wiki --dbpass wikipassword --dbuser wikiadmin --pass vagrant --scriptpath /w --server http://dev.wiki.local.wmftest.net:8080 --confpath /vagrant/settings.d/wikis/wiki wiki Admin
==> default: returned 1 instead of one of [0]
==> default: Error: /Stage[main]/Mediawiki/Mediawiki::Wiki[devwiki]/Exec[wiki_setup]/returns: change from notrun to 0 failed: /usr/local/bin/multiversion-install /vagrant/mediawiki --wiki wiki --dbname wiki --dbpass wikipassword --dbuser wikiadmin --pass vagrant --scriptpath /w --server http://dev.wiki.local.wmftest.net:8080 --confpath /vagrant/settings.d/wikis/wiki wiki Admin
==> default: returned 1 instead of one of [0]
Here are all my logs :
cywil#cywil-GT70-2OC-2OD:~$ cd vagrant
cywil#cywil-GT70-2OC-2OD:~/vagrant$ ./setup.sh
You're all set! Simply run `vagrant up` to boot your new environment.
(Or try `vagrant config --list` to see what else you can tweak.)
cywil#cywil-GT70-2OC-2OD:~/vagrant$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'debian/contrib-jessie64' is up to date...
==> 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: Adapter 2: hostonly
==> default: Forwarding ports...
default: 8080 (guest) => 8080 (host) (adapter 1)
default: 443 (guest) => 4430 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (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: 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.3.36
default: VirtualBox Version: 5.0
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => /home/cywil/vagrant
default: /vagrant/logs => /home/cywil/vagrant/logs
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
==> default: Machine 'default' has a post `vagrant up` message. This is a message
==> default: from the creator of the Vagrantfile, and not from Vagrant itself:
==> default:
==> default: Vanilla Debian box. See https://atlas.hashicorp.com/debian/ for help and bug reports
cywil#cywil-GT70-2OC-2OD:~/vagrant$ vagrant roles list
Available roles:
abusefilter inputbox restbase
accountinfo interwiki revisionslider
analytics invitesignup sal
antispam jsduck sandboxlink
antispoof jsonconfig scholarships
apex kafka score
apparmor kartographer scribunto
articleplaceholder kartographerwv securepoll
babel keystone semanticextraspecialproperties
betafeatures l10nupdate semanticmediawiki
buggy labeledsectiontransclusion semanticresultformats
campaigns langwikis semantictitle
cassandra ldapauth sentry
categorytree liquidthreads shorturl
centralauth livingstyleguide simple_miser
centralnotice lockdown simple_performant
checkuser loginnotify sitematrix
cirrussearch maps spark
cite massaction statsd
citoid massmessage striker
cldr math svg
codeeditor mathoid swift
cologneblue mathsearch templatedata
commons memcached templatesandbox
commons_datasets mleb templatestyles
commonsmetadata mobileapp testwiki
confirmedit mobilecontentservice textextracts
contactpage mobilefrontend three_d
contenttranslation modern throttleoverride
disableaccount molhandler thumb_on_404
disambiguator * monobook thumbor
doublewiki multimedia tidy
easytimeline multimediaviewer timedmediahandler
echo navigationtiming timeless
education newsletter titleblacklist
elk newusermessage torblock
emailauth notebook translate
embedvideo nuke uls
eventbus oathauth uploadslink
eventlogging oauth uploadwizard
externalstore oauthauthentication urlgetparameters
featuredfeeds oozie urlshortener
fileannotations openbadges usermerge
flaggedrevs ores variables
flow pageassessments varnish
fss pagedtiffhandler vectorbeta
fundraising pageimages vipsscaler
gadgets pagetriage visualeditor
gadgets2 pageviewinfo warnings_as_errors
geodata parserfunctions widgets
geodata_elastic parsoid wikibase_repo
geshi payments wikidata
gettingstarted pdfhandler wikidatapagebanner
globalblocking performanceinspector wikidiff2
globalcssjs phabricator wikieditor
globalusage phptags wikigrok
globaluserpage phragile wikihiero
gpgmail pipeescape wikilove
graph poem wikimediaevents
graphoid poolcounter wikimediaflow
greystuff popups wikimediaincubator
guidedtour private wikimediamaintenance
gwtoolset proofreadpage wikimediamessages
hadoop psr3 wikimetrics
headertabs questycaptcha wikispeech
hive quicksurveys wikitech
https quips xanalytics
hue quiz xhprofgui
iabot raita youtube
iegreview relatedarticles zend
imagemetrics renameuser zero
Roles marked with '*' are enabled.
Note that roles enabled by dependency are not marked.
Use `vagrant roles enable` & `vagrant roles disable` to customize.
cywil#cywil-GT70-2OC-2OD:~/vagrant$ vagrant roles enable monobook
Ok. Run `vagrant provision` to apply your changes.
cywil#cywil-GT70-2OC-2OD:~/vagrant$ vagrant provision
==> default: Running provisioner: lsb_check...
==> default: Running provisioner: shell...
default: Running: /tmp/vagrant-shell20170425-9233-r1b890.sh
==> default: Running provisioner: puppet...
==> default: Running Puppet with site.pp...
==> default: Info: Loading facts
==> default: Notice: Compiled catalog for mediawiki-vagrant.dev in environment production in 4.18 seconds
==> default: Info: Applying configuration version '1493114917.f0b87099'
==> default: Notice: /Stage[main]/Npm/Exec[npm_set_cache_dir]/returns: executed successfully
==> default: Notice: /Stage[main]/Mediawiki/Mediawiki::Wiki[devwiki]/Exec[wiki_setup]/returns: Could not open input file: /vagrant/mediawiki/maintenance/install.php
==> default: Error: /usr/local/bin/multiversion-install /vagrant/mediawiki --wiki wiki --dbname wiki --dbpass wikipassword --dbuser wikiadmin --pass vagrant --scriptpath /w --server http://dev.wiki.local.wmftest.net:8080 --confpath /vagrant/settings.d/wikis/wiki wiki Admin
==> default: returned 1 instead of one of [0]
==> default: Error: /Stage[main]/Mediawiki/Mediawiki::Wiki[devwiki]/Exec[wiki_setup]/returns: change from notrun to 0 failed: /usr/local/bin/multiversion-install /vagrant/mediawiki --wiki wiki --dbname wiki --dbpass wikipassword --dbuser wikiadmin --pass vagrant --scriptpath /w --server http://dev.wiki.local.wmftest.net:8080 --confpath /vagrant/settings.d/wikis/wiki wiki Admin
==> default: returned 1 instead of one of [0]
==> default: Notice: /Stage[main]/Mediawiki/Mediawiki::Wiki[devwiki]/Exec[wiki_include_extra_settings]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki/Mediawiki::Wiki[devwiki]/Exec[wiki_include_extra_settings]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki/Mediawiki::Wiki[devwiki]/Exec[wiki_copy_LocalSettings]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki/Mediawiki::Wiki[devwiki]/Exec[wiki_copy_LocalSettings]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki::Ready_service/Systemd::Service[mediawiki-ready]/File[/lib/systemd/system/mediawiki-ready.service]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki::Ready_service/Systemd::Service[mediawiki-ready]/File[/lib/systemd/system/mediawiki-ready.service]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki::Ready_service/Systemd::Service[mediawiki-ready]/Exec[systemd reload for mediawiki-ready]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki::Ready_service/Systemd::Service[mediawiki-ready]/Exec[systemd reload for mediawiki-ready]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki::Ready_service/Systemd::Service[mediawiki-ready]/Service[mediawiki-ready]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki::Ready_service/Systemd::Service[mediawiki-ready]/Service[mediawiki-ready]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Hhvm::Fcgi/Systemd::Service[hhvm]/File[/etc/systemd/system/hhvm.service.d]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Hhvm::Fcgi/Systemd::Service[hhvm]/File[/etc/systemd/system/hhvm.service.d]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Hhvm::Fcgi/Systemd::Service[hhvm]/File[/etc/systemd/system/hhvm.service.d/puppet-override.conf]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Hhvm::Fcgi/Systemd::Service[hhvm]/File[/etc/systemd/system/hhvm.service.d/puppet-override.conf]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Hhvm::Fcgi/Systemd::Service[hhvm]/Exec[systemd reload for hhvm]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Hhvm::Fcgi/Systemd::Service[hhvm]/Exec[systemd reload for hhvm]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Hhvm::Fcgi/Systemd::Service[hhvm]/Service[hhvm]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Hhvm::Fcgi/Systemd::Service[hhvm]/Service[hhvm]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki/Mediawiki::Group[devwiki_suppress]/Mediawiki::Settings[devwiki_suppress_group]/File[/vagrant/settings.d/wikis/wiki/settings.d/puppet-managed/10-devwiki_suppress_group.php]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki/Mediawiki::Group[devwiki_suppress]/Mediawiki::Settings[devwiki_suppress_group]/File[/vagrant/settings.d/wikis/wiki/settings.d/puppet-managed/10-devwiki_suppress_group.php]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki/Exec[update_all_databases]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki/Exec[update_all_databases]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki/Mediawiki::User[admin_user_in_steward_suppress_on_wiki]/Mediawiki::Maintenance[mediawiki_user_Admin_wiki]/Exec[mediawiki_user_Admin_wiki]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki/Mediawiki::User[admin_user_in_steward_suppress_on_wiki]/Mediawiki::Maintenance[mediawiki_user_Admin_wiki]/Exec[mediawiki_user_Admin_wiki]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki/Mediawiki::User[admin_user_in_steward_suppress_on_wiki]/Mediawiki::Maintenance[mediawiki_user_Admin_wiki_steward,suppress]/Exec[mediawiki_user_Admin_wiki_steward,suppress]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki/Mediawiki::User[admin_user_in_steward_suppress_on_wiki]/Mediawiki::Maintenance[mediawiki_user_Admin_wiki_steward,suppress]/Exec[mediawiki_user_Admin_wiki_steward,suppress]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki/Mediawiki::Import::Text[Main_Page]/Mediawiki::Maintenance[add page devwiki/Main_Page]/Exec[add page devwiki/Main_Page]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki/Mediawiki::Import::Text[Main_Page]/Mediawiki::Maintenance[add page devwiki/Main_Page]/Exec[add page devwiki/Main_Page]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki/Mediawiki::Import::Text[Template:Main_Page]/Mediawiki::Maintenance[add page devwiki/Template:Main_Page]/Exec[add page devwiki/Template:Main_Page]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki/Mediawiki::Import::Text[Template:Main_Page]/Mediawiki::Maintenance[add page devwiki/Template:Main_Page]/Exec[add page devwiki/Template:Main_Page]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki::Jobrunner/File[/etc/default/jobrunner]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki::Jobrunner/File[/etc/default/jobrunner]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki::Jobrunner/File[/etc/jobrunner.json]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki::Jobrunner/File[/etc/jobrunner.json]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki::Jobrunner/File[/etc/logrotate.d/mediawiki_jobrunner]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki::Jobrunner/File[/etc/logrotate.d/mediawiki_jobrunner]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki::Jobrunner/File[/etc/logrotate.d/mediawiki_jobchron]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki::Jobrunner/File[/etc/logrotate.d/mediawiki_jobchron]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki::Jobrunner/Git::Clone[mediawiki/services/jobrunner]/File[/vagrant/srv/jobrunner]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki::Jobrunner/Git::Clone[mediawiki/services/jobrunner]/File[/vagrant/srv/jobrunner]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki::Jobrunner/Git::Clone[mediawiki/services/jobrunner]/Exec[git_clone_mediawiki/services/jobrunner]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki::Jobrunner/Git::Clone[mediawiki/services/jobrunner]/Exec[git_clone_mediawiki/services/jobrunner]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki::Jobrunner/Service::Gitupdate[jobrunner]/File[/etc/mw-vagrant/services/jobrunner.conf]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki::Jobrunner/Service::Gitupdate[jobrunner]/File[/etc/mw-vagrant/services/jobrunner.conf]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki::Jobrunner/Service::Gitupdate[jobchron]/File[/etc/mw-vagrant/services/jobchron.conf]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki::Jobrunner/Service::Gitupdate[jobchron]/File[/etc/mw-vagrant/services/jobchron.conf]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki::Jobrunner/Systemd::Service[jobrunner]/File[/lib/systemd/system/jobrunner.service]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki::Jobrunner/Systemd::Service[jobrunner]/File[/lib/systemd/system/jobrunner.service]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki::Jobrunner/Systemd::Service[jobrunner]/Exec[systemd reload for jobrunner]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki::Jobrunner/Systemd::Service[jobrunner]/Exec[systemd reload for jobrunner]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki::Jobrunner/Systemd::Service[jobrunner]/Service[jobrunner]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki::Jobrunner/Systemd::Service[jobrunner]/Service[jobrunner]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki::Jobrunner/Systemd::Service[jobchron]/File[/lib/systemd/system/jobchron.service]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki::Jobrunner/Systemd::Service[jobchron]/File[/lib/systemd/system/jobchron.service]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki::Jobrunner/Systemd::Service[jobchron]/Exec[systemd reload for jobchron]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki::Jobrunner/Systemd::Service[jobchron]/Exec[systemd reload for jobchron]: Skipping because of failed dependencies
==> default: Notice: /Stage[main]/Mediawiki::Jobrunner/Systemd::Service[jobchron]/Service[jobchron]: Dependency Exec[wiki_setup] has failures: true
==> default: Warning: /Stage[main]/Mediawiki::Jobrunner/Systemd::Service[jobchron]/Service[jobchron]: Skipping because of failed dependencies
==> default: Notice: Finished catalog run in 5.22 seconds
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
What can I do ?
Many thanks by advanced for your answers !
Cyril

chef on virtualbox. guest is downloading very slowly from host

I am using vagrant and chef to build a VM.
Host: OSX 10.9.5
audrey:ubuntu2 jluc$ chef -v
Chef Development Kit Version: 0.10.0
chef-client version: 12.5.1
berks version: 4.0.1
kitchen version: 1.4.2
audrey:ubuntu2 jluc$ vagrant -v
Vagrant 1.8.1
audrey:ubuntu2 jluc$ vagrant plugin list
vagrant-berkshelf (4.1.0)
vagrant-omnibus (1.4.1)
vagrant-share (1.1.5, system)
Virtualbox: 5, but same on 4 previously.
Guest: Ubuntu 14.04
Background: I am using alien to install Oracle rpm. However, you can't just point the client to a url or package somewhere, you need to download the rpms from Oracle, accept conditions and then make the files available to your client install. There are 2 rpms, one 30MB, one 640KB.
I am doing this by launching a http server on the host, on port 9003.
Problem:
The download/remote_file time, within the chef run, is anywhere from 5-20 minutes, while I can wget/curl them from within the guest in 5-15 seconds.
Details:
The following chef code deals with those files:
ip = node[:network][:default_gateway]
simplehttp_port=node[:basedjango][:port_host_fileserver]
fn_basic = "oracle-instantclient12.1-basiclite-12.1.0.2.0-1.x86_64.rpm"
execute 'download_basic' do
cwd "/tmp"
command "wget http://#{ip}:#{simplehttp_port}/#{fn_basic} "
not_if do ::File.exists?(fnp_basic) end
end
#I have also used this instead, just as slow...
remote_file fnp_basic do
uri = "http://#{ip}:#{simplehttp_port}/#{fn_basic}"
not_if do ::File.exists?(fnp_basic) end
mode '0755'
action :create
end
My problem is that I can vagrant ssh into the guest and wget or curl the file in anything from 5 to 15 seconds. From the chef cookbooks, I am looking at 5-20 minutes each time (there is a condition guard to avoid downloading it if it exists).
==> default: [2016-01-18T11:13:58-08:00] INFO: file[/etc/profile.d/ORACLE_HOME.sh] mode changed to 755
==> default:
==> default: - change mode from '' to '0755'
==> default:
==> default: - change owner from '' to 'root'
==> default:
==> default: - change group from '' to 'root'
==> default:
==> default: (up to date)
==> default: Recipe: basedjango::oracle
==> default:
==> default: * execute[download_basic] action run
!!! 11:13 to 11:28 => 15 minutes here.
==> default: [2016-01-18T11:28:04-08:00] INFO:
execute[download_basic] ran successfully
==> default:
==> default: - execute wget http://10.0.2.2:9003/oracle-instantclient12.1-basiclite-12.1.0.2.0-1.x86_64.rpm
==> default: * execute[install_basic] action run
And here is the same command, executed manually via vagrant ssh. About 2 seconds in this case.
vagrant#vagrant:/tmp$ wget http://10.0.2.2:9003/oracle-instantclient12.1-basiclite-12.1.0.2.0-1.x86_64.rpm
--2016-01-18 11:50:40-- http://10.0.2.2:9003/oracle-instantclient12.1-basiclite-12.1.0.2.0-1.x86_64.rpm
Connecting to 10.0.2.2:9003... connected.
HTTP request sent, awaiting response... 200 OK
Length: 30940809 (30M) [text/html]
Saving to: ‘oracle-instantclient12.1-basiclite-12.1.0.2.0-1.x86_64.rpm’
100%[====================================================================================================================================================================================>] 30,940,809 17.8MB/s in 1.7s
2016-01-18 11:50:41 (17.8 MB/s) - ‘oracle-instantclient12.1-basiclite-12.1.0.2.0-1.x86_64.rpm’ saved [30940809/30940809]
The remote_file resource behaves the same way, so at first I thought it was something wrong with it or the way I use it. The rpms are NOT being served from the Vagrant shared directory, btw.
Any ideas?
I don't know if you haven't already found a solution, but when I had that issue (even downloading from another server) I could 'fix' it by enabling debug output for chef. This magically increased the download speed.
Simply put
config.vm.provion :chef_solo |chef|
chef.log_level = 'debug'
[...]
end

Cannot use chef provisioning in vagrant

I created a basic vagrant box and config provisioning as below
config.vm.provision :chef_solo do |chef|
chef.add_recipe "apache2"
chef.json = { :apache => { :default_site_enabled => true } }
end
I also add cookbook to my project
git submodule add https://github.com/svanzoest-cookbooks/apache2/ cookbooks/apache2
But when I run vagrant provision, I get this
==> default: [2015-03-26T14:55:52+00:00] INFO: Forking chef instance to converge...
==> default: [2015-03-26T14:55:52+00:00] INFO: *** Chef 12.1.2 ***
==> default: [2015-03-26T14:55:52+00:00] INFO: Chef-client pid: 1130
==> default: [2015-03-26T14:55:54+00:00] INFO: Setting the run_list to ["recipe[apache2]"] from CLI options
==> default: [2015-03-26T14:55:54+00:00] INFO: Run List is [recipe[apache2]]
==> default: [2015-03-26T14:55:54+00:00] INFO: Run List expands to [apache2]
==> default: [2015-03-26T14:55:54+00:00] INFO: Starting Chef Run for precise32
==> default: [2015-03-26T14:55:54+00:00] INFO: Running start handlers
==> default: [2015-03-26T14:55:54+00:00] INFO: Start handlers complete.
==> default: [2015-03-26T14:55:54+00:00] ERROR: Running exception handlers
==> default: [2015-03-26T14:55:54+00:00] ERROR: Exception handlers complete
==> default: [2015-03-26T14:55:54+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> default: [2015-03-26T14:55:54+00:00] ERROR: Cookbook iptables not found. If you're loading iptables from another cookbook, make sure you configure the dependency in your metadata
==> default: [2015-03-26T14:55:54+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Maybe iptables cookbook is required, so I add it. And then I get this message
==> default: [2015-03-26T14:58:32+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> default: [2015-03-26T14:58:32+00:00] ERROR: Cookbook logrotate not found. If you're loading logrotate from another cookbook, make sure you configure the dependency in your
==> default: [2015-03-26T14:58:32+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
logrotate cookbook is required?
Why does it continuously require cookbook? What is metadata here?
Can anyone help me?
Cookbooks can have dependencies to other cookbooks. This allows them to rely on functionality provided by these other cookbooks.
In your case, your apache2 cookbook depends on the iptables and the logrotate cookbooks. You can check this in each cookbook's metadata.rb file. In case of your apache2 cookbook, you can find the metadata.rb file on GitHub.
Note that cookbooks can also have recursive dependencies, i.e. they can have further dependencies which must all be fulfilled. Because if this, it is often recommended to manage your cookbooks with a tool like Berkshelf or Librarian which can download all cookbook dependencies automatically and consistent.

Resources