InnoDB: preallocating 147456 bytes for file XXX.ibd failed with error 2
Asked Answered
H

2

5

I'm using official MariadDB 10.7 docker image, Windows 10. Had this error started today that kept repeating, tried everything:

- mysqlcheck -Ar
- delete docker image with all the data
- chkdsk -F
- dump and restore of table
- change MariaDB version
- different PC configs (nvme -> SSD)
Hube answered 20/1, 2022 at 10:19 Comment(2)
Sounds like the disk space allocated for the VM is too small.Contango
Is there any other switch apart from "storage-opts": ["size=50GB"] to control this space?Hube
H
11

After long long reading of every related bug on MariaDB bug trackers I did one change in Docker environment:

- disable WSL2, switch to Hyper-V

And voila, started working.

Now, interesting part is, coworker had same problem, but had WSL2 already disabled, and his problem was fixed with ENABLING WSL2.

So I guess, while changing operation between WSL2 and Hyper-V, something is done, that gets corrupted while using image and it reset with this switch.

ATM I don't have time to switch back to WSL2 to confirm my assumption. When I find some time, I'll update this post.

UPDATE: couldn't find the solution with container's config, so I tried older versions of MariaDB docker container and it started working on version 10.3.9. For now, I'm going to be using this version until I find some more time to go to MariaDB's Jira and report error there.

Hube answered 20/1, 2022 at 10:19 Comment(5)
Rolling back to version 10.3.9 is the only thing worked for me! Thanks )Anchusin
As @UmurKaragöz rolling back to version 10.3.9 solved the problem, thanks. Did not test wsl solution. In version 10.3.38 the problem still exist.Meyers
@Hube did you open the bug?Meyers
No, I didnt have time at the time of this bug, we simply are using specific version that works.Hube
In my case, the problem where mounted windows foldersGorgonian
D
1

I was having the same issue when running MariaDB 10.6.3 with the following docker run command:

docker run -d --name mariadb --restart always -e MYSQL_ROOT_PASSWORD=develop -e MYSQL_DATABASE=YourDatabaseHere -e MYSQL_USER=develop -e MYSQL_PASSWORD=develop -v C:\some-path\dev-data\mysql:/var/lib/mysql -p 3306:3306 mariadb:10.6.3

I narrowed it down to an issue with the mapped volume. I resolved the issue by using a named volume:

docker volume create myvolume

With the volume created, my new docker run looked like:

docker run -d --name mariadb --restart always -e MYSQL_ROOT_PASSWORD=develop -e MYSQL_DATABASE=YourDatabaseHere -e MYSQL_USER=develop -e MYSQL_PASSWORD=develop -v myvolume:/var/lib/mysql -p 3306:3306 mariadb:10.6.3
Dylandylana answered 12/11, 2023 at 1:49 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.