Проблема с Vagrant apache2 поваренная книга - PullRequest
0 голосов
/ 24 сентября 2019

У меня проблема с запуском vagrant в более старом проекте.Я на Ubuntu 18.04 и vagrant работал нормально, пока я не установил ssd на свой ноутбук (не уверен, если связан).

Поэтому, когда я делаю Vagrant up, я получаю следующее сообщение:

==> default: * directory[/etc/apache2/ssl] action create
==> default: [2019-09-24T19:44:27+00:00] INFO: directory[/etc/apache2/ssl] created directory /etc/apache2/ssl
==> default:     
==> default: - create new directory /etc/apache2/ssl
==> default: [2019-09-24T19:44:27+00:00] INFO: directory[/etc/apache2/ssl] owner changed to 0
==> default: [2019-09-24T19:44:27+00:00] INFO: directory[/etc/apache2/ssl] group changed to 0
==> default: [2019-09-24T19:44:27+00:00] INFO: directory[/etc/apache2/ssl] mode changed to 755
==> default:     
==> default: - change mode from '' to '0755'
==> default:     - change owner from '' to 'root'
==> default:     - change group from '' to 'root'
==> default: 
==> default: 
==> default:   
==> default: * directory[/etc/apache2/conf.d] action create
==> default: [2019-09-24T19:44:27+00:00] INFO: directory[/etc/apache2/conf.d] created directory /etc/apache2/conf.d
==> default:     
==> default: - create new directory /etc/apache2/conf.d
==> default: [2019-09-24T19:44:27+00:00] INFO: directory[/etc/apache2/conf.d] owner changed to 0
==> default: [2019-09-24T19:44:27+00:00] INFO: directory[/etc/apache2/conf.d] group changed to 0
==> default: [2019-09-24T19:44:27+00:00] INFO: directory[/etc/apache2/conf.d] mode changed to 755
==> default: 
==> default:     
==> default: - change mode from '' to '0755'
==> default:     - change owner from '' to 'root'
==> default:     - change group from '' to 'root'
==> default: 
==> default: 
==> default:   
==> default: * directory[/var/cache/apache2] action create
==> default:  (up to date)
==> default:   * template[/etc/sysconfig/httpd] action create
==> default:  (skipped due to only_if)
==> default:   * template[apache2.conf] action create
==> default:     
==> default: 
==> default:     
==> default: ================================================================================
==> default:     
==> default: Error executing action `create` on resource 'template[apache2.conf]'
==> default:     
==> default: ================================================================================
==> default:     
==> default: 
==> default: 
==> default:     
==> default: Chef::Mixin::Template::TemplateError
==> default:     
==> default: ------------------------------------
==> default:     
==> default: undefined method `empty?' for nil:NilClass
==> default:     
==> default: 
==> default: 
==> default:     
==> default: Resource Declaration:
==> default: 
==> default:     ---------------------
==> default:     # In /tmp/vagrant-chef/0ad2cd5b52108461d0c0cbda213593d4/cookbooks/!apache2/recipes/default.rb
==> default:     
==> default:     149: template 'apache2.conf' do
==> default:     150:   case node['platform_family']
==> default:     151:   when 'rhel', 'fedora', 'arch'
==> default:     152:     path "#{node['apache']['dir']}/conf/httpd.conf"
==> default:     153:   when 'debian'
==> default:     154:     path "#{node['apache']['dir']}/apache2.conf"
==> default:     155:   when 'freebsd'
==> default:     156:     path "#{node['apache']['dir']}/httpd.conf"
==> default:     157:   end
==> default:     158:   source   'apache2.conf.erb'
==> default:     
==> default:     Compiled Resource:
==> default:     ------------------
==> default:     # Declared in /tmp/vagrant-chef/0ad2cd5b52108461d0c0cbda213593d4/cookbooks/!apache2/recipes/default.rb:149:in `from_file'
==> default:     
==> default:     template("apache2.conf") do
==> default:       action [:create]
==> default:       retries 0
==> default:       retry_delay 2
==> default:       default_guard_interpreter :default
==> default:       path "/etc/apache2/apache2.conf"
==> default:       backup 5
==> default:       atomic_update true
==> default:       source "apache2.conf.erb"
==> default:       declared_type :template
==> default:       cookbook_name :apache2
==> default:     
==> default:   recipe_name "default"
==> default:     
==> default:   mode "0644"
==> default:       owner "root"
==> default:       group "root"
==> default:     end
==> default: 
==> default:     
==> default: 
==> default:     Template Context:
==> default:     
==> default: -----------------
==> default:     on line #94
==> default:      92: # viewed by Web clients.
==> default:     
==> default:  93: #
==> default:      94: <% access_file_name_prefix = node['apache']['access_file_name'][0..2] if !node['apache']['access_file_name'].empty?
==> default: 
==> default:      95:    if access_file_name_prefix != '.ht'
==> default:      96:     file_name_prefix = '(' + access_file_name_prefix + '|\.ht)'
==> default: 
==> default:     
==> default: 
==> default: [2019-09-24T19:44:28+00:00] INFO: Running queued delayed notifications before re-raising exception
==> default: 
==> default: Running handlers:
==> default: [2019-09-24T19:44:28+00:00] ERROR: Running exception handlers
==> default: Running handlers complete
==> default: 
==> default: [2019-09-24T19:44:28+00:00] ERROR: Exception handlers complete
==> default: Chef Client failed. 14 resources updated in 03 minutes 07 seconds
==> default: [2019-09-24T19:44:28+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> default: [2019-09-24T19:44:28+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
==> default: [2019-09-24T19:44:28+00:00] ERROR: 
==> default: 
==> default: Chef::Mixin::Template::TemplateError (undefined method `empty?' for nil:NilClass) on line #94:
==> default: 
==> default:  92: # viewed by Web clients.
==> default:  93: #
==> default:  94: <% access_file_name_prefix = node['apache']['access_file_name'][0..2] if !node['apache']['access_file_name'].empty?
==> default:  95:    if access_file_name_prefix != '.ht'
==> default:  96:     file_name_prefix = '(' + access_file_name_prefix + '|\.ht)'
==> default: 
==> default:   (erubis):94:in `block in evaluate'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/erubis-2.7.0/lib/erubis/evaluator.rb:74:in `instance_eval'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/erubis-2.7.0/lib/erubis/evaluator.rb:74:in `evaluate'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/mixin/template.rb:162:in `_render_template'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/mixin/template.rb:148:in `render_template'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/provider/template/content.rb:53:in `file_for_provider'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/file_content_management/content_base.rb:40:in `tempfile'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/provider/file.rb:462:in `tempfile'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/provider/file.rb:339:in `do_generate_content'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/provider/file.rb:150:in `action_create'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/provider.rb:144:in `run_action'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource.rb:596:in `run_action'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/runner.rb:74:in `run_action'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/runner.rb:106:in `block (2 levels) in converge'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/runner.rb:106:in `each'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/runner.rb:106:in `block in converge'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/resource_list.rb:83:in `block in execute_each_resource'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/resource_list.rb:81:in `execute_each_resource'
==> default:   /opt/chef/embedded/lib/ruby/2.1.0/forwardable.rb:183:in `execute_each_resource'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/runner.rb:105:in `converge'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:658:in `block in converge'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:653:in `catch'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:653:in `converge'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:692:in `converge_and_save'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:271:in `run'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:261:in `block in fork_chef_client'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:249:in `fork'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:249:in `fork_chef_client'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:215:in `block in run_chef_client'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/local_mode.rb:44:in `with_server_connectivity'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:203:in `run_chef_client'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application/solo.rb:286:in `block in interval_run_chef_client'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application/solo.rb:275:in `loop'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application/solo.rb:275:in `interval_run_chef_client'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application/solo.rb:253:in `run_application'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:58:in `run'
==> default:   /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/bin/chef-solo:25:in `<top (required)>'
==> default:   /usr/bin/chef-solo:54:in `load'
==> default:   /usr/bin/chef-solo:54:in `<main>'
==> default: [2019-09-24T19:44:29+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 запущена:

 config.vm.provision "shell", path: "bootstrap.sh"
  config.vm.provision :chef_solo do |chef| 
    chef.roles_path = "./chef/chef-repo/roles" 
    chef.cookbooks_path = ["./chef/chef-repo/cookbooks"] 
    chef.data_bags_path = "./chef/chef-repo/data_bags"
    chef.environments_path = "./chef/chef-repo/environments"
      chef.add_recipe "apt"
      chef.add_recipe "chef_gem"
      chef.add_recipe "base"
      chef.add_recipe "build-essential"
      chef.add_recipe "openssl"
      chef.add_recipe "apache2"
      chef.add_recipe "apache2::mod_php5"
      chef.add_recipe "apache2::mod_rewrite"
      chef.add_recipe "apache2::mod_ssl"
      chef.add_recipe "mysql::server"
      chef.add_recipe "mysql::client"
      chef.add_recipe "mysql_charset"
      chef.add_recipe "php"
      chef.add_recipe "memcached"
      chef.add_recipe "php::module_mysql"
      chef.add_recipe "php::module_curl"
      chef.add_recipe "php::module_gd"
      chef.add_recipe "php::module_memcache"
      chef.add_recipe "deploy"
      chef.environment = "vagrant"

, а часть apache2 не работает.

https://supermarket.chef.io/cookbooks/apache2/versions/1.1.16

Это поваренная книга для apache2.Есть идеи по поводу неудачи?Работает на другом компьютере, той же версии vbox, vagrant, ruby.

...