-
-
Notifications
You must be signed in to change notification settings - Fork 602
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
Install matching psql/pg_dump client inside ddev-webserver based on postgres version #6083
Comments
Answering to #6139 (comment) in the relevant issue:
There is The current latest version is How to install The SO example needs to be modified to change the |
I'm not sure there's a client package, but if there is this can be great! |
Now that MariaDB has released mariadb-dump/mysqldump versions that are completely incompatible with "traditional" versions, we're going to have to prioritize this. From: https://mariadb.com/kb/en/mariadb-dump/
Basically, all the latest supported patch versions of mysqldump from mariadb are completely incompatible (without workarounds) with the previous patch version. So mariadb-dump/mysqldump 10.6.18's version is incompatible with 10.6.17. What's up with them!!!
|
Indeed mariadb has added sandbox mode, and database backups fail. |
MariaDB Blog about the change to dump file format: https://mariadb.org/mariadb-dump-file-compatibility-change/ |
FYIW - We are mitigating with the following commands on the web container: docker exec -ti ddev-PROJECT-web bash
sudo apt remove mariadb-client -y
sudo curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version="mariadb-10.11"
sudo apt install mariadb-client -y |
Thanks @cristiroma - It would be a lot better as a .ddev/web-build/Dockerfile.mariaclient or something, you wouldn't have to do it all the time. |
I was able to import a file dumped with the new mariadb-dump by deleting the line at the top of the dump that says |
The affected DDEV database images have been pushed with updated mariadb tools, please see
|
Doesn't work anymore:
|
It's working, https://r.mariadb.com/downloads/mariadb_repo_setup was down, but it's fine now. |
The mariadb:10.11 approach described above (from https://mariadb.com/kb/en/mariadb-package-repository-setup-and-usage/) does work currently. However, 10.6 does not work, on either amd64 or arm64 with Debian Bookworm:
And of course, 10.6 is the exact example they provide in their docs. |
However, I'll bet that the mariadb 10.11 client will work for most of the mariadb situations. That's a pretty simple approach. |
mysql has never provided arm64 packages for Debian/Ubuntu, and they still don't. Info about their apt repo is at https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/ Ubuntu does package mysql server for arm, it's conceivable that we can steal the client and its dependencies from a related Ubuntu version. This is how we do mysql server for DDEV, see https://ddev.readthedocs.io/en/stable/developers/release-management/#maintaining-ddev-dbserver-mysql-57-and-80-arm64-images |
It looks like if we want to do the mysql client, we'll have to build from source, https://dev.mysql.com/doc/mysql-installation-excerpt/8.0/en/source-installation.html, as we do for xtrabackup. |
One thing we could do for mariadb is to replace mysqldump and mysql with wrappers that strip |
I think
|
Thanks for testing! If you can please be specific about what the problem is and how to reproduce it, I may be able to help. Otherwise, not. MySQL 8.0 is not compatible with earlier and simpler versions of mysql or mariadb. MySQL 5.6 is mostly. Please describe exactly what the problem is and how to reproduce it. |
@timnolte if you have time, could you make an appointment with me so we could work on this together? We're planning a release for the next day or two, and would love to know what your problem is. https://cal.com/randyfay/30min |
@rfay so here are some more details that I also posted in the HyperDB support forums. To follow up with either MySQl 5.7 or MySQL 8.0 with HyperDB active the following is an example of the sort of error when trying to install a site the very first time.
Without HyperDB active this error doesn't occur. After reactivating HyperDB then there are issues with creating new posts with the following sort of error:
From everything we've seen this doesn't occur with MariaDB versions or AWS Aurora DB versions. When we use MySQL 5.6 none of those above issues occur, however it rendered DB operations with the WP-CLI unusable. We can't use MariaDB locally either because when we attempt to pull/restore from a server backup(which is an AWS Aurora DB backup) we hit errors related to collation. |
I hope you'll make an appointment.
It seems like you're probably on MySQL 5.6 on Aurora and that's the fundamental issue. |
You can find out what you're using on a server with the query |
(I just tried building the mysql 5.6 client for Debian Bookworm and it failed. I think a workaround might be to install the mysql 5.7 client in ddev-webserver when mysql 5.5 or 5.6 is configured.) |
@timnolte I also assume that if you're using mysql 5.6, you must be on an Intel processor, right? DDEV hasn't ever supported Mysql 5.6 on arm64 because Mysql images have never had arm64 for 5.6. |
@timnolte Could you please test the artifacts in |
@rfay so I am on Linux Intel, however, we do have Devs on arm64(macOS M#). So there is that aspect that is going to be at play. |
I know for a fact actually that our Aurora DB is running the MySQL 8.0 engine, which is certainly why we were having issues with attempting to use MariaDB locally. Generally, perform imports from our Aurora DB is working with 5.6/5.7/8.0. |
I'm baffled why you aren't able to use MySQL 8.0 as a database in HEAD then. If you can give explicit results of importing/exporting with database set to mysql:8.0 and using DDEV HEAD it will be appreciated. I don't understand why you were trying to use MariaDB locally in DDEV. |
Testing techniques for validating mysql 8.0 with a db dump from mysql 8.0 @timnolte :
If you can create a db dump that demonstrates the problem (can be a trivial dump) I'll be happy to work with it. |
@rfay so using MariaDB was an initial failure in local project setup, since MariaDB is the default when initializing a new DDev project. This was also for a completely new infrastructure with a new Aurora DB instance that is using the MySQL 8.0 engine. Our legacy infrastructure was using an older Aurora DB instance that was in fact using a MySQL 5.6 engine. We had been quietly succeeding to use MariaDB locally even though we should have been using MySQL locally in DDev all along. It's only this new infrastructure recent local project setups where this issue surfaced. If you want to try and reproduce these issues if you setup a WordPress site, using say MySQL 8.0 as the DB in DDev. Setup the HyperDB plugin which also involves setting up some configuration and either copies or symlink of DB drop-ins for WordPress. At which point you try to run the WordPress web-based install you'll see the errors and failures I mentioned in #6083 (comment) All that being said. I have found that there is a fork of the HyperDB plugin(LudicrousDB) that is more recently maintained by the community and it actually appears to be working with MySQL 8.0 without the issues we've been seeing. I'm using the nightly with the MySQL 5.7/8.0 fixes. So, while I think ultimately DDev using matching clients it a good thing, and things look on track with that, there is a part of this that I think is an issue with HyperDB and not strictly a DDev issue. |
@rfay to clarify the issues we were having with MySQL weren't related to loading in our database dumps, only if we didn't initialize or convert our project from MariaDB. The problem was though that when using MySQL 5.7 or 8.0 we could not start a new project or successfully use WordPress content editing without major issues while having the HyperDB plugin active. We didn't have these problems with MySQL 5.6 or our AuroraDB with MySQL 8.0 instances. |
So from your description your problem has nothing to do with this issue? It's all about you using a non-matching database type in DDEV? If you're using MySQL for server side project, please use MySQL in DDEV. And please use matching version number. |
@rfay so there were 4 issues at play, with 3 of them(2-4) being related to this issue.
|
@rfay Ultimately, I think we will be in better shape if for our projects we move to LudicrousDB and MySQL 8.0, however in order for us to be able to continue to use the WP-CLI for DB operations we will need the fixes related to this issue. So far testing with the MySQL 8.0 fixes here seems to resolve things. I can test the MySQL 5.6 related fix, but to your point MySQL 5.6 is EOL so should we really focus on that right now? |
You get a successful install and then you fail converting? That seems like a normal problem with trying to upgrade from an obsolete version to a current one? Doesn't seem to have to do with DDEV?
I don't think there's anything we can do about that. DDEV's mysql 5.7 and 8.0 are simply running database engines as provided by MySQL.
I'm glad to hear about resolution. Yes, if I were you I wouldn't be making mysql 5.6 a part of the problem or solution, just adds complexity and probably additional pain. I have no idea how any of this could have to do with the client versions in the ddev-webserver though. |
@rfay so yes. Starting a new project with MySQL 5.7 or 8.0. The WordPress install doesn't work and fails to create tables. This is somehow related to HyperDB and collation issues it seems. That being said performing the initial WordPress install(the 5-minute install where you enter in the site name/admin user/etc) while using HyperDB and AuroraDB, or when using HyperDB with MariaDB or MySQL 5.6 locally in DDev, works just fine. However, if we try to initialize a project with DDev and use MySWL 5.7 or 8.0 it won't work. |
HyperDB appears to be very lightly maintained, or perhaps not maintained, and not even tested with current WP versions... We definitely can't solve that. |
@rfay yeah, I mean it's from Automattic, and supposedly used on WordPress.com. Up until now, and at least with MariaDB, it hasn't been an issue. |
I think the final step in this issue is to try to install the matching pg_dump and psql in the web image. |
Renamed this to focus on the remaining psql issues. |
And it's fixed, closing. |
In general, the
mysql
client shipped with the ddev-webserver works fine with all mariadb and mysql back-end databases.However, there are a few cases where their behavior is slightly different.
And the fact that the
mysql
client reports a different version is often confusing to people.For example, with database mysql:8.0 we see these outputs:
The web container has the mariadb version, and the db container has the mysql:8.0 version.
On Craft CMS and perhaps some other places, people have the habit of using the built-in tools; Craft actually calls out to the mysql client (on ddev-webserver) rather than connecting directly to the database server, so this can cause confusion there.
Proposal
Add a layer to the ddev-webserver adding a matching
mysql
client to the ddev-webserver, especially where the database type is mysql:8.0, which is the most likely place for concern.It also might be possible to implement this as an add-on for the few people it matters to. It's tricky getting the proper match between the OS-provided
mysql
client and the ddev-webserver, and it could introduce instabilities.The text was updated successfully, but these errors were encountered: