saltstack-formulas / mysql-formula

Install the MySQL client and/or server
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
85 stars 366 forks source link

fix(ubuntu18): correct package names #249

Closed noelmcloughlin closed 4 years ago

noelmcloughlin commented 4 years ago

PR progress checklist (to be filled in by reviewers)


What type of PR is this?

Primary type

Secondary type

Does this PR introduce a BREAKING CHANGE?

No.

Related issues and/or pull requests

Describe the changes you're proposing

Fix failed states on Ubuntu 18.04

vagrant@ubuntu1804:~$ sudo apt-get install mariadb-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mariadb-server : Depends: mariadb-server-10.1 (>= 1:10.1.44-0ubuntu0.18.04.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

vagrant@ubuntu1804:~$ sudo apt-get install mariadb-client
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mariadb-client : Depends: mariadb-client-10.1 (>= 1:10.1.44-0ubuntu0.18.04.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Pillar / config required to test the proposed changes

Debug log showing how the proposed changes work

vagrant@ubuntu1804:~$ sudo apt-get install mariadb-server-10.1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libevent-core-2.1-6 python3-crypto python3-keyring python3-keyrings.alt python3-lazr.uri python3-oauth
  python3-secretstorage python3-wadllib python3-wheel
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  mariadb-client-10.1 mariadb-client-core-10.1 mariadb-server-core-10.1
Suggested packages:
  mariadb-test tinyca
The following packages will be REMOVED:
  mysql-client-5.7 mysql-client-core-5.7 mysql-server mysql-server-5.7 mysql-server-core-5.7
The following NEW packages will be installed:
  mariadb-client-10.1 mariadb-client-core-10.1 mariadb-server-10.1 mariadb-server-core-10.1
0 upgraded, 4 newly installed, 5 to remove and 14 not upgraded.
Need to get 0 B/20.5 MB of archives.
After this operation, 16.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.

vagrant@ubuntu1804:~$ sudo apt-get install mariadb-client-10.1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  galera-3 libevent-core-2.1-6 mysql-server-core-5.7 python3-crypto python3-keyring python3-keyrings.alt
  python3-lazr.uri python3-oauth python3-secretstorage python3-wadllib python3-wheel socat
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  mariadb-client-core-10.1
The following packages will be REMOVED:
  mysql-client-5.7 mysql-client-core-5.7 mysql-server mysql-server-5.7
The following NEW packages will be installed:
  mariadb-client-10.1 mariadb-client-core-10.1
0 upgraded, 2 newly installed, 4 to remove and 14 not upgraded.
Need to get 0 B/10.4 MB of archives.
After this operation, 40.1 MB disk space will be freed.
Do you want to continue? [Y/n] n
Abort.

Documentation checklist

Testing checklist

Additional context

pull-assistant[bot] commented 4 years ago
Score: 1.00

Best reviewed: commit by commit


Optimal code review plan

     fix(ubuntu18): correct mariadb package names

Powered by Pull Assistant. Last update 11e7c67 ... 11e7c67. Read the comment docs.

noelmcloughlin commented 4 years ago

Ubuntu 18.04

local:
----------
          ID: mysql_debconf_utils
    Function: pkg.installed
        Name: debconf-utils
      Result: True
     Comment: All specified packages are already installed
     Started: 23:54:10.494614
    Duration: 73.687 ms
     Changes:   
----------
          ID: mysql_debconf
    Function: debconf.set
        Name: mariadb-server-10.1
      Result: True
     Comment: 
     Started: 23:54:10.568789
    Duration: 274.391 ms
     Changes:   
              ----------
              mariadb-server-10.1/start_on_boot:
                  true
----------
          ID: mysql_password_debconf
    Function: debconf.set
        Name: mysql-server
      Result: True
     Comment: All specified answers are already set
     Started: 23:54:10.843587
    Duration: 136.097 ms
     Changes:   
----------
          ID: mysqld-packages
    Function: pkg.installed
        Name: mariadb-server-10.1
      Result: True
     Comment: The following packages were installed/updated: mariadb-server-10.1
     Started: 23:54:10.980109
    Duration: 283806.283 ms
     Changes:   
              ----------
              mariadb-client-10.1:
                  ----------
                  new:
                      1:10.1.44-0ubuntu0.18.04.1
                  old:
              mariadb-client-core-10.1:
                  ----------
                  new:
                      1:10.1.44-0ubuntu0.18.04.1
                  old:
              mariadb-server-10.1:
                  ----------
                  new:
                      1:10.1.44-0ubuntu0.18.04.1
                  old:
              mariadb-server-core-10.1:
                  ----------
                  new:
                      1:10.1.44-0ubuntu0.18.04.1
                  old:
              mysql-client-5.7:
                  ----------
                  new:
                  old:
                      5.7.31-0ubuntu0.18.04.1
              mysql-client-core-5.7:
                  ----------
                  new:
                  old:
                      5.7.31-0ubuntu0.18.04.1
              mysql-server:
                  ----------
                  new:
                  old:
                      5.7.31-0ubuntu0.18.04.1
              mysql-server-5.7:
                  ----------
                  new:
                  old:
                      5.7.31-0ubuntu0.18.04.1
              mysql-server-core-5.7:
                  ----------
                  new:
                  old:
                      5.7.31-0ubuntu0.18.04.1
----------
          ID: mysql_config
    Function: file.managed
        Name: /etc/mysql/my.cnf
      Result: True
     Comment: File /etc/mysql/my.cnf is in the correct state
     Started: 23:58:54.788652
    Duration: 61.724 ms
     Changes:   
----------
          ID: mysql_python
    Function: pkg.installed
        Name: python3-mysqldb
      Result: True
     Comment: All specified packages are already installed
     Started: 23:58:54.852890
    Duration: 792.016 ms
     Changes:   
----------
          ID: mysql_additional_config
    Function: file.managed
        Name: /usr/my.cnf
      Result: True
     Comment: File /usr/my.cnf is not present and is not set for creation
     Started: 23:58:55.646203
    Duration: 1.614 ms
     Changes:   
----------
          ID: mysqld-service-running
    Function: service.running
        Name: mysql
      Result: True
     Comment: Service mysql is already enabled, and is running
     Started: 23:58:55.648040
    Duration: 160.109 ms
     Changes:   
              ----------
              mysql:
                  True
----------
          ID: mysql_what_is_status_of_mysql
    Function: cmd.run
        Name: service mysql status
      Result: True
     Comment: State was not run because onfail req did not change
     Started: 23:58:55.811222
    Duration: 0.004 ms
     Changes:   

Summary for local
------------
Succeeded: 9 (changed=3)
Failed:    0
------------
Total states run:     9
Total run time: 285.306 s
javierbertoli commented 4 years ago

@noelmcloughlin, in Debian's family, mariadb-server is a meta-package that depends on the current version of mariadb-server-* so it should pick the correct version for the configured distro target.

I've seen the situation you describe happening when you have more than one target distro (ie, stable, testing at the same time, in Debian) but the pinning/preferences are not properly configured. Might this be the situation here?

I find it weird that, having a single distro target configured, Ubuntu's packages fail its mariadb-server -> mariadb-server-XX.yy dependencies management.

What does

apt policy mariadb-server

and

apt search mariadb-server

return?

noelmcloughlin commented 4 years ago

I noticed I was using Ubuntu 18.04 Generic but maybe that image is unsuitable for MySQL server.

vagrant@ubuntu1804:~$ dpkg --get-selections | grep linux-image | grep -v deinstall
linux-image-4.15.0-112-generic          install
linux-image-4.15.0-76-generic           install
linux-image-generic             install

I'm downloading the 18.04 server image and will try that instead.

noelmcloughlin commented 4 years ago

The original issue was on generic/ubuntu1804 vagrant image. Not replicated on ubuntu 18.04 Server image.
Maybe installing MySQL on Ubuntu 18.04 desktop can result in issues?

javierbertoli commented 4 years ago

I don't think mariadb/mysql packages differ for the flavour(?) of Ubuntu (Server/Generic) for the same distro release (18.04)?

Just to confirm, I created a vagrant generic/ubuntu1804 box and trying to install the mariadb-server package, it tries to do the 'Right Thing (TM)':

# apt update
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
...
...

# apt install mariadb-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  galera-3 libaio1 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libencode-locale-perl libfcgi-perl libhtml-parser-perl
  libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl libjemalloc1 liblwp-mediatypes-perl libmysqlclient20 libterm-readkey-perl
  libtimedate-perl liburi-perl mariadb-client-10.1 mariadb-client-core-10.1 mariadb-common mariadb-server-10.1 mariadb-server-core-10.1 mysql-common socat
Suggested packages:
  libclone-perl libmldbm-perl libnet-daemon-perl libsql-statement-perl libdata-dump-perl libipc-sharedcache-perl libwww-perl mailx mariadb-test tinyca
The following NEW packages will be installed:
  galera-3 libaio1 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libencode-locale-perl libfcgi-perl libhtml-parser-perl
  libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl libjemalloc1 liblwp-mediatypes-perl libmysqlclient20 libterm-readkey-perl
  libtimedate-perl liburi-perl mariadb-client-10.1 mariadb-client-core-10.1 mariadb-common mariadb-server mariadb-server-10.1 mariadb-server-core-10.1 mysql-common socat
0 upgraded, 29 newly installed, 0 to remove and 11 not upgraded.
Need to get 24.1 MB of archives.
After this operation, 184 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
...
...
# apt install mariadb-client
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libaio1 libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libjemalloc1 libmysqlclient20 libterm-readkey-perl mariadb-client-10.1 mariadb-client-core-10.1
  mariadb-common mysql-common
Suggested packages:
  libclone-perl libmldbm-perl libnet-daemon-perl libsql-statement-perl
The following NEW packages will be installed:
  libaio1 libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libjemalloc1 libmysqlclient20 libterm-readkey-perl mariadb-client mariadb-client-10.1
  mariadb-client-core-10.1 mariadb-common mysql-common
0 upgraded, 12 newly installed, 0 to remove and 11 not upgraded.
Need to get 12.1 MB of archives.
After this operation, 76.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] 

Can it be possibly an issue with the image you was using in the first place?

noelmcloughlin commented 4 years ago

closing as probably not needed.

noelmcloughlin commented 4 years ago

Can it be possibly an issue with the image you was using in the first place?

Hi @javierbertoli I missed this. Thanks for trying to replicate and failing ;-). I was using generic/ubuntu1804 working with some big stacks so I probably uncovered some bug situation which is hard to replicate. I'm happy to close this for now.