-
-
Save fletchowns/66c13db76d20be182597 to your computer and use it in GitHub Desktop.
chef mysql access denied
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----> Starting Kitchen (v1.4.0) | |
-----> Creating <default-debian-78>... | |
Bringing machine 'default' up with 'virtualbox' provider... | |
==> default: VirtualBox VM is already running. | |
[SSH] Established | |
Vagrant instance <default-debian-78> created. | |
Finished creating <default-debian-78> (0m3.35s). | |
-----> Converging <default-debian-78>... | |
Preparing files for transfer | |
Preparing dna.json | |
Resolving cookbook dependencies with Berkshelf 3.2.4... | |
Removing non-cookbook files before transfer | |
Preparing data_bags | |
Preparing environments | |
Preparing roles | |
Preparing secret | |
Preparing solo.rb | |
-----> Installing Chef Omnibus (12.4.1) | |
Downloading https://www.chef.io/chef/install.sh to file /tmp/install.sh | |
Trying wget... | |
Download complete. | |
Downloading Chef 12.4.1 for debian... | |
downloading https://www.chef.io/chef/metadata?v=12.4.1&prerelease=false&nightlies=false&p=debian&pv=6&m=x86_64 | |
to file /tmp/install.sh.5781/metadata.txt | |
trying wget... | |
url https://opscode-omnibus-packages.s3.amazonaws.com/debian/6/x86_64/chef_12.4.1-1_amd64.deb | |
md5 90002b3752dcbd5087fa33a75992c339 | |
sha256 a5ce4b9aee008ae15de73a7d20990aff46e63696a1ab4d98feef59e0399475d5 | |
downloaded metadata file looks valid... | |
downloading https://opscode-omnibus-packages.s3.amazonaws.com/debian/6/x86_64/chef_12.4.1-1_amd64.deb | |
to file /tmp/install.sh.5781/chef_12.4.1-1_amd64.deb | |
trying wget... | |
Comparing checksum with sha256sum... | |
Installing Chef 12.4.1 | |
installing with dpkg... | |
Selecting previously unselected package chef. | |
(Reading database ... 5% | |
(Reading database ... 10% | |
(Reading database ... 15% | |
(Reading database ... 20% | |
(Reading database ... 25% | |
(Reading database ... 30% | |
(Reading database ... 35% | |
(Reading database ... 40% | |
(Reading database ... 45% | |
(Reading database ... 50% | |
(Reading database ... 55% | |
(Reading database ... 60% | |
(Reading database ... 65% | |
(Reading database ... 70% | |
(Reading database ... 75% | |
(Reading database ... 80% | |
(Reading database ... 85% | |
(Reading database ... 90% | |
(Reading database ... 95% | |
(Reading database ... 100% | |
(Reading database ... 37456 files and directories currently installed.) | |
Unpacking chef (from .../chef_12.4.1-1_amd64.deb) ... | |
Setting up chef (12.4.1-1) ... | |
Thank you for installing Chef! | |
Transferring files to <default-debian-78> | |
Starting Chef Client, version 12.4.1 | |
Compiling Cookbooks... | |
Converging 13 resources | |
Recipe: apt::default | |
* file[/var/lib/apt/periodic/update-success-stamp] action nothing (skipped due to action :nothing) | |
* directory[/etc/apt/apt.conf.d] action create (up to date) | |
* cookbook_file[/etc/apt/apt.conf.d/15update-stamp] action create | |
--- /etc/apt/apt.conf.d/15update-stamp 2015-09-13 11:22:03.570696670 +0000 | |
@@ -1 +1,2 @@ | |
* execute[apt-get-update] action run | |
- execute apt-get update | |
* file[/var/lib/apt/periodic/update-success-stamp] action touch | |
* execute[apt-get update] action nothing (skipped due to action :nothing) | |
* execute[apt-get autoremove] action nothing (skipped due to action :nothing) | |
* execute[apt-get autoclean] action nothing (skipped due to action :nothing) | |
* execute[apt-get-update-periodic] action run (skipped due to only_if) | |
* directory[/var/cache/local] action create | |
- change owner from '' to 'root' | |
* directory[/var/cache/local/preseeding] action create | |
- change owner from '' to 'root' | |
Recipe: fletchowns::mysql | |
* mysql2_chef_gem[default] action install | |
Recipe: build-essential::_debian | |
* apt_package[autoconf] action install | |
- install version 2.69-1 of package autoconf | |
- install version 2.22-8+deb7u2 of package binutils-doc | |
- install version 1:2.5.dfsg-2.1 of package bison | |
- install version 11.5 of package build-essential | |
- install version 2.5.35-10.1 of package flex | |
- install version 0.18.1.1-9 of package gettext | |
- install version (none) of package ncurses-dev | |
* mysql_client[default] action create | |
- install version 5.5.44-0+deb7u1 of package mysql-client | |
- install version 5.5.44-0+deb7u1 of package libmysqlclient-dev | |
- install version 0.3.17 of package mysql2 | |
Recipe: fletchowns::mysql | |
* mysql_service[default] action create | |
- install version 5.5.44-0+deb7u1 of package mysql-server-5.5 | |
- stop service service[default :create mysql] | |
- disable service service[default :create mysql] | |
* group[default :create mysql] action create (up to date) | |
* user[default :create mysql] action create (up to date) | |
* file[default :create /etc/mysql/my.cnf] action delete | |
- delete file /etc/mysql/my.cnf | |
* file[default :create /etc/my.cnf] action delete (up to date) | |
* link[default :create /usr/share/my-default.cnf] action create | |
- create symlink at /usr/share/my-default.cnf to /etc/mysql-default/my.cnf | |
* directory[default :create /etc/mysql-default] action create | |
- create new directory /etc/mysql-default | |
- change mode from '' to '0750' | |
- change owner from '' to 'mysql' | |
- change group from '' to 'mysql' | |
* directory[default :create /etc/mysql-default/conf.d] action create | |
- create new directory /etc/mysql-default/conf.d | |
- change mode from '' to '0750' | |
- change owner from '' to 'mysql' | |
- change group from '' to 'mysql' | |
* directory[default :create /run/mysql-default] action create | |
- create new directory /run/mysql-default | |
- change mode from '' to '0755' | |
- change owner from '' to 'mysql' | |
- change group from '' to 'mysql' | |
* directory[default :create /var/log/mysql-default] action create | |
- create new directory /var/log/mysql-default | |
- change mode from '' to '0750' | |
- change owner from '' to 'mysql' | |
- change group from '' to 'mysql' | |
* template[default :create /etc/mysql-default/my.cnf] action create | |
- update content in file /etc/mysql-default/my.cnf from none to 36b3cd | |
+++ /tmp/chef-rendered-template20150913-5862-5g1gst 2015-09-13 11:22:59.146470535 +0000 | |
@@ -1 +1,23 @@ | |
+# Chef generated my.cnf for instance mysql-default | |
+ | |
+[client] | |
+default-character-set = utf8 | |
+socket = /run/mysql-default/mysqld.sock | |
+ | |
+default-character-set = utf8 | |
+ | |
+[mysqld] | |
+user = mysql | |
+pid-file = /run/mysql-default/mysqld.pid | |
+datadir = /var/lib/mysql | |
+tmpdir = /tmp | |
+log-error = /var/log/mysql-default/error.log | |
+!includedir /etc/mysql-default/conf.d | |
+ | |
+[mysqld_safe] | |
- change mode from '' to '0600' | |
- change owner from '' to 'mysql' | |
* bash[default :create initial records] action run (skipped due to not_if) | |
* mysql_service[default] action start | |
- update content in file /etc/init.d/mysql-default from none to 9e5f42 | |
--- /etc/init.d/mysql-default 2015-09-13 11:22:59.170482535 +0000 | |
2015-09-13 11:22:59.170482535 +0000 | |
+# | |
+# Provides: mysql-default | |
+# Required-Stop: $remote_fs $syslog | |
+# Should-Start: $network $time | |
+# Should-Stop: $network $time | |
+# Default-Start: 2 3 4 5 | |
+# Default-Stop: 0 1 6 | |
+### END INIT INFO | |
+ | |
+# set -u | |
+ | |
+### Exit code reference | |
+# http://fedoraproject.org/wiki/Packaging:SysVInitScript | |
+# http://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html | |
+ | |
+# Source functions | |
+ | |
+#### | |
+# Variables | |
+#### | |
+ | |
+PID_DELAY=60 | |
+# Helper functions | |
+### | |
+ | |
+# Boolean function to see if MYSQL_PID exists and is a number | |
+pid_exists() { | |
+ PID_EXISTS=1 | |
+ if [ -f /run/mysql-default/mysqld.pid ]; then | |
+ if [ -n "$MYSQLD_PID" ] && [ -d "/proc/$MYSQLD_PID" ] ; then | |
+ PID_EXISTS=0 | |
+ fi | |
+} | |
+ | |
+# Use mysqladmin to ping the service as an invalid user over a socket | |
+running() { | |
+ RUNNING=1 | |
+ RESPONSE=`/usr/bin/mysqladmin --defaults-file=/etc/mysql-default/my.cnf --user=UNKNOWN_MYSQL_USER ping 2>&1` | |
+ local mret=$? | |
+ if pid_exists \ | |
+ && [ $mret -eq 0 ] \ | |
+ || [ `echo $RESPONSE | grep -q "Access denied for user"` ]; then | |
+ RUNNING=0 | |
+ fi | |
+} | |
+writable_error_log() { | |
+ WRITABLE_ERROR_LOG=1 | |
+ touch "/var/log/mysql-default/error.log" 2>/dev/null | |
+ if [ $touchret -eq 0 ]; then | |
+ chown mysql:mysql /var/log/mysql-default/error.log | |
+ return 0 | |
+ else | |
+ return $WRITABLE_ERROR_LOG | |
+ fi | |
+ | |
+ echo "Staring MySQL instance mysql-default" | |
+} | |
+ | |
+print_start_failure() { | |
+ echo "Could not start MySQL instance mysql-default" | |
+ return 0; | |
+} | |
+ | |
+print_reload_success() { | |
+ | |
+print_stop_success() { | |
+ echo "Stopping MySQL instance mysql-default" | |
+ return 0; | |
+} | |
+ | |
+print_stop_failure() { | |
+ echo "Could not stop MySQL instance mysql-default" | |
+ return 0; | |
+} | |
+ | |
+start_command() { | |
+ # Attempt to start mysql-default | |
+ echo "Starting MySQL instance mysql-default" | |
+ | |
+ local scl_name="" | |
+ | |
+ if [ -z $scl_name ]; then | |
+ /usr/bin/mysqld_safe \ | |
+ --defaults-file=/etc/mysql-default/my.cnf \ | |
+ >/dev/null 2>&1 & | |
+ else | |
+ --defaults-file=/etc/mysql-default/my.cnf \ | |
+ >/dev/null 2>&1 &" | |
+ fi | |
+ | |
+} | |
+ | |
+#### | |
+# Init script actions | |
+### | |
+ | |
+# Start mysql-default | |
+start() { | |
+ # exit 0 if already running. | |
+ if running; then | |
+ return 0; | |
+ fi | |
+ # exit 4 if we can't write to error_log | |
+ print_start_failure | |
+ return 4 | |
+ fi | |
+ # run program | |
+ start_command; | |
+ start_pid=$? | |
+ | |
+ while [ $TIMEOUT -gt 0 ]; do | |
+ if running; then | |
+ break | |
+ fi | |
+ if [ $CURRENT_DELAY -gt $PID_DELAY ] \ | |
+ && ! pid_exists; then | |
+ break | |
+ fi | |
+ | |
+ let TIMEOUT=${TIMEOUT}-1 | |
+ done | |
+ | |
+ if running; then | |
+ # successbaby.gif | |
+ print_start_success | |
+ return 0 | |
+ elif ! pid_exists; then | |
+ print_start_failure | |
+ return 3 | |
elif [ $TIMEOUT -eq 0 ]; then | |
+ # Handle timeout | |
+ kill $start_pid 2>/dev/null | |
+ return 1 | |
+ fi | |
+ | |
+# Reload mysql-default | |
+reload() { | |
+ /usr/bin/mysqladmin reload | |
+ local ret=$? | |
+ if [ $ret -eq 0 ]; then | |
+ print_reload_success; | |
+ else | |
+ print_reload_failure; | |
+ fi | |
+ return $ret | |
+} | |
+# Status of mysql-default | |
+status() { | |
+ return 0 | |
+ else | |
+ echo "mysql-default is not running" | |
+ return 1 | |
+ fi | |
+} | |
+ | |
+stop() { | |
+ if running; then | |
+ echo "Stopping MySQL instance mysql-default" | |
+ if [ -f /run/mysql-default/mysqld.pid ]; then | |
+ /bin/kill `cat /run/mysql-default/mysqld.pid 2>/dev/null` | |
+ kstat=$? | |
+ fi | |
+ | |
+ # Timeout loop | |
+ local TIMEOUT=$STARTTIMEOUT | |
+ while [ $TIMEOUT -gt 0 ]; do | |
+ if [ -e /run/mysql-default/mysqld.pid ]; then | |
+ sleep 1 | |
+ fi | |
+ done | |
+ | |
+ return $kstat | |
+ else | |
+ echo "MySQL instance mysql-default Stopped." | |
+ return 0 | |
+ | |
+case "$1" in | |
+ start) | |
+ start | |
+ ;; | |
+ stop | |
+ ;; | |
+ status) | |
+ status | |
+ restart) | |
+ ;; | |
+ reload) | |
+ ;; | |
+ echo $"Usage: $0 {start|stop|status|restart|reload}" | |
+ exit 2 | |
+esac | |
+ | |
- change mode from '' to '0755' | |
* service[default :start mysql-default] action enable | |
* service[default :start mysql-default] action start | |
- start service service[default :start mysql-default] | |
================================================================================ | |
Error executing action `create` on resource 'mysql_database[test_db]' | |
================================================================================ | |
Mysql2::Error | |
------------- | |
Access denied for user 'root'@'localhost' (using password: YES) | |
Cookbook Trace: | |
--------------- | |
/tmp/kitchen/cookbooks/database/libraries/provider_database_mysql.rb:105:in `new' | |
/tmp/kitchen/cookbooks/database/libraries/provider_database_mysql.rb:105:in `test_client' | |
/tmp/kitchen/cookbooks/database/libraries/provider_database_mysql.rb:37:in `block in <class:Mysql>' | |
Resource Declaration: | |
--------------------- | |
# In /tmp/kitchen/cookbooks/fletchowns/recipes/mysql.rb | |
19: mysql_database "test_db" do | |
20: connection mysql_connection_info | |
21: action :create | |
22: end | |
Compiled Resource: | |
------------------ | |
# Declared in /tmp/kitchen/cookbooks/fletchowns/recipes/mysql.rb:19:in `from_file' | |
mysql_database("test_db") do | |
action [:create] | |
retries 0 | |
retry_delay 2 | |
default_guard_interpreter :default | |
database_name "test_db" | |
declared_type :mysql_database | |
cookbook_name :fletchowns | |
recipe_name "mysql" | |
connection {:socket=>"/run/mysql-default/mysqld.sock", :username=>"root", :password=>"changeme"} | |
end | |
Running handlers: | |
[2015-09-13T11:23:01+00:00] ERROR: Running exception handlers | |
Running handlers complete | |
[2015-09-13T11:23:01+00:00] ERROR: Exception handlers complete | |
Chef Client failed. 33 resources updated in 58.73003983 seconds | |
[2015-09-13T11:23:01+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out | |
[2015-09-13T11:23:01+00:00] ERROR: mysql_database[test_db] (fletchowns::mysql line 19) had an error: Mysql2::Error: Access denied for user 'root'@'localhost' (using password: YES) | |
[2015-09-13T11:23:01+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment