mssql-docker icon indicating copy to clipboard operation
mssql-docker copied to clipboard

Docker mssql-server-linux crash when mounting a volume

Open SebastianPfliegel opened this issue 9 years ago • 110 comments

Setup:

Host-OS: Windows 10 Docker: 17.06.0-ce

Command:

docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=strong1Pass!' -e 'MSSQL_PID=Developer' --cap-add SYS_PTRACE -p 1433:1433 -v c:/users/pfliegel.sebastian/docker_vol/mssql:/var/opt/mssql -d --name mssql microsoft/mssql-server-linux:latest

Error:

This is an evaluation version. There are [165] days left in the evaluation period.This program has encountered a fatal error and cannot continue running. The following diagnostic information is available: Reason: 0x00000006 Status: 0x40000015 Message: Kernel bug check Address: 0x6a42b4a0 Parameters: 0x6a62a250 Stacktrace: 000000006a4e83c6 000000006a42b4fb 000000006a41ec9d 000000006a42ae9b 000000006a4e695d 000000006a4e599c 000000006a4e5810 000000006a4e5745 Process: 8 - sqlservr Thread: 12 (application thread 0x1000) Instance Id: 644f9aaa-60cc-444e-92cd-c2c483694108 Crash Id: e47f1b2c-f882-44ca-9a80-6b380e504d2f Build stamp: e83d0295c4b8a8055fc3842cb84be4f864e57a4bf7c38359c4427ace56a27dbf Capturing core dump and information... dmesg: read kernel buffer failed: Operation not permitted No journal files were found. No journal files were found. Attempting to capture a dump with paldumper

When I try to run the container without attaching volumes it works just fine.

Dumplog is attached: log.zip

SebastianPfliegel avatar Jul 28 '17 09:07 SebastianPfliegel

This looks a lot similar to another "Kernel bug check" in https://github.com/Microsoft/mssql-docker/issues/99

sirkkalap avatar Jul 28 '17 15:07 sirkkalap

The difference is he blames NFS, I use a local Windows drive. It looks like it's an issue introduced in RC1. I'm currently trying to run the same command (different local path of course) from my private notebook (openSUSE Tumbleweed and 17.04.0-ce) and it works fine.

Will try it also with one of the CTPs.

SebastianPfliegel avatar Jul 28 '17 16:07 SebastianPfliegel

ctp2-1 is working fine.

SebastianPfliegel avatar Jul 31 '17 06:07 SebastianPfliegel

