{"action":"created","issue":{"url":"https://api.github.com/repos/chef-cookbooks/mysql/issues/466","repository_url":"https://api.github.com/repos/chef-cookbooks/mysql","labels_url":"https://api.github.com/repos/chef-cookbooks/mysql/issues/466/labels{/name}","comments_url":"https://api.github.com/repos/chef-cookbooks/mysql/issues/466/comments","events_url":"https://api.github.com/repos/chef-cookbooks/mysql/issues/466/events","html_url":"https://github.com/chef-cookbooks/mysql/issues/466","id":175559714,"number":466,"title":"mysql-server-5.7.postinst fails after running apt-get upgrade","user":{"login":"sauberia","id":99816,"avatar_url":"https://avatars.githubusercontent.com/u/99816?v=3","gravatar_id":"","url":"https://api.github.com/users/sauberia","html_url":"https://github.com/sauberia","followers_url":"https://api.github.com/users/sauberia/followers","following_url":"https://api.github.com/users/sauberia/following{/other_user}","gists_url":"https://api.github.com/users/sauberia/gists{/gist_id}","starred_url":"https://api.github.com/users/sauberia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sauberia/subscriptions","organizations_url":"https://api.github.com/users/sauberia/orgs","repos_url":"https://api.github.com/users/sauberia/repos","events_url":"https://api.github.com/users/sauberia/events{/privacy}","received_events_url":"https://api.github.com/users/sauberia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-09-07T17:21:41Z","updated_at":"2016-10-27T19:55:52Z","closed_at":null,"body":"### Cookbook version\r\n7.1.1\r\n\r\n### Chef-client version\r\n12.10.24\r\n\r\n### Platform Details\r\nUbuntu 16.04.1 LTS\r\n\r\n### Scenario:\r\nAttempt to upgrade the mysql-server-5.7 package\r\n\r\n### Steps to Reproduce:\r\n\r\nMy recipe is as follows:\r\n\r\n````ruby\r\n  mysql_service 'default' do\r\n    initial_root_password 'changeme'\r\n    action [:create, :start]\r\n  end\r\n\r\n  mysql_client 'default' do\r\n    action :create\r\n  end\r\n````\r\n\r\nThis all worked as expected.\r\n\r\nA few weeks later I ran apt-get upgrade which didn't complete as the mysql-server-5.7.postinst  script fails.\r\n\r\n### Expected Result:\r\nThe mysql-server-5.7 package is successfully upgraded.\r\n\r\n### Actual Result:\r\n\r\nmysql-server-5.7.postinst fails during the upgrade process with the following output:\r\n\r\n````\r\n  + mysql_upgrade --defaults-file=/etc/mysql/debian.cnf\r\n  mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) while connecting to the MySQL server\r\n  Upgrade process encountered error and will not continue.\r\n  + result=11\r\n  + '[' 11 -ne 0 -a 11 -ne 2 ']'\r\n  + echo 'mysql_upgrade failed with exit status 11'\r\n  mysql_upgrade failed with exit status 11\r\n  + exit 1\r\n  dpkg: error processing package mysql-server-5.7 (--configure):\r\n   subprocess installed post-installation script returned error exit status 1\r\n  Errors were encountered while processing:\r\n   mysql-server-5.7\r\n  E: Sub-process /usr/bin/dpkg returned an error code (1)\r\n````\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/chef-cookbooks/mysql/issues/comments/256751596","html_url":"https://github.com/chef-cookbooks/mysql/issues/466#issuecomment-256751596","issue_url":"https://api.github.com/repos/chef-cookbooks/mysql/issues/466","id":256751596,"user":{"login":"wilb","id":1706106,"avatar_url":"https://avatars.githubusercontent.com/u/1706106?v=3","gravatar_id":"","url":"https://api.github.com/users/wilb","html_url":"https://github.com/wilb","followers_url":"https://api.github.com/users/wilb/followers","following_url":"https://api.github.com/users/wilb/following{/other_user}","gists_url":"https://api.github.com/users/wilb/gists{/gist_id}","starred_url":"https://api.github.com/users/wilb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilb/subscriptions","organizations_url":"https://api.github.com/users/wilb/orgs","repos_url":"https://api.github.com/users/wilb/repos","events_url":"https://api.github.com/users/wilb/events{/privacy}","received_events_url":"https://api.github.com/users/wilb/received_events","type":"User","site_admin":false},"created_at":"2016-10-27T19:55:52Z","updated_at":"2016-10-27T19:55:52Z","body":"OK, had to get dirty to make this work. Apparmor definitely wasn't helping matters either.\r\n\r\n```apt install apparmor-utils\r\naa-complain /usr/sbin/mysqld\r\ncd /tmp/\r\napt-get download mysql-server-5.7\r\ndpkg --unpack mysql-server-5.7_5.7.16-0ubuntu0.16.04.1_amd64.deb\r\nrm /var/lib/dpkg/info/mysql-server-5.7.postinst\r\ndpkg --configure mysql-server-5.7\r\nservice mysql-default restart```\r\n\r\n```Welcome to the MySQL monitor.  Commands end with ; or \\g.\r\nYour MySQL connection id is 15\r\nServer version: 5.7.16-0ubuntu0.16.04.1 (Ubuntu)```\r\n\r\nGiven the cookbook avoids the packaged installation mechanisms as much as possible I don't think there is too much harm in not having the postinst script run on a minor increment."}}
{"actor":{"display_login":"wilb"}}