Alfresco / alfresco-spk

Design, run, integrate Alfresco stacks
55 stars 25 forks source link

Vagrant provisioning fails with unsupported version of mysql #36

Open michaeldunstan opened 9 years ago

michaeldunstan commented 9 years ago

Steps to reproduce:

git clone https://github.com/maoo/alfresco-boxes.git
cd alfresco-boxes/common
sh create-vendor-cookbooks.sh
cd ../vagrant
vagrant up

Then fails with:

ERROR: Unsupported Version: You requested to install a Mysql Client version that is not supported by your platform
ERROR: Platform: debian 12.04 - Request Mysql Client version: 5.7
ERROR: Availabe versions for your platform are: 5.5
maoo commented 9 years ago

Hi, thanks for the issue.

Can you try to set

node[alfresco][mysql_version] = '5.5'

If that works we can use that default if platform is Ubuntu 12

michaeldunstan commented 9 years ago

Yup. I edited vendor-cookbooks/alfresco/recipes/_attributes.rb then ran:

vagrant destroy -f
vagrant up

That fixes the install for mysql. But now the provisioning fails with problems installing tomcat:

==> default: ================================================================================
==> default: Error executing action `install` on resource 'package[tomcat-native]'
==> default: ================================================================================
==> default: 
==> default: Chef::Exceptions::Package
==> default: -------------------------
==> default: No version specified, and no candidate version available for tomcat-native
==> default: 
==> default: 
==> default: Resource Declaration:
==> default: ---------------------
==> default: # In /tmp/vagrant-chef-solo/569e8d1c0ebceb1e8fe0ac9e3c65b718/cookbooks/alfresco/recipes/tomcat.rb
==> default: 
==> default: 
==> default:   9:   package pkg do
==> default:  10:     action :install
==> default:  11:   end
==> default:  12: end
==> default: 
==> default: Compiled Resource:
==> default: ------------------
==> default: # Declared in /tmp/vagrant-chef-solo/569e8d1c0ebceb1e8fe0ac9e3c65b718/cookbooks/alfresco/recipes/tomcat.rb:9:in `block in from_file'
==> default: 
==> default: package("tomcat-native") do
==> default:   action [:install]
==> default:   retries 0
==> default:   retry_delay 2
==> default:   guard_interpreter :default
==> default:   package_name "tomcat-native"
==> default:   timeout 900
==> default:   cookbook_name :alfresco
==> default:   recipe_name "tomcat"
==> default: end
maoo commented 9 years ago

You can override additional_tomcat_packages defined in https://github.com/maoo/chef-alfresco/blob/master/attributes/tomcat.rb

My apologies for these regressions on master, I'm working on centos now. You can still use tag 0.4.2 though.

Thanks a lot for the valuable feedback!

michaeldunstan commented 9 years ago

I've tried several variations for additional_tomcat_packages:

%w{tomcat-native apr abrt}
%w{tomcat apr abrt}
%w{apr abrt}
%w{abrt}
%w{}

The first four all fail with something along the lines of "No version specified, and no candidate version available for ...". The last fails with:

================================================================================
Error executing action `create` on resource 'link[/var/lib/tomcat7-alfresco/webapps]'
================================================================================

Errno::EISDIR
-------------
Is a directory - /var/lib/tomcat7-alfresco/webapps

Resource Declaration:
---------------------
# In /tmp/vagrant-chef-solo/569e8d1c0ebceb1e8fe0ac9e3c65b718/cookbooks/tomcat/providers/instance.rb

 85:       link "#{new_resource.base}/#{name}" do
 86:         to new_resource.instance_variable_get("@#{attr}")
 87:       end
 88:     end

Compiled Resource:
------------------
# Declared in /tmp/vagrant-chef-solo/569e8d1c0ebceb1e8fe0ac9e3c65b718/cookbooks/tomcat/providers/instance.rb:85:in `block (2 levels) in class_from_file'

link("/var/lib/tomcat7-alfresco/webapps") do
  provider Chef::Provider::Link

  action :create

  retries 0
  retry_delay 2
  guard_interpreter :default
  to "/var/lib/tomcat7-alfresco/webapps"
  link_type :symbolic
  target_file "/var/lib/tomcat7-alfresco/webapps"
  cookbook_name :tomcat
end

I'll do a clean checkout and try using the centos64 box for vagrant.

michaeldunstan commented 9 years ago

No luck using the centos64 box profile either:

git clone https://github.com/maoo/alfresco-boxes.git
cd alfresco-boxes/common
sh create-vendor-cookbooks.sh
cd ../vagrant
BOX_OS=centos64 vagrant up

Fails with:

================================================================================
Error executing action `install` on resource 'package[tomcat-native]'
================================================================================

Chef::Exceptions::Package
-------------------------
No version specified, and no candidate version available for tomcat-native

Resource Declaration:
---------------------
# In /tmp/vagrant-chef-solo/569e8d1c0ebceb1e8fe0ac9e3c65b718/cookbooks/alfresco/recipes/tomcat.rb

  9:   package pkg do
 10:     action :install
 11:   end
 12: end

Compiled Resource:
------------------
# Declared in /tmp/vagrant-chef-solo/569e8d1c0ebceb1e8fe0ac9e3c65b718/cookbooks/alfresco/recipes/tomcat.rb:9:in `block in from_file'

package("tomcat-native") do
  action [:install]
  retries 0
  retry_delay 2
  guard_interpreter :default
  package_name "tomcat-native"
  timeout 900
  cookbook_name :alfresco
  recipe_name "tomcat"
end
maoo commented 9 years ago

I'll try to reproduce the issue as soon as chef-alfresco is stable (still implementing haproxy configurations).

In the meantime, consider adding tag: "chef-alfresco-0.4.2" to chef-alfresco on https://github.com/maoo/alfresco-boxes/blob/master/common/Berksfile

If you rather want to checkout the latest developments on chef-alfresco, I'd advise to check it out and use Kitchen to run locally.

michaeldunstan commented 9 years ago

Thanks @maoo. I don't have any experience using Kitchen. I'll have a go at pinning chef-alfresco to that tag.

balabanmario commented 9 years ago

Hi, I'm also getting an issue about my_sql with the latest version of vagrant file: ==> default: Chef Client failed. 13 resources updated in 62.81635205 seconds ==> default: [2015-07-30T21:46:36+00:00] ERROR: mysql2_chef_gem[default](alfresco::mysql-local-server line 23) had an error: RuntimeError: mysql_client[default](/tmp/vagrant-chef-solo/e596d95dcb9dd93452970bb36b59c5d3/cookbooks/mysql2_chef_gem/libraries/provider_mysql2_chef_gem_mysql.rb line 16) had an error: RuntimeError: Unsupported Mysql Client Version ==> default: [2015-07-30T21:46:37+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

maoo commented 8 years ago

Can you please test on the master now? Never faced this issue anymore, since the last chef-alfresco releases (0.6.x)