sous-chefs / mysql

Development repository for the mysql cookbook
https://supermarket.chef.io/cookbooks/mysql
Apache License 2.0
338 stars 690 forks source link

MySql start/stop upstart service fails to get response #529

Closed ronakjain90 closed 4 years ago

ronakjain90 commented 7 years ago

Cookbook version

8.4.0

Chef-client version

chef-solo

Platform Details

Ubuntu 14.04.5

Scenario:

Trying to install MySql 5.7 in ubuntu 14, even thought it's officially not supported i still managed to get it working.

Steps to Reproduce:

apt_repository 'mysql' do
  uri 'http://repo.mysql.com/apt/ubuntu/'
  distribution 'trusty'
  components ["mysql-5.7"]
  key '5072E1F5'
  keyserver 'pgp.mit.edu'
  action :add
  deb_src true
end

apt_update 'update'

mysql_service 'default' do
  version node['mysql']['version']
  package_name 'mysql-server'
  bind_address '0.0.0.0'
  port '3306'
  data_dir '/var/lib/mysql'
  initial_root_password node['mysql']['server_root_password']
  action [:create, :start]
end

Expected Result:

MySql to be installed successfully.

Actual Result:

      * service[mysql-default] action start

        ================================================================================
        Error executing action `start` on resource 'service[mysql-default]'
        ================================================================================

        Mixlib::ShellOut::CommandTimeout
        --------------------------------
        Command timed out after 600s:
        Command exceeded allowed execution time, process terminated
        ---- Begin output of /sbin/start mysql-default ----
        STDOUT: 
        STDERR: 
        ---- End output of /sbin/start mysql-default ----
        Ran /sbin/start mysql-default returned 

        Resource Declaration:
        ---------------------
        # In /home/vagrant/chef-solo/local-mode-cache/cache/cookbooks/mysql/libraries/mysql_service_manager_upstart.rb

         48:       service mysql_name do
         49:         provider Chef::Provider::Service::Upstart
         50:         supports status: true
         51:         action [:start]
         52:       end
         53:     end

        Compiled Resource:
        ------------------
        # Declared in /home/vagrant/chef-solo/local-mode-cache/cache/cookbooks/mysql/libraries/mysql_service_manager_upstart.rb:48:in `block in <class:MysqlServiceManagerUpstart>'

        service("mysql-default") do
          provider Chef::Provider::Service::Upstart
          action [:start]
          default_guard_interpreter :default
          service_name "mysql-default"
          enabled nil
          running nil
          masked nil
          pattern "mysql-default"
          declared_type :service
          cookbook_name "nw-db"
          supports {:status=>true}
        end

        System Info:
        ------------
        chef_version=13.2.20
        platform=ubuntu
        platform_version=14.04
        ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
        program_name=chef-solo worker: ppid=2905;start=09:55:22;
        executable=/opt/chef/bin/chef-solo

      ================================================================================
      Error executing action `start` on resource 'mysql_service_manager_upstart[default]'
      ================================================================================

      Mixlib::ShellOut::CommandTimeout
      --------------------------------
      service[mysql-default] (/home/vagrant/chef-solo/local-mode-cache/cache/cookbooks/mysql/libraries/mysql_service_manager_upstart.rb line 48) had an error: Mixlib::ShellOut::CommandTimeout: Command timed out after 600s:
      Command exceeded allowed execution time, process terminated
      ---- Begin output of /sbin/start mysql-default ----
      STDOUT: 
      STDERR: 
      ---- End output of /sbin/start mysql-default ----
      Ran /sbin/start mysql-default returned 

      Resource Declaration:
      ---------------------
      # In /home/vagrant/chef-solo/local-mode-cache/cache/cookbooks/mysql/libraries/mysql_service.rb

       50:           svc = mysql_service_manager(name, &block)
       51:         when 'sysvinit'

      Compiled Resource:
      ------------------
      # Declared in /home/vagrant/chef-solo/local-mode-cache/cache/cookbooks/mysql/libraries/mysql_service.rb:50:in `svc_manager'

      mysql_service_manager_upstart("default") do
        action [:start]
        updated true
        updated_by_last_action true
        default_guard_interpreter :default
        declared_type :mysql_service_manager
        cookbook_name "nw-db"
        version "5.7"
        bind_address "0.0.0.0"
        data_dir "/var/lib/mysql"
        initial_root_password "fazE6aHa"
        port "3306"
        instance "default"
        socket "/run/mysql-default/mysqld.sock"
      end

      System Info:
      ------------
      chef_version=13.2.20
      platform=ubuntu
      platform_version=14.04
      ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
      program_name=chef-solo worker: ppid=2905;start=09:55:22;
      executable=/opt/chef/bin/chef-solo

    ================================================================================
    Error executing action `start` on resource 'mysql_service[default]'
    ================================================================================

    Mixlib::ShellOut::CommandTimeout
    --------------------------------
    mysql_service_manager_upstart[default] (/home/vagrant/chef-solo/local-mode-cache/cache/cookbooks/mysql/libraries/mysql_service.rb line 50) had an error: Mixlib::ShellOut::CommandTimeout: service[mysql-default] (/home/vagrant/chef-solo/local-mode-cache/cache/cookbooks/mysql/libraries/mysql_service_manager_upstart.rb line 48) had an error: Mixlib::ShellOut::CommandTimeout: Command timed out after 600s:
    Command exceeded allowed execution time, process terminated
    ---- Begin output of /sbin/start mysql-default ----
    STDOUT: 
    STDERR: 
    ---- End output of /sbin/start mysql-default ----
    Ran /sbin/start mysql-default returned 

    Resource Declaration:
    ---------------------
    # In /home/vagrant/chef-solo/local-mode-cache/cache/cookbooks/nw-db/recipes/server.rb

      3: mysql_service 'default' do
      4:   version node['mysql']['version']
      5:   package_name 'mysql-server'
      6:   bind_address '0.0.0.0'
      7:   port '3306'
      8:   data_dir '/var/lib/mysql'
      9:   initial_root_password node['mysql']['server_root_password']
     10:   action [:create, :start]
     11: end

    Compiled Resource:
    ------------------
    # Declared in /home/vagrant/chef-solo/local-mode-cache/cache/cookbooks/nw-db/recipes/server.rb:3:in `from_file'

    mysql_service("default") do
      action [:create, :start]
      updated true
      updated_by_last_action true
      default_guard_interpreter :default
      declared_type :mysql_service
      cookbook_name "nw-db"
      recipe_name "server"
      version "5.7"
      package_name "mysql-server"
      bind_address "0.0.0.0"
      port "3306"
      data_dir "/var/lib/mysql"
      initial_root_password "fazE6aHa"
    end

    System Info:
    ------------
    chef_version=13.2.20
    platform=ubuntu
    platform_version=14.04
    ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
    program_name=chef-solo worker: ppid=2905;start=09:55:22;
    executable=/opt/chef/bin/chef-solo