2 hours ago the new rc2 tag has been pushed. Same issue, though ... :(

SebastianPfliegel avatar Aug 02 '17 18:08 SebastianPfliegel

I am having the same issue (I think).

$ docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=<YourStrong!Passw0rd>' -e 'MSSQL_PID=Express' --cap-add SYS_PTRACE -p 1401:1433 -v c:/data/mysql/data:/var/opt/mssql/data -d microsoft/mssql-server-linux
4aee903227eb2c5831a69e8e7d9f817710f984294810a860d9d24c070e0e5676
$ docker ps
CONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS              PORTS                                         NAMES
4aee903227eb        microsoft/mssql-server-linux   "/bin/sh -c /opt/m..."   3 seconds ago       Up 2 seconds        0.0.0.0:1401->1433/tcp                        cranky_rosalind

docker ps shows it running initially, however, after a few seconds I can run docker ps again and it is gone. Not sure where I can get any logs?

No issue when running without the volume. This is docker on windows.

Version 17.06.0-ce-win19 (12801)
Channel: stable
c98c1c2

kspearrin avatar Aug 03 '17 03:08 kspearrin

After getting the dump the container stops, so it is correct that it is gone. You can find the logs at your mounted volume (c:/data/mysql/data).

SebastianPfliegel avatar Aug 03 '17 06:08 SebastianPfliegel

Here is what's in my volume:

image

Not sure how to open these though.

kspearrin avatar Aug 03 '17 12:08 kspearrin

Here is a log from docker:

$ docker-compose up
Creating network "bwcore_default" with the default driver
Creating mssql-server ...
Creating mssql-server
Attaching to mssql-server
mssql-server    | This is an evaluation version.  There are [173] days left in the evaluation period.
mssql-server    | 2017-08-03 12:44:34.57 Server      The licensing PID was successfully processed. The new edition is [Express Edition].
2017-08-03 12:44:34.80 Server      Microsoft SQL Server 2017 (RC2) - 14.0.900.75 (X64)
mssql-seJul 27 2017 08:53:49
mssql-seCopyright (C) 2017 Microsoft Corporation
mssql-seExpress Edition (64-bit) on Linux (Ubuntu 16.04.2 LTS)
2017-08-03 12:44:34.80 Server      UTC adjustment: 0:00
2017-08-03 12:44:34.80 Server      (c) Microsoft Corporation.
2017-08-03 12:44:34.80 Server      All rights reserved.
2017-08-03 12:44:34.80 Server      Server process ID is 4116.
2017-08-03 12:44:34.81 Server      Logging SQL Server messages in file '/var/opt/mssql/log/errorlog'.
2017-08-03 12:44:34.81 Server      Registry startup parameters:
mssql-se -d /var/opt/mssql/data/master.mdf
mssql-se -l /var/opt/mssql/data/mastlog.ldf
mssql-se -e /var/opt/mssql/log/errorlog
2017-08-03 12:44:34.82 Server      SQL Server detected 1 sockets with 2 cores per socket and 2 logical processors per socket, 2 total logical processors; using 2 logical processors based on SQL Server licensing. This is an informational message; no user action is required.
2017-08-03 12:44:34.82 Server      SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2017-08-03 12:44:34.82 Server      Detected 3143 MB of RAM. This is an informational message; no user action is required.
2017-08-03 12:44:34.83 Server      Using conventional memory in the memory manager.
2017-08-03 12:44:34.99 Server      Buffer pool extension is already disabled. No action is necessary.
2017-08-03 12:44:35.08 Server      InitializeExternalUserGroupSid failed. Implied authentication will be disabled.
2017-08-03 12:44:35.09 Server      Implied authentication manager initialization failed. Implied authentication will be disabled.
2017-08-03 12:44:35.10 Server      Successfully initialized the TLS configuration. Allowed TLS protocol versions are ['1.0 1.1 1.2']. Allowed TLS ciphers are ['ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:!DHE-RSA-AES256-GCM-SHA384:!DHE-RSA-AES128-GCM-SHA256:!DHE-RSA-AES256-SHA:!DHE-RSA-AES128-SHA'].
2017-08-03 12:44:35.13 Server      The maximum number of dedicated administrator connections for this instance is '1'
2017-08-03 12:44:35.13 Server      Node configuration: node 0: CPU mask: 0x0000000000000003:0 Active CPU mask: 0x0000000000000003:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
2017-08-03 12:44:35.14 Server      Using dynamic lock allocation.  Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.  This is an informational message only.  No user action is required.
2017-08-03 12:44:35.15 Server      In-Memory OLTP initialized on lowend machine.
2017-08-03 12:44:35.20 Server      Database Instant File Initialization: enabled. For security and performance considerations see the topic 'Database Instant File Initialization' in SQL Server Books Online. This is an informational message only. No user action is required.
2017-08-03 12:44:35.21 Server      Query Store settings initialized with enabled = 1,
2017-08-03 12:44:35.21 spid6s      Starting up database 'master'.
2017-08-03 12:44:35.21 Server      Software Usage Metrics is disabled.
2017-08-03 12:44:35.47 spid6s      Service Master Key could not be decrypted using one of its encryptions. See sys.key_encryptions for details.
2017-08-03 12:44:35.48 spid6s      An error occurred during Service Master Key initialization. SQLErrorCode=33095, State=8, LastOsError=0.
2017-08-03 12:44:35.48 spid6s      Converting database 'master' from version 863 to the current version 869.
2017-08-03 12:44:35.48 spid6s      Database 'master' running the upgrade step from version 863 to version 864.
2017-08-03 12:44:35.49 spid6s      Error: 17053, Severity: 16, State: 1.
2017-08-03 12:44:35.49 spid6s      /var/opt/mssql/data/mastlog.ldf: Operating system error 31(A device attached to the system is not functioning.) encountered.
2017-08-03 12:44:36.50 spid6s      Error: 9002, Severity: 17, State: 0.
2017-08-03 12:44:36.50 spid6s      The transaction log for database 'master' is full due to 'NOTHING'.
2017-08-03 12:44:36.51 spid6s      Error: 928, Severity: 20, State: 1.
2017-08-03 12:44:36.51 spid6s      During upgrade, database raised exception 3602, severity 25, state 53, address 0000000404CD1D8E. Use the exception number to determine the cause.
mssql-server exited with code 255

compose file:

version: '3'

services:
  mssql-server:
    image: microsoft/mssql-server-linux:latest
    container_name: mssql-server
    volumes:
      - c:/data/mssql/data:/var/opt/mssql/data
    environment:
      ACCEPT_EULA=Y
      MSSQL_PID=Express
      SA_PASSWORD=MyPassword123456
    ports:
      - "1433:1433"

kspearrin avatar Aug 03 '17 12:08 kspearrin

You can only see the databases as you are only mounting the data volume instead of the whole mssql volume: /var/opt/mssql (not /var/opt/mssql/data).

SebastianPfliegel avatar Aug 03 '17 13:08 SebastianPfliegel

New compose file:

version: '3'

services:
  mssql-server:
    image: microsoft/mssql-server-linux:latest
    container_name: mssql-server
    volumes:
      - c:/data/mssql:/var/opt/mssql
    environment:
      ACCEPT_EULA=Y
      MSSQL_PID=Express
      SA_PASSWORD=MyPassword123456
    ports:
      - "1433:1433"

Output from docker-compose up:

$ docker-compose up
Creating network "bwcore_default" with the default driver
Creating mssql-server ...
Creating mssql-server
Attaching to mssql-server
mssql-server    | This is an evaluation version.  There are [173] days left in the evaluation period.
mssql-server    | This program has encountered a fatal error and cannot continue running.
mssql-server    | The following diagnostic information is available:
mssql-server    |
mssql-server    |        Reason: 0x00000006
mssql-server    |        Status: 0x40000015
mssql-server    |       Message: Kernel bug check
mssql-server    |       Address: 0x6a42b4b0
mssql-server    |    Parameters: 0x6a62a250
   Stacktrace: 000000006a4e8446 000000006a42b50b 000000006a41ecad
mssql-server    |                000000006a42aeab 000000006a4e69dd 000000006a4e5a1c
mssql-server    |                000000006a4e5890 000000006a4e57c5
      Process: 7 - sqlservr
mssql-server    |        Thread: 11 (application thread 0x1000)
mssql-server    |   Instance Id: ea74a1c5-68e0-4080-bfcf-5c0225e813fa
mssql-server    |      Crash Id: 524793ab-9d77-4d48-aefe-b032583c2dd6
mssql-server    |   Build stamp: a37664e45e4156e76a53fa282fd694cb49f70c2037515f5684e3ce6dfa7549bc
mssql-server    |
mssql-server    | Capturing core dump and information...
mssql-server    | dmesg: read kernel buffer failed: Operation not permitted
mssql-server    | No journal files were found.
mssql-server    | No journal files were found.
mssql-server    | Attempting to capture a dump with paldumper
mssql-server    | WARNING: Capture attempt failure detected
mssql-server    | Attempting to capture a filtered dump with paldumper
mssql-server    | WARNING: Attempt to capture dump failed.  Reference /var/opt/mssql/log/core.sqlservr.7.temp/log/paldumper-debug.log for details
mssql-server    | Attempting to capture a dump with gdb
mssql-server    | WARNING: Unable to capture crash dump with GDB. You may need to
mssql-server    | allow ptrace debugging, enable the CAP_SYS_PTRACE capability, or
mssql-server    | run as root.
mssql-server exited with code 1

Here's a log from c:/data/mssql/log/core.sqlservr.08_03_2017_13_19_14.7.txt

This program has encountered a fatal error and cannot continue running.
The following diagnostic information is available:

       Reason: 0x00000006
       Status: 0x40000015
      Message: Kernel bug check
      Address: 0x6a42b4b0
   Parameters: 0x6a62a250

               
               
               
               
               
   Stacktrace: 000000006a4e8446 000000006a42b50b 000000006a41ecad 
               000000006a42aeab 000000006a4e69dd 000000006a4e5a1c 
               000000006a4e5890 000000006a4e57c5 

      Process: 7 - sqlservr
       Thread: 11 (application thread 0x1000)
  Instance Id: ea74a1c5-68e0-4080-bfcf-5c0225e813fa
     Crash Id: 524793ab-9d77-4d48-aefe-b032583c2dd6
  Build stamp: a37664e45e4156e76a53fa282fd694cb49f70c2037515f5684e3ce6dfa7549bc

Looks like the same problem.

Logs: log.zip

kspearrin avatar Aug 03 '17 13:08 kspearrin

In the meantime, this seems to work fine.

version: '3'

services:
  mssql-server:
    image: microsoft/mssql-server-linux:latest
    container_name: mssql-server
    volumes:
      - mssql_server_data:/var/opt/mssql/data
    environment:
      ACCEPT_EULA=Y
      MSSQL_PID=Express
      SA_PASSWORD=MyPassword123456
    ports:
      - "1433:1433"

volumes:
  mssql_server_data:

So it appears that this is only a problem when mounting the volume from the host machine.

kspearrin avatar Aug 03 '17 13:08 kspearrin

And only on Docker for Windows 10. Works splendid on openSUSE as host system.

SebastianPfliegel avatar Aug 03 '17 13:08 SebastianPfliegel

I have the same problem and have reverted to tag ctp2-1, which is working fine.

benze avatar Aug 11 '17 02:08 benze

@benze: what host system are you running? Local mount or network share?

SebastianPfliegel avatar Aug 11 '17 08:08 SebastianPfliegel

I have this problem as well. It used to work fine like a week ago. Since then a new Docker version was released. I have no idea what version that was though.

Currently on Docker for windows version 17.06.1-ce, build 874a737 Also tried version 17.07.0-ce build 8784753 which doesn't work either The volume is local. Edit: no luck with Docker version 17.06.2-ce, build cec0b72 either

I'd appreciate a fix or workaround as reverting to ctp2-1 (on which volumes currently do work) is not really a improvement for me. Recreating and seeding the databases is actually faster on rc2 than remounting on ctp2-1.

dweggemans avatar Sep 05 '17 12:09 dweggemans

@aerkefiende: I'm running in a Win 10 box, with local mount drives. Running Docker Engine 17.06.1-ce-win24 (13025). Using Docker for Linux Containers.

benze avatar Sep 06 '17 04:09 benze

Same problem encountered on Win10, Version 17.06.2-ce-win27 (13194), LinuxVM

clydeigc avatar Sep 14 '17 13:09 clydeigc

This is a known bug. It is fixed in the RTM/GA release which will be available soon. Alternatives for now: Use :ctp2-1 or email me for a special preview image. Please only email me if this is a significant problem for you and you can't use :ctp2-1 for some reason. It takes some effort on my side to be able to set you up to pull the special preview image from our private preview registry. Email address is twright @ microsoft Sorry for the inconvenience!

twright-msft avatar Sep 14 '17 15:09 twright-msft

now that 2017-GA is available (and the old ctp2-1 tag is deleted), this issue is resurfacing - it hasn't been fixed at all.

[INFO] DOCKER> [microsoft/mssql-server-linux:2017-GA] "Microsoft SQL Server-confluence": Start container 66f49e17402a
2017-10-03 07:58:26.07 Server      Setup step is copying system data file 'C:\templatedata\master.mdf' to '/var/opt/mssql/data/master.mdf'.
2017-10-03 07:58:26.12 Server      Setup step is copying system data file 'C:\templatedata\mastlog.ldf' to '/var/opt/mssql/data/mastlog.ldf'.
2017-10-03 07:58:26.13 Server      Setup step is copying system data file 'C:\templatedata\model.mdf' to '/var/opt/mssql/data/model.mdf'.
2017-10-03 07:58:26.14 Server      Setup step is copying system data file 'C:\templatedata\modellog.ldf' to '/var/opt/mssql/data/modellog.ldf'.
2017-10-03 07:58:26.16 Server      Setup step is copying system data file 'C:\templatedata\msdbdata.mdf' to '/var/opt/mssql/data/msdbdata.mdf'.
2017-10-03 07:58:26.19 Server      Setup step is copying system data file 'C:\templatedata\msdblog.ldf' to '/var/opt/mssql/data/msdblog.ldf'.
2017-10-03 07:58:26.26 Server      Microsoft SQL Server 2017 (RTM) - 14.0.1000.169 (X64)
Aug 22 2017 17:04:49
Copyright (C) 2017 Microsoft Corporation
Developer Edition (64-bit) on Linux (Ubuntu 16.04.3 LTS)
2017-10-03 07:58:26.26 Server      UTC adjustment: 0:00
2017-10-03 07:58:26.26 Server      (c) Microsoft Corporation.
2017-10-03 07:58:26.26 Server      All rights reserved.
2017-10-03 07:58:26.26 Server      Server process ID is 4120.
2017-10-03 07:58:26.26 Server      Logging SQL Server messages in file '/var/opt/mssql/log/errorlog'.
2017-10-03 07:58:26.26 Server      Registry startup parameters:
-d /var/opt/mssql/data/master.mdf
-l /var/opt/mssql/data/mastlog.ldf
-e /var/opt/mssql/log/errorlog
2017-10-03 07:58:26.27 Server      SQL Server detected 1 sockets with 2 cores per socket and 4 logical processors per socket, 4 total logical processors; using 4 logical  user action is required.
2017-10-03 07:58:26.27 Server      SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2017-10-03 07:58:26.27 Server      Detected 5984 MB of RAM. This is an informational message; no user action is required.
2017-10-03 07:58:26.27 Server      Using conventional memory in the memory manager.
2017-10-03 07:58:26.50 Server      Buffer pool extension is already disabled. No action is necessary.
2017-10-03 07:58:26.66 Server      InitializeExternalUserGroupSid failed. Implied authentication will be disabled.
2017-10-03 07:58:26.66 Server      Implied authentication manager initialization failed. Implied authentication will be disabled.
2017-10-03 07:58:26.66 Server      Successfully initialized the TLS configuration. Allowed TLS protocol versions are ['1.0 1.1 1.2']. Allowed TLS ciphers are 8-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES-RSA-AES128-GCM-SHA256:!DHE-RSA-AES256-SHA:!DHE-RSA-AES128-SHA'].
2017-10-03 07:58:26.70 Server      The maximum number of dedicated administrator connections for this instance is '1'
2017-10-03 07:58:26.70 Server      Node configuration: node 0: CPU mask: 0x000000000000000f:0 Active CPU mask: 0x000000000000000f:0. This message provides a description of the o user action is required.
2017-10-03 07:58:26.71 Server      Using dynamic lock allocation.  Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.  This is an informational message 
2017-10-03 07:58:26.71 Server      In-Memory OLTP initialized on lowend machine.
2017-10-03 07:58:26.76 Server      Database Instant File Initialization: enabled. For security and performance considerations see the topic 'Database Instant File Initialization' ion is required.
2017-10-03 07:58:26.76 Server      Query Store settings initialized with enabled = 1,
2017-10-03 07:58:26.77 spid6s      Starting up database 'master'.
2017-10-03 07:58:26.77 Server      Software Usage Metrics is disabled.
2017-10-03 07:58:26.95 spid6s      The tail of the log for database master is being rewritten to match the new sector size of 4096 bytes.  3072 bytes at offset 418816 in file /var/
2017-10-03 07:58:27.04 spid6s      Converting database 'master' from version 862 to the current version 869.
2017-10-03 07:58:27.04 spid6s      Database 'master' running the upgrade step from version 862 to version 863.
2017-10-03 07:58:27.07 spid6s      Database 'master' running the upgrade step from version 863 to version 864.
2017-10-03 07:58:27.08 spid6s      Error: 17053, Severity: 16, State: 1.
2017-10-03 07:58:27.08 spid6s      /var/opt/mssql/data/mastlog.ldf: Operating system error 31(A device attached to the system is not functioning.) encountered.
2017-10-03 07:58:28.09 spid6s      Error: 928, Severity: 20, State: 1.
2017-10-03 07:58:28.09 spid6s      During upgrade, database raised exception 9002, severity 17, state 0, address 0000000484D726DE. Use the exception number to determine the cause.
2017-10-03 07:58:28.09 spid6s      Error: 9002, Severity: 17, State: 0.
2017-10-03 07:58:28.09 spid6s      The transaction log for database 'master' is full due to 'NOTHING'.

sangohan avatar Oct 03 '17 08:10 sangohan

Volume mappings are working again. I just tried both GA and latest and can confirm that the issue is fixed.

dweggemans avatar Oct 03 '17 12:10 dweggemans