microsoft / mssql-docker

Official Microsoft repository for SQL Server in Docker resources
MIT License
1.74k stars 758 forks source link

Unable to use microsoft/mssql-server-linux with volumes on boot2docker on Windows 10 #52

Open goostleek opened 7 years ago

goostleek commented 7 years ago

Actual result

Starting the container with mounted volume by

docker run -v //c/Users/makl/mssql-db:/var/opt/mssql -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=DatabaseUser123" -p 1433:1433 microsoft/mssql-server-linux

causes the server startup failure:

Configuring Microsoft(R) SQL Server(R)...
sqlservr: Debugger.cpp:578: static void Debugger::Print(const void *, unsigned int): Assertion `"A serious error condition has been encountered." == nullptr' failed.
cat: /proc/14/sched: No such file or directory
/opt/mssql/bin/generate-core.sh: line 135: lsof: command not found
cat: core.sqlservr.14.temp/log/debug.log: No such file or directory
No journal files were found.
No journal files were found.
ls: cannot access '/var/opt/mssql/log/errorlog*': No such file or directory
ls: cannot access '/var/opt/mssql/log/exception.log': No such file or directory
ls: cannot access '/var/opt/mssql/log/SQLDu*.txt': No such file or directory
ls: cannot access '/var/opt/mssql/log/SQLDu*.mdmp': No such file or directory
ls: cannot access '/var/opt/mssql/log/system_health*': No such file or directory
Configuration complete.
This is an evaluation version.  There are [146] days left in the evaluation period.
sqlservr: Debugger.cpp:578: static void Debugger::Print(const void *, unsigned int): Assertion `"A serious error condition has been encountered." == nullptr' failed.
Capturing core dump and information for sqlservr (pid 127)...
cat: /proc/127/sched: No such file or directory
/opt/mssql/bin/generate-core.sh: line 135: lsof: command not found
Capturing dump with gdb
cat: core.sqlservr.127.temp/log/debug.log: No such file or directory
No journal files were found.
No journal files were found.
SQL Log Directory /var/opt/mssql/log
ls: cannot access '/var/opt/mssql/log/errorlog*': No such file or directory
ls: cannot access '/var/opt/mssql/log/exception.log': No such file or directory
ls: cannot access '/var/opt/mssql/log/SQLDu*.txt': No such file or directory
ls: cannot access '/var/opt/mssql/log/SQLDu*.mdmp': No such file or directory
ls: cannot access '/var/opt/mssql/log/system_health*': No such file or directory
Packaging core dump and information into compressed files.
Core dump and information will be written to /var/opt/mssql/log/core.sqlservr.03_21_2017_11_17_39.127 and logs in /var/opt/mssql/log/core.sqlservr.03_21_2017_11_17_39.127.log

Expected result

The container should start successfully, eg. when no volume is used:

docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=DatabaseUser123" -p 1433:1433 microsoft/mssql-server-linux
Configuring Microsoft(R) SQL Server(R)...
Configuration complete.
This is an evaluation version.  There are [146] days left in the evaluation period.
RegQueryValueEx HADR for key "Software\Microsoft\Microsoft SQL Server\MSSQL\MSSQLServer\HADR" failed.
2017-03-21 11:27:48.39 Server      Microsoft SQL Server vNext (CTP1.3) - 14.0.304.138 (X64)
        Feb 13 2017 16:49:12
        Copyright (C) 2016 Microsoft Corporation. All rights reserved.
        on Linux (Ubuntu 16.04.1 LTS)
2017-03-21 11:27:48.40 Server      UTC adjustment: 0:00
2017-03-21 11:27:48.40 Server      (c) Microsoft Corporation.
2017-03-21 11:27:48.40 Server      All rights reserved.
2017-03-21 11:27:48.40 Server      Server process ID is 4116.
2017-03-21 11:27:48.40 Server      Logging SQL Server messages in file 'C:\var\opt\mssql\log\errorlog'.
2017-03-21 11:27:48.41 Server      Registry startup parameters:
         -d C:\var\opt\mssql\data\master.mdf
         -l C:\var\opt\mssql\data\mastlog.ldf
         -e C:\var\opt\mssql\log\errorlog
