Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-29260

Server crashes when running migration queries inside Docker on Windows

Details

    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.

      Attachments

        Issue Links

          Activity

            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.

            deniss.kozlovs Deniss Kozlovs added a comment - 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.
            danblack Daniel Black added a comment -

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

            danblack Daniel Black added a comment - Per linked issues what is your exact Windows version reported by winver.exe ?

            Hi, it's 21H2 (build 19044.1826)

            deniss.kozlovs Deniss Kozlovs added a comment - Hi, it's 21H2 (build 19044.1826)
            danblack Daniel Black added a comment -

            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?

            danblack Daniel Black added a comment - 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?
            deniss.kozlovs Deniss Kozlovs added a comment - - edited

            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.
            
            

            deniss.kozlovs Deniss Kozlovs added a comment - - edited 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.

            People

              marko Marko Mäkelä
              deniss.kozlovs Deniss Kozlovs
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.