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

Latest MySQL image deprecated --default-authentication-plugin, database won't start on latest image #1816

Closed
cvharris opened this issue May 2, 2024 · 5 comments
Assignees

Comments

@cvharris
Copy link

cvharris commented May 2, 2024

According to this the latest image of MySQL deprecates the --default-authentication-plugin but not in a nice way. If you try to run vip dev-env create it uses this latest image and the database container never spins up.

This is fixed by following the solution they indicate and replacing the flag with --mysql-native-password=ON

@sjinks sjinks self-assigned this May 6, 2024
@sjinks
Copy link
Member

sjinks commented May 6, 2024

This was fixed in VIP CLI 2.39.4. Please update your VIP CLI and let us know if the issue persists. Thank you!

@cvharris
Copy link
Author

cvharris commented May 6, 2024

That was it, thank you!

@OulipianSummer
Copy link

Dropping in here to say that even after the update to a newer version of VIP CLI I am still observing the issue described here.

I completely uninstalled my old VIP CLI, removed the scaffolding files in ~/.local/share/vip, and then reinstalled v2.39.6.

Even then, when running vip dev-env create the database container that the cli pulls down still has the problematic --default-authentication-plugin flag.

Here is the container config vip downloaded, located at ~/.local/share/vip/lando/compose/{my-dev-env}/database-0.yml

services:
  database:
    image: mysql:8
    command: >-
      docker-entrypoint.sh mysqld
      --sql-mode=ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
      --max_allowed_packet=67M
      --default-authentication-plugin=mysql_native_password
    ports:
      - 127.0.0.1::3306
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: 'true'
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress
      MYSQL_DATABASE: wordpress
      LANDO_NO_USER_PERMS: 1
      LANDO_NO_SCRIPTS: 1
      LANDO_NEEDS_EXEC: 1
    volumes:
      - database_data:/var/lib/mysql
networks: {}
volumes:
  database_data: null
version: '3.6'

When I attempt to start the dev-env, the database container crashes.

2024-05-09 14:35:25 lando 18:35:25.55 INFO  ==> Lando handing off to: docker-entrypoint.sh mysqld --sql-mode=ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION --max_allowed_packet=67M --default-authentication-plugin=mysql_native_password
2024-05-09 14:35:25 lando 18:35:25.55 DEBUG ==> Running command with exec...
2024-05-09 14:35:26 2024-05-09T18:35:26.642961Z 0 [System] [MY-015017] [Server] MySQL Server Initialization - start.
2024-05-09 14:35:26 2024-05-09T18:35:26.644342Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2024-05-09 14:35:26 2024-05-09T18:35:26.644438Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.4.0) initializing of server in progress as process 106
2024-05-09 14:35:26 2024-05-09T18:35:26.655641Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-05-09 14:35:27 2024-05-09T18:35:27.048383Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-05-09 14:35:28 2024-05-09T18:35:28.573447Z 0 [ERROR] [MY-000067] [Server] unknown variable 'default-authentication-plugin=mysql_native_password'.
2024-05-09 14:35:28 2024-05-09T18:35:28.573732Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
2024-05-09 14:35:28 2024-05-09T18:35:28.573744Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-05-09 14:35:30 2024-05-09T18:35:30.407598Z 0 [System] [MY-015018] [Server] MySQL Server Initialization - end.

@sjinks
Copy link
Member

sjinks commented May 10, 2024

This is not correct:

    image: mysql:8

should be

    image: mysql:8.4

What does

grep mysql "$(dirname "$(which vip)")/../lib/node_modules/@automattic/vip/assets/dev-env.lando.template.yml.ejs"

yield?

@OulipianSummer
Copy link

OulipianSummer commented May 10, 2024

      command: docker-entrypoint.sh mysqld --sql-mode=ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION --max_allowed_packet=67M
      image: mysql:8.4
      command: docker-entrypoint.sh mysqld --sql-mode=ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION --max_allowed_packet=67M --mysql-native-password=ON
        - database_data:/var/lib/mysql
    description: "Connect to the DB using mysql client (e.g. allow to run imports)"
      - mysql -hdatabase -uwordpress -pwordpress -Dwordpress

Interesting... so why would Docker be building off of what appears to be an outdated container image when the new one is just chilling there in node_modules?

sjinks added a commit that referenced this issue Jun 20, 2024
fix(dev-env): force pull images on environment version update
@sjinks sjinks closed this as completed Jun 20, 2024
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