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

Custom mysql / mariadb cnf file prevent container restart #1541

Closed
cmonard opened this issue Apr 18, 2019 · 3 comments
Closed

Custom mysql / mariadb cnf file prevent container restart #1541

cmonard opened this issue Apr 18, 2019 · 3 comments
Labels
Prioritized We expect to do this in an upcoming release

Comments

@cmonard
Copy link

cmonard commented Apr 18, 2019

When providing custom mysql configuration in :
.ddev/mysql/myconf.cnf

The file is used on first start, but when you stop+start / restart ddev, the db container can't start cause it's unable to overwrite the custom file.
If you connect db container :
ddev ssh --service=db
and try to list mysql conf.d directory you will notice the file in 444 mode :
ls -al /etc/mysql/conf.d/myconf.cnf
will output (for example) :
-r--r--r-- 1 uid_501 gid_20 175 Apr 17 08:31 myconf.cnf

Steps to reproduce the behavior:

  1. Add special configuration for mysql
  2. Start then Stop ddev
  3. Start again and...
  4. See error

Version and configuration information (please complete the following information):

  • Host computer OS and Version: macOS Mojave - 10.14.4
  • Docker version information: 18.09.2
  • ddev version information: v1.7.1
  • config.yaml contents for the misbehaving project: no modification from default file
@rfay
Copy link
Member

rfay commented Apr 18, 2019

Thanks for this report, somebody noticed that and pointed out in slack the other day, maybe you.

The very simple workaround is use the superior ddev rm && ddev start and it will be OK.

I still think we should fix this.

@rfay rfay added the Prioritized We expect to do this in an upcoming release label Apr 18, 2019
@rfay
Copy link
Member

rfay commented Apr 18, 2019

One mitigating factor is that as things look right now, in the next release, ddev restart will not cause this problem, and neither will ddev stop && ddev start. However, ddev pause && ddev start still would (next release)

@RobertLang
Copy link

I can confirm that this error happens under the same versions of MacOS, docker and docker-compose as above when using ddev restart.
ddev rm && ddev start fixes the error.

It seems to be some sort of file permission issue as the log shows following:

++ echo /mnt/ddev_config/mysql/no_utf8mb4.cnf /mnt/ddev_config/mysql/nostrict.cnf
+ '[' -d /mnt/ddev_config/mysql -a '/mnt/ddev_config/mysql/no_utf8mb4.cnf /mnt/ddev_config/mysql/nostrict.cnf' '!=' '/mnt/ddev_config/mysql/*.cnf' ']'
+ cp /mnt/ddev_config/mysql/no_utf8mb4.cnf /mnt/ddev_config/mysql/nostrict.cnf /etc/mysql/conf.d
cp: cannot create regular file '/etc/mysql/conf.d/no_utf8mb4.cnf': Permission denied
cp: cannot create regular file '/etc/mysql/conf.d/nostrict.cnf': Permission denied

@rfay rfay changed the title Custom mysql / mariadb cnf file prevent container reboot Custom mysql / mariadb cnf file prevent container restart May 1, 2019
rfay added a commit to rfay/ddev that referenced this issue May 1, 2019
@rfay rfay closed this as completed in 980cb5c May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Prioritized We expect to do this in an upcoming release
Projects
None yet
Development

No branches or pull requests

3 participants