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

Database recipe causing error if run a second time #55

Open
smallhadroncollider opened this issue Apr 18, 2015 · 3 comments
Open

Database recipe causing error if run a second time #55

smallhadroncollider opened this issue Apr 18, 2015 · 3 comments

Comments

@smallhadroncollider
Copy link

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
Copy link
Author

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

@joe4dev
Copy link

joe4dev commented May 6, 2015

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

@axsuul
Copy link

axsuul commented Aug 19, 2015

@joe4dev thanks that worked

joe4dev added a commit to joe4dev/wordpress that referenced this issue Jan 20, 2017
Reprovisioning or server restart led to broken db connection according to:
brint#55 (comment)
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