wordpress-cookbook icon indicating copy to clipboard operation
wordpress-cookbook copied to clipboard

Database recipe causing error if run a second time

Open smallhadroncollider opened this issue 9 years ago • 3 comments

I'm using Chef with Vagrant. If I run vagrant reload --provision having previously provisioned the machine I get an error:

ERROR: link[/var/run/mysqld/mysqld.sock] (wordpress::database line 56) had an error: Errno::ENOENT:
No such file or directory @ sys_fail2 - (/var/run/mysql-default/mysqld.sock, /var/run/mysqld/mysqld.sock)

wordpress::database line 56

smallhadroncollider avatar Apr 18 '15 19:04 smallhadroncollider

Running on Ubuntu 14.04. Only other Chef packages running are locale and apt.

smallhadroncollider avatar Apr 18 '15 19:04 smallhadroncollider

Same issue with Ubuntu 14.04 LTS (GNU/Linux 3.13.0-24-generic x86_64) The problems seems to be a non-existent target directory when trying to symlink mysqld.sock (i.e., /var/run/mysqld doesn't exist)

Temporary workaround: a) Explicitly create this directory before including the wordpress recipe:

directory '/var/run/mysqld' do
  owner 'ubuntu'
  group 'ubuntu'
  mode '0755'
  action :create
end
include_recipe 'wordpress::default'

b) Manually create this directory and the symlink:

sudo mkdir -p /var/run/mysqld && sudo ln -s /var/run/mysql-default/mysqld.sock /var/run/mysqld/mysqld.sock

joe4dev avatar May 06 '15 16:05 joe4dev

@joe4dev thanks that worked

axsuul avatar Aug 19 '15 17:08 axsuul