2017-03-21 11:27:48.43 Server      SQL Server detected 1 sockets with 1 cores per socket and 1 logical processors per socket, 1 total logical processors; using 1 logical processors based on SQL Server licensing. This is an informational message; no user action is required.
2017-03-21 11:27:48.43 Server      SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2017-03-21 11:27:48.44 Server      Detected 3160 MB of RAM. This is an informational message; no user action is required.
2017-03-21 11:27:48.44 Server      Using conventional memory in the memory manager.
Enabling HADR for this XCluster instance. May not work properly if prerequisites are not met.
2017-03-21 11:27:48.52 Server      Default collation: SQL_Latin1_General_CP1_CI_AS (us_english 1033)
2017-03-21 11:27:48.64 Server      Buffer pool extension is already disabled. No action is necessary.
2017-03-21 11:27:48.71 Server      InitializeExternalUserGroupSid failed. Implied authentication will be disabled.
2017-03-21 11:27:48.71 Server      Implied authentication manager initialization failed. Implied authentication will be disabled.
2017-03-21 11:27:48.75 Server      The maximum number of dedicated administrator connections for this instance is '1'
2017-03-21 11:27:48.75 Server      Node configuration: node 0: CPU mask: 0x0000000000000001:0 Active CPU mask: 0x0000000000000001: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-03-21 11:27:48.76 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-03-21 11:27:48.77 Server      In-Memory OLTP initialized on lowend machine.
2017-03-21 11:27:48.82 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-03-21 11:27:48.83 Server      Query Store settings initialized with enabled = 1,
2017-03-21 11:27:48.84 spid6s      Starting up database 'master'.
2017-03-21 11:27:48.85 Server      Software Usage Metrics is disabled.
2017-03-21 11:27:49.04 spid6s      14 transactions rolled forward in database 'master' (1:0). This is an informational message only. No user action is required.
2017-03-21 11:27:49.04 spid6s      0 transactions rolled back in database 'master' (1:0). This is an informational message only. No user action is required.
2017-03-21 11:27:49.05 spid6s      Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
2017-03-21 11:27:49.12 spid6s      Buffer pool extension is already disabled. No action is necessary.
2017-03-21 11:27:49.12 spid6s      Resource governor reconfiguration succeeded.
2017-03-21 11:27:49.12 spid6s      SQL Server Audit is starting the audits. This is an informational message. No user action is required.
2017-03-21 11:27:49.13 spid6s      SQL Server Audit has started the audits. This is an informational message. No user action is required.
2017-03-21 11:27:49.20 spid6s      SQL Trace ID 1 was started by login "sa".
2017-03-21 11:27:49.21 spid6s      Server name is 'fe5adcb2249c'. This is an informational message only. No user action is required.
2017-03-21 11:27:49.21 spid6s      The NETBIOS name of the local node that is running the server is 'fe5adcb2249c'. This is an informational message only. No user action is required.
2017-03-21 11:27:49.24 spid17s     Password policy update was successful.
2017-03-21 11:27:49.25 spid20s     Always On: The availability replica manager is starting. This is an informational message only. No user action is required.
2017-03-21 11:27:49.25 spid20s     Always On: The availability replica manager is waiting for the instance of SQL Server to allow client connections. This is an informational message only. No user action is required.
2017-03-21 11:27:49.25 spid7s      Starting up database 'mssqlsystemresource'.
2017-03-21 11:27:49.26 spid6s      Starting up database 'msdb'.
2017-03-21 11:27:49.27 spid7s      The resource database build version is 14.00.304. This is an informational message only. No user action is required.
2017-03-21 11:27:49.35 spid7s      Starting up database 'model'.
2017-03-21 11:27:49.64 spid6s      4 transactions rolled forward in database 'msdb' (4:0). This is an informational message only. No user action is required.
2017-03-21 11:27:49.68 spid6s      0 transactions rolled back in database 'msdb' (4:0). This is an informational message only. No user action is required.
2017-03-21 11:27:49.70 spid6s      Recovery is writing a checkpoint in database 'msdb' (4). This is an informational message only. No user action is required.
2017-03-21 11:27:49.75 spid7s      Polybase feature disabled.
2017-03-21 11:27:49.76 spid7s      Clearing tempdb database.
2017-03-21 11:27:50.02 spid17s     A self-generated certificate was successfully loaded for encryption.
2017-03-21 11:27:50.03 spid17s     Server is listening on [ 0.0.0.0 <ipv4> 1433].
2017-03-21 11:27:50.04 Server      Server is listening on [ 127.0.0.1 <ipv4> 1434].
2017-03-21 11:27:50.04 Server      Dedicated admin connection support was established for listening locally on port 1434.
2017-03-21 11:27:50.05 spid17s     SQL Server is now ready for client connections. This is an informational message; no user action is required.
2017-03-21 11:27:50.35 spid7s      Starting up database 'tempdb'.
2017-03-21 11:27:50.59 spid7s      The tempdb database has 1 data file(s).
2017-03-21 11:27:50.59 spid20s     The Service Broker endpoint is in disabled or stopped state.
2017-03-21 11:27:50.60 spid20s     The Database Mirroring endpoint is in disabled or stopped state.
2017-03-21 11:27:50.63 spid20s     Service Broker manager has started.
2017-03-21 11:27:50.68 spid6s      Recovery is complete. This is an informational message only. No user action is required.