Recipe: ntp::default
  * service[ntp] action restart
    - restart service service[ntp]
Recipe: ntp::apparmor
  * service[apparmor] action restart
    - restart service service[apparmor]

Running handlers:
[2017-07-20T10:08:14+00:00] ERROR: Running exception handlers
[2017-07-20T10:08:14+00:00] ERROR: Running exception handlers
Running handlers complete
[2017-07-20T10:08:14+00:00] ERROR: Exception handlers complete
[2017-07-20T10:08:14+00:00] ERROR: Exception handlers complete
Chef Client failed. 38 resources updated in 12 minutes 51 seconds
[2017-07-20T10:08:14+00:00] FATAL: Stacktrace dumped to /home/vagrant/chef-solo/local-mode-cache/cache/chef-stacktrace.out
[2017-07-20T10:08:14+00:00] FATAL: Stacktrace dumped to /home/vagrant/chef-solo/local-mode-cache/cache/chef-stacktrace.out
[2017-07-20T10:08:14+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-07-20T10:08:14+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-07-20T10:08:14+00:00] ERROR: mysql_service[default] (nw-db::server line 3) had an error: Mixlib::ShellOut::CommandTimeout: mysql_service_manager_upstart[default] (/home/vagrant/chef-solo/local-mode-cache/cache/cookbooks/mysql/libraries/mysql_service.rb line 50) had an error: Mixlib::ShellOut::CommandTimeout: service[mysql-default] (/home/vagrant/chef-solo/local-mode-cache/cache/cookbooks/mysql/libraries/mysql_service_manager_upstart.rb line 48) had an error: Mixlib::ShellOut::CommandTimeout: Command timed out after 600s:
Command exceeded allowed execution time, process terminated
---- Begin output of /sbin/start mysql-default ----
STDOUT: 
STDERR: 
---- End output of /sbin/start mysql-default ----
Ran /sbin/start mysql-default returned 
[2017-07-20T10:08:14+00:00] ERROR: mysql_service[default] (nw-db::server line 3) had an error: Mixlib::ShellOut::CommandTimeout: mysql_service_manager_upstart[default] (/home/vagrant/chef-solo/local-mode-cache/cache/cookbooks/mysql/libraries/mysql_service.rb line 50) had an error: Mixlib::ShellOut::CommandTimeout: service[mysql-default] (/home/vagrant/chef-solo/local-mode-cache/cache/cookbooks/mysql/libraries/mysql_service_manager_upstart.rb line 48) had an error: Mixlib::ShellOut::CommandTimeout: Command timed out after 600s:
Command exceeded allowed execution time, process terminated
---- Begin output of /sbin/start mysql-default ----
STDOUT: 
STDERR: 
---- End output of /sbin/start mysql-default ----
Ran /sbin/start mysql-default returned 
[2017-07-20T10:08:14+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
[2017-07-20T10:08:14+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
ERROR: RuntimeError: chef-solo failed. See output above.

I think that there is some problem with the upstart file, the start/restart command yield no results, but i can see it running/stopped when checking the status of the same.

vagrant@vagrant-ubuntu-trusty-64:~$ ps aux | grep mysql
mysql     4772  0.0  0.0   4452   760 ?        S    09:56   0:00 /bin/sh /usr/bin/mysqld_safe
mysql     4929  0.1  3.6 1146836 147532 ?      Sl   09:56   0:01 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --log-error=/var/log/mysql/error.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock
root      5157  0.0  0.0   4452   656 ?        Ss   09:56   0:00 /bin/sh -e -c /usr/sbin/mysql-default-wait-ready /bin/sh
root      5158  0.0  0.0   4452   688 ?        S    09:56   0:00 /bin/sh /usr/sbin/mysql-default-wait-ready
vagrant  11669  0.0  0.0  10472   936 pts/0    S+   10:17   0:00 grep --color=auto mysql
vagrant@vagrant-ubuntu-trusty-64:~$ sudo service mysql-default status
mysql-default respawn/post-start, (post-start) process 5157
vagrant@vagrant-ubuntu-trusty-64:~$ sudo service mysql-default stop
^C(Forced killed the above)
vagrant@vagrant-ubuntu-trusty-64:~$ sudo service mysql-default status
mysql-default stop/post-start, (post-start) process 5157
github-actions[bot] commented 4 years ago

Marking stale due to inactivity. Remove stale label or comment or this will be closed in 7 days. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.

ramereth commented 4 years ago

We are no longer supporting Ubuntu 14.04.