linuxserver / docker-mariadb

GNU General Public License v3.0
209 stars 44 forks source link

Can't initialize db with files containing queries larger than 20kB #103

Closed kaysond closed 1 year ago

kaysond commented 2 years ago

I'm trying to migrate my Nextcloud db into the mariadb container but it fails with ERROR: 1105 Boostrap file error. Query size exceeded 20000 bytes because I guess there are some large queries. This is may be an upstream "wontfix" because it's been around since at least 2012: https://bugs.mysql.com/bug.php?id=67345

Notably, this issue doesn't occur with the official mariadb image because they load the files differently: https://github.com/MariaDB/mariadb-docker/blob/c0d07be9ad5eb3bc212c6805cc8031308c56e9b6/10.5/docker-entrypoint.sh Speicifcally, they're loading each file one by one via the mysql client's stdin rather than using --init-file.

We are concatenating all the files to a temp file which is then passed in via --init-file which has the query size limitation

https://github.com/linuxserver/docker-mariadb/blob/be172c08b0839199084db02653a66c088ae2484a/root/etc/cont-init.d/40-initialise-db#L79-L82

https://github.com/linuxserver/docker-mariadb/blob/be172c08b0839199084db02653a66c088ae2484a/root/etc/cont-init.d/40-initialise-db#L4-L13

lha-hockey commented 2 years ago

@kaysond I've made a pull request to be able to load large sql files at container startup (located in /config/dump.files.d/*.sql). I hope this will be merged in next release.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

kaysond commented 2 years ago

not stale. @lha-hockey - not seeing any PR?

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

kaysond commented 2 years ago

not stale

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

kaysond commented 2 years ago

not stale. planning on making a PR for this at some point...

AvrumFeldman commented 1 year ago

Came here to report the same issue. ERROR: 1105 Bootstrap file error. Query size exceeded 60000 bytes

@lha-hockey Just confirming, per the documentation the files should be /config/initdb.d not /config/dump.files.d/

I don't know if this will help, but importing the DB via mysql -u <> --password=<> <db_name> < config/initdb.d/db_file.sql does work fine.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.