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

Fix: Drupal solution: MySQL deployment error due MYSQL_USER #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lyoum
Copy link

@lyoum lyoum commented May 4, 2022

MySQL deployment pod error while using existing drupal-mysql.yaml config.

There seems no MYSQL_USER anymore at secret.

image

PS. This seems to be a problem with a newer docker version because this used to work before and not throw an error.
Docker PR: docker-library/mysql#749

controlplane $ kubectl get pods
NAME                            READY   STATUS    RESTARTS   AGE
drupal-865b5f5594-hz7rz         1/1     Running   0          18m
drupal-mysql-77d6988c7b-x9czh   0/1     Error     4          113s
Events:
  Type     Reason     Age                From               Message
  ----     ------     ----               ----               -------
  Normal   Scheduled  41s                default-scheduler  Successfully assigned default/drupal-mysql-77d6988c7b-cx6c6 to node01
  Normal   Pulled     22s (x3 over 40s)  kubelet, node01    Container image "mysql:5.7" already present on machine
  Normal   Created    21s (x3 over 40s)  kubelet, node01    Created container mysql
  Normal   Started    21s (x3 over 40s)  kubelet, node01    Started container mysql
  Warning  BackOff    10s (x4 over 38s)  kubelet, node01    Back-off restarting failed container

Logs

controlplane $ kubectl logs -f drupal-mysql-77d6988c7b-cx6c6
2022-05-04 03:43:20+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.38-1debian10 started.
2022-05-04 03:43:20+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-05-04 03:43:20+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.38-1debian10 started.
2022-05-04 03:43:20+00:00 [ERROR] [Entrypoint]: MYSQL_USER="root", MYSQL_USER and MYSQL_PASSWORD are for configuring a regular user and cannot be used for the root user
    Remove MYSQL_USER="root" and use one of the following to control the root user password:
    - MYSQL_ROOT_PASSWORD
    - MYSQL_ALLOW_EMPTY_PASSWORD
    - MYSQL_RANDOM_ROOT_PASSWORD

Solution

  • Removed MYSQL_USER lines in drupal-mysql.yaml

Refer
mysql-docker-container-keeps-restarting

MySQL deployment pod error while using config
```
controlplane $ kubectl get pods
NAME                            READY   STATUS    RESTARTS   AGE
drupal-865b5f5594-hz7rz         1/1     Running   0          18m
drupal-mysql-77d6988c7b-x9czh   0/1     Error     4          113s
```

``` kubectl describe pod <podName>
Events:
  Type     Reason     Age                From               Message
    ----     ------     ----               ----               -------
      Normal   Scheduled  41s                default-scheduler
      Successfully assigned default/drupal-mysql-77d6988c7b-cx6c6 to
      node01
        Normal   Pulled     22s (x3 over 40s)  kubelet, node01
	Container image "mysql:5.7" already present on machine
	  Normal   Created    21s (x3 over 40s)  kubelet, node01
	  Created container mysql
	    Normal   Started    21s (x3 over 40s)  kubelet, node01
	    Started container mysql
	      Warning  BackOff    10s (x4 over 38s)  kubelet, node01
	      Back-off restarting failed container
	     ```
``` logs
controlplane $ kubectl logs -f drupal-mysql-77d6988c7b-cx6c6
2022-05-04 03:43:20+00:00 [Note] [Entrypoint]: Entrypoint script for
MyS43:20+00:00 [Note] [Entrypoint]: Switching to dediQL Server
5.7.38-1debian10 started.
2022-05-04 03:cated user 'mysql'
2022-05-04 03:43:20+00:00 [Note] [Entrypoint]: Entrypoint script for
MySQL Server 5.7.38-1debian10 started.
2022-05-04 03:43:20+00:00 [ERROR] [Entrypoint]: MYSQL_USER="root",
MYSQL_USER and MYSQL_PASSWORD are for configuring a regular user and
cannot be used for the root user
    Remove MYSQL_USER="root" and use one of the following to control the
    root user password:
        - MYSQL_ROOT_PASSWORD
	    - MYSQL_ALLOW_EMPTY_PASSWORD
	        - MYSQL_RANDOM_ROOT_PASSWORD
		```

- Removed MYSQL_USER lines in drupal-mysql.yaml

> Refer
[mysql-docker-container-keeps-restarting](https://stackoverflow.com/a/66910240)
@lyoum lyoum changed the title Fix: MySQL deployment error due MYSQL_USER Fix: Drupal solution: MySQL deployment error due MYSQL_USER May 4, 2022
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

Successfully merging this pull request may close these issues.

None yet

1 participant