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

Add mariadb-client MARIADB_MAX_ALLOWED_PACKET variable. #1375

Merged
merged 12 commits into from Feb 1, 2020

Conversation

@steveworley
Copy link
Contributor

steveworley commented Nov 5, 2019

The MySQL client also has a configuration value for max_allowed_packet and this can be different from the server (which in our case is 64M). This is currently using the default value of 16M. This causes issues when performing MySQL operations directly against the DB (PHP relies on the server configuration and is not subject to this problem), specifically mysqldump (drush sql-dump). If a row is inserted that is higher than the 16M default, the mysql client cannot retrieve the value.

Changelog Entry

Improvement - Allow client max_allowed_packet to be configured by an environment variable. (#1374 )

Closing issues

Closes #1374

Steve Worley
- Adds mariadb-client.cnf to the php-cli container.

Fixes #1374
@Schnitzel

This comment has been minimized.

Copy link
Member

Schnitzel commented Nov 18, 2019

that's a great addition, thanks @steveworley

I don't think though this will work right now, as the file mariadb-client.cnf will end up with having ${MARIADB_MAX_ALLOWED_PACKET:-64M} inside the file. In order to do this correctly we need to envplate this file, here an example:
https://github.com/amazeeio/lagoon/blob/master/images/php/fpm/entrypoints/70-php-config.sh

also we would need a documentation in here for this: https://lagoon.readthedocs.io/en/latest/using_lagoon/docker_images/php-cli/

steveworley and others added 2 commits Dec 2, 2019
steveworley
- Updates the documentation.
- Adds a envplate script.
- Modifies dockerfile to copy the script into the entrypoints.
@tobybellwood

This comment has been minimized.

Copy link
Contributor

tobybellwood commented Dec 2, 2019

If there's no issue with the entrypoint ordering (I don't think so) - can we renumber this entrypoint to keep the amazeeio-provided entrypoints to <100 - just in case anyone else is adding entrypoints to our images downstream?

cli-drupal:/lagoon/entrypoints$ ls -a /lagoon/entrypoints | sort
.
..
00-umask.sh
05-ssh-key.sh
10-passwd.sh
10-ssh-agent.sh
50-dotenv.sh
50-ssmtp.sh
55-cli-helpers.sh
55-generate-env.sh
60-php-xdebug.sh
61-php-xdebug-cli-env.sh
70-php-config.sh
71-php-newrelic.sh
80-shell-timeout.sh
90-composer-path.sh
90-cronjobs.sh
@steveworley

This comment has been minimized.

Copy link
Contributor Author

steveworley commented Dec 2, 2019

Sure - I didn't know if there was a naming convention there and I looked through the mariadb image and it was using 200 for the envplate so I just assumed that would be okay.

https://github.com/amazeeio/lagoon/tree/master/images/mariadb/entrypoints

images/php/cli/Dockerfile Outdated Show resolved Hide resolved
steveworley and others added 2 commits Dec 3, 2019
Co-Authored-By: Michael Schmid <michael@amazee.com>
Schnitzel added 2 commits Dec 3, 2019
@Schnitzel

This comment has been minimized.

Copy link
Member

Schnitzel commented Dec 6, 2019

so this fails because the CLI pod cannot be started anymore:

jenkins@ax51-2:/home/michael.schmid$ oc logs -f pod/cli-1-swhkf
Agent pid 20
Identity added: /home/.ssh/key ((unnamed))
2019/12/06 17:18:50 [ ERROR ] Error while parsing '/etc/my.cnf.d/mariadb-server.cnf': open /etc/my.cnf.d/mariadb-server.cnf: permission denied

we need to run a fix-permissions after copying files into Dockerfiles that we want to envplate, an example:
https://github.com/amazeeio/lagoon/blob/master/images/mariadb/Dockerfile#L58-L60

@steveworley
can you add an

RUN fix-permissions /etc/my.cnf.d/

after you copied stuff into /etc/my.cnf.d/ inside the Dockerfile?

@Schnitzel Schnitzel modified the milestones: v1.2.0, v1.3.0 Dec 6, 2019
steveworley added 2 commits Jan 29, 2020
@Schnitzel Schnitzel merged commit 589d493 into amazeeio:master Feb 1, 2020
1 check passed
1 check passed
continuous-integration/jenkins/pr-merge This commit looks good
Details
@tobybellwood tobybellwood changed the title Add mariadb-client configuraiton. Add mariadb-client MARIADB_MAX_ALLOWED_PACKET variable. Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.