[MDEV-29260] Server crashes when running migration queries inside Docker on Windows Created: 2022-08-05  Updated: 2022-09-11

Status: Open
Project: MariaDB Server
Component/s: Data Definition - Alter Table, Docker, Storage Engine - InnoDB
Affects Version/s: 10.3.34, 10.8.3
Fix Version/s: 10.3

Type: Bug Priority: Major
Reporter: Deniss Kozlovs Assignee: Daniel Black
Resolution: Unresolved Votes: 0
Labels: innodb
Environment:

Docker 4.11.1 on Windows 10, WSL2 backend, Ubuntu 20.04


Attachments: Text File log.txt    
Issue Links:
Relates
relates to MDEV-28580 Server crash when creating an index a... Closed
relates to MDEV-29015 InnoDB: Assertion failure in file /ho... Closed

 Description   

I have a Laravel application inside Docker container, which crashes when trying to run migrations.
docker-compose.yml:

mysql:
    container_name: web__mysql
    build:
      context: .
      dockerfile: ./.docker/services/mysql/Dockerfile
    restart: unless-stopped
    tty: true
    ports:
      - "3306:3306"
    volumes:
      - ./.docker/services/mysql/data:/var/lib/mysql
    environment:
      MARIADB_DATABASE: db
      MARIADB_USER: web
      MARIADB_PASSWORD: password
      MARIADB_ROOT_PASSWORD: root
      SERVICE_TAGS: dev
      SERVICE_NAME: mysql
      TZ: Europe/Riga
    networks:
      - app

Dockerfile:

FROM mariadb:latest
ENV TZ=Europe/Riga
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

No matter which version I pick, everytime i run migrations, the database server crashes with this error:

InnoDB: preallocating 147456 bytes for file ./db/events_places.ibd failed with error 2

This always happens on this query:

alter table `events_places` add unique `events_places_place_id_event_id_unique`(`place_id`, `event_id`))

If you need all queries that were run before that, I can provide. In attachment there is log from Docker terminal.



 Comments   
Comment by Deniss Kozlovs [ 2022-08-05 ]

Update. I switched to Hyper-V (disabled WSL2 backend in Docker settings) and problem went away. I guess then this is not problem with MariaDB itself.

Comment by Daniel Black [ 2022-08-06 ]

Per linked issues what is your exact Windows version reported by winver.exe?

Comment by Deniss Kozlovs [ 2022-08-06 ]

Hi, it's 21H2 (build 19044.1826)

Comment by Daniel Black [ 2022-08-09 ]

Same version I did my tests on. Are you updating your linux kernel version in Windows update (disabled by default)? If so what does the uname -a results show. If not did it help?

Comment by Deniss Kozlovs [ 2022-08-09 ]

uname -a shows

Linux DESKTOP-248G439 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

I followed linux kernel version link and seems like it's the latest version:

PS C:\Windows\system32> dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
 
Deployment Image Servicing and Management tool
Version: 10.0.19041.844
 
Image Version: 10.0.19044.1865
 
Enabling feature(s)
[==========================100.0%==========================]
The operation completed successfully.
PS C:\Windows\system32> wsl --set-default-version 2
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
The operation completed successfully.

Generated at Thu Feb 08 10:07:07 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.