Environment

C:\Users\makl>systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name:                   Microsoft Windows 10 Enterprise
OS Version:                10.0.10586 N/A Build 10586
$ docker -v
Docker version 17.03.0-ce, build 60ccb22
$ docker-machine -v
docker-machine.exe version 0.10.0, build 76ed2a6
$ vboxmanage -v
5.1.14r112924
goostleek commented 7 years ago

At the moment the only workaround for that is to use a data volume (as suggested).

whatevergeek commented 6 years ago

any updates on this? it currently crashes on load when docker volume (-v) is used: image

i talked to Anna Shrestinian the other day in the #MSTechSummit she said volumes should now work... e.g. docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=SqlServer101' -v /c/path_to_local/mssql:/var/opt/mssql -p 1433:1433 -d microsoft/mssql-server-linux:2017-GA

but seems it is still not working... any other additional setup i need to do?

evil-shrike commented 6 years ago

Any news on the issue? Running a container from image microsoft/mssql-server-linux and a volume mapping ./local/folder:/var/opt/mssql/ still fails. My host is a Win10 machine.

Microsoft SQL Server 2017 (RTM-CU3-GDR) (KB4052987) - 14.0.3015.40 (X64) Dec 22 2017 16:13:22 Developer Edition (64-bit) on Linux (Ubuntu 16.04.3 LTS)

From output:

2018-02-06 00:09:05.50 spid7s      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/opt/mssql/data/mastlog.ldf will be written.
2018-02-06 00:09:06.03 spid7s      Converting database 'master' from version 862 to the current version 869.
2018-02-06 00:09:06.04 spid7s      Database 'master' running the upgrade step from version 862 to version 863.
2018-02-06 00:09:06.09 spid7s      Database 'master' running the upgrade step from version 863 to version 864.
2018-02-06 00:09:06.15 spid7s      Error: 17053, Severity: 16, State: 1.
2018-02-06 00:09:06.15 spid7s      /var/opt/mssql/data/mastlog.ldf: Operating system error 31(A device attached to the system is not functioning.) encountered.
2018-02-06 00:09:07.21 spid7s      Error: 928, Severity: 20, State: 1.
2018-02-06 00:09:07.21 spid7s      During upgrade, database raised exception 9002, severity 17, state 0, address 0000000404D013DE. Use the exception number to determine the cause.
2018-02-06 00:09:07.25 spid7s      Error: 9002, Severity: 17, State: 0.
2018-02-06 00:09:07.25 spid7s      The transaction log for database 'master' is full due to 'NOTHING'.
rdalfonso commented 6 years ago

I'm on Docker Cloud and deploy the container to an AWS EC2 instance and the container fails with the same error. Everything worked fine on the my mac. Container is based off microsoft/mssql-server-linux:latest image

2018-03-06 19:35:10.33 spid6s Database 'master' running the upgrade step from version 863 to version 864.
2018-03-06 19:35:10.35 spid6s Error: 17053, Severity: 16, State: 1.
2018-03-06 19:35:10.35 spid6s /var/opt/mssql/data/mastlog.ldf: Operating system error 31(A device attached to the system is not functioning.) encountered.
2018-03-06 19:35:11.36 spid6s Error: 928, Severity: 20, State: 1.
2018-03-06 19:35:11.36 spid6s During upgrade, database raised exception 9002, severity 17, state 0, address 0000000404D013DE. Use the exception number to determi ne the cause.
2018-03-06 19:35:11.37 spid6s Error: 9002, Severity: 17, State: 0.
2018-03-06 19:35:11.37 spid6s The transaction log for database 'master' is full due to 'NOTHING'.

sspark519831 commented 6 years ago

I have same problem with microsoft/mssql-server-linu:latest on Windows.

PS C:\Users\spark> systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name:                   Microsoft Windows 10 Enterprise
OS Version:                10.0.14393 N/A Build 14393

PS C:\Users\spark> docker -v
Docker version 17.12.0-ce, build c97c6d6

PS C:\Users\spark> docker-machine -v
docker-machine.exe version 0.13.0, build 9ba6da9

But, it works for only microsoft/mssql-server-linu:2017-CU3.

EvgenyKhaliper commented 5 years ago

Exactly same issue, what the point to use this image at all if the volume cannot be mapped ?

goostleek commented 5 years ago

@evgeny-pol You can still use volumes. Please see https://github.com/microsoft/mssql-docker/issues/52#issuecomment-288075275