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

Various fixes for mysql-docker-compose.yml #7352

Closed
wants to merge 1 commit into from

Conversation

os11k
Copy link

@os11k os11k commented Sep 30, 2024

Let's use MySQL 8, additionally added volume for MySQL for persistent data and restart always for nopcommerce container

@AndreiMaz
Copy link
Member

@os11k Why should it be 8.0 and not the latest?

@os11k
Copy link
Author

os11k commented Oct 1, 2024

Hi @AndreiMaz! First of all, the latest version is 9.0 now and it will change overtime quite often... Version 9.0 isn't even LTS and was just recently released. I think it's always a good idea to include some kind of version number because there are usually significant changes between versions. In this case, for example, the default-authentication-plugin has been removed from MySQL 9 and 8.4. Personally, I think we should stick with 8.0 for now.

@skoshelev
Copy link
Contributor

Hi @os11k!

I understand that these changes may be important and necessary for you. However, all the configuration files for docker-compose are provided exclusively in the minimal configuration for test deployment. I am sure no one will use the default file to deploy production infrastructure. For example, I would change the default password. Therefore, changing and adding other parameters should no longer cause difficulties.

Thank you very much for your suggestions, but I think they will be excessive for our task.

@skoshelev skoshelev closed this Oct 1, 2024
@os11k
Copy link
Author

os11k commented Oct 1, 2024

Hi @skoshelev , main problem is that current docker-compose doesn't work at all... You can't run it, mysql doesn't starts it restarts in the loop because it doesn't know about parameter "default-authentication-plugin", sorry if I didn't explain well from first try. If it would start I would not probably even considered to create PR.

logs from MySQL:

2024-10-01 12:13:10+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 9.0.1-1.el9 started.
2024-10-01 12:13:10+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2024-10-01 12:13:10+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 9.0.1-1.el9 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2024-10-01T12:13:10.964731Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2024-10-01T12:13:11.178454Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 9.0.1) starting as process 1
2024-10-01T12:13:11.189552Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-10-01T12:13:11.596026Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysqld: Table 'mysql.plugin' doesn't exist
2024-10-01T12:13:11.753577Z 0 [ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure.
2024-10-01T12:13:11.754001Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-10-01T12:13:11.754288Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-10-01T12:13:11.754553Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-10-01T12:13:11.754985Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-10-01T12:13:11.755201Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-10-01T12:13:11.755425Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-10-01T12:13:11.755640Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-10-01T12:13:11.810194Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2024-10-01T12:13:11.882363Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2024-10-01T12:13:11.894050Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2024-10-01T12:13:11.894099Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2024-10-01T12:13:11.901653Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2024-10-01T12:13:11.902131Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-10-01T12:13:11.902411Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-001146 - Table 'mysql.component' doesn't exist
2024-10-01T12:13:11.902442Z 0 [Warning] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-003543 - The mysql.component table is missing or has an incorrect definition.
2024-10-01T12:13:11.902641Z 0 [ERROR] [MY-000067] [Server] unknown variable 'default-authentication-plugin=mysql_native_password'.
2024-10-01T12:13:11.903945Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-10-01T12:13:13.460652Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 9.0.1)  MySQL Community Server - GPL.
2024-10-01T12:13:13.460675Z 0 [System] [MY-015016] [Server] MySQL Server - end.

@skoshelev
Copy link
Contributor

skoshelev commented Oct 1, 2024

@os11k, Thank you for reporting the issue, I have created an issue accordingly.

@os11k
Copy link
Author

os11k commented Oct 1, 2024

I would like to add that it will be nice if you can add persistence for MySQL container and nopcommerce_web container, because in reality even in dev environment you do need data persistent... Additionally probably you need to add restart: "always" for nopcommerce_web container, because after initial setup is done, it restarts nopcommerce_web service and without restart: "always" it doesn't starts at all and you finish basically broken state...

Long story short, my small changes fixes all of those small things, what it really helps even if you run this in development only...

Not sure why you so against those changes and not sure about your process, but simple merge of my changes will fix that, without need to open any issue or creating any new tasks.

@AndreiMaz @skoshelev

@skoshelev
Copy link
Contributor

@os11k Your changes may be useful or may not, it all depends on the usage scenario. Again, we deliberately did not overload the configuration, leaving it as simple as possible.

Also, if you run the site through Visual Studio, you'll have to start the site manually, each time after restarting through UI. We deliberately do not enable permanent restart so that the user does not miss the moment when something goes wrong with the container at the debugging stage.

Limiting a specific version of MySql will only delay the solution of the problem, but will not solve it, so I created a task to find a permanent solution.

@os11k
Copy link
Author

os11k commented Oct 1, 2024

Again we can discuss MySQL version separately and I will explain it below, but for dev environment you must have persistent data, and if you don't why you even created nopcommerce_data: volume if it is not used anywhere, that doesn't look great... Additionally restart: "always", will not hurt to nopcommerce_web container container, why you don't want it there if it is already for MySQL container.

Additionally I don't get your argument about overloading the configuration, it is just adds 6 lines of code and makes completely different impression for your software, because now it all works, from first start. But if you don't want that, fine for me.

Regarding MySQL version, I'm not MySQL admin, but there is a reason why other projects do tie their project to specific version, just because every version provides some breaking changes which will not be compatible with older version and it is always a good design to have some major version configured. Using "latest" version of MySQL container is just bad solution.

P.S. I'm fine if you don't accept my changes and frankly I don't really care. Problem is that one user who wanted to use your solution came to me because he wasn't able to use this docker-compose file out of the box and he was not so techie as me, I helped him to fixed that and I made as less changes to your file as possible and I hoped that it would help others, that why I created this PR. But seems you are not appreciating any PRs, you don't appreciate other works, because I did spend time on this, I did tried to run and make it work, I did test it. This in my opinion is not a great look for any open source project.

Have a nice day, bye!

@skoshelev @AndreiMaz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants