-
Notifications
You must be signed in to change notification settings - Fork 760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server won't run on Windows host, Linux container if using volumes #441
Comments
Hi, Could you share the docker version and file system information for analysis? Here is a similar thread. |
Hi, we saw that thread and the one it refers to but they refer to messages about evaluation versions which we didn't see in our logs. They also seem to predate this problem, with it stretching back to 2017 and seemingly having no effective solution (people are getting it in January of this year though). As far as we can tell the issue we are seeing is only with the newest versions of the SQL server. Here is the other information you requested: File System: NTFS, on 4 of the PC's. Have also tried mounting to a FAT formatted drive and this didn't work. Docker Version: 18.09.2, Community edition We don't believe this is a docker drive sharing issue, as the container does successfully write some of the files including the SQL error logs. We've also tried other containers that just write data to a file and they are fine. My PC was working fine but once I deleted the latest SQL image I had (most likely CU13), and got the very latest it stopped working, in an identical manner to the other 3 PC's we'd been trying to get working. Thanks, Roger |
Any solutions? My mssql worked for like a month and then after restart it started giving me that error... |
Yeah i was getting the same problem. I had to go back to 2017-CU11-ubuntu to find a working verison. |
2017-CU11-ubuntu did not work for me. @jonny64bit , could you share your docker command please? |
@winterIslander no problem. docker network create netty |
This is still happening as of SQL Server 2017 CU14 and 2019 CTP 2.5 using Docker Desktop and LCOW. Docker Desktop: 2.0.4.0 (33772), Edge My organization does run Sophos Anti-Virus. I added I read in the very long issue #136 that CU11 and/or 12 worked (and possibly CU7, but I haven't tried that one yet), but alas, these versions didn't work either. I went backward from CU14 to CU9. Same error every time:
Here's the relevant portion of my compose file: version: '3.7'
services:
db:
image: mcr.microsoft.com/mssql/server:2017-CU14-ubuntu
ports:
- "11433:1433"
environment:
ACCEPT_EULA: "Y"
SA_PASSWORD: "p@55w0rd"
volumes:
- D:\ContainerVolumes\MyApp\MSSQL\SysDbs:/var/opt/mssql
- D:\ContainerVolumes\MyApp\MSSQL\AppDbs:/var/opt/sqlserver
#- myapp-sysdbs:/var/opt/mssql
#- myapp-appdbs:/var/opt/sqlserver
# I needed this because even though supposedly SQL Server 2017 is supposed to now support
# VMs with only 2GB memory, I got an error saying I needed at least 2Gb memory.
# This may have been a leftover since the Docker page for MSSql for Linux says the latest tag
# is CU3 (and that's what I started with) even though it's not when you view _all_ tags (which
# lead me to the CU14 image).
mem_limit: "4gb"
healthcheck:
test: [ "CMD", "sqlcmd", "-U", "sa", "-P", "p@55w0rd", "-Q", "select 1" ]
interval: 1s
retries: 20
# Tried this per another issue thread on GH
#volumes:
# myapp-sysdbs:
# external: true
# myapp-appdbs:
# external: true I was able to successfully start the container by NOT using volume maps (either volumes or bind mounts). I was able to For now, I'm going to have to resort to "rolling my own image" for Windows because a) these Linux images just don't work |
I am having the same problem with |
Thanks @yang-zhang-syd ! Just confirmed the server:2017-latest doesn't, server:2017-CU11-ubuntu works. |
On Windows 10 1809, I can confirm that server:2017-latest, server:2017-CU14-ubuntu, server:2017-CU13-ubuntu, server:2017-CU12-unbuntu, server:2017-CU11-ubuntu all fail with the following (version numbers may differ):
Launched with:
I'm still searching for something, anything, that works with SQL Server for Docker. (this is after going through a few versions of Docker for Windows itself to even run the container) Same can be said for CU's 9 and 10, and 2019's CTP. |
I am trying to run the same thing inside of the Kubernetes that comes with Docker for Windows and I'm getting the same error as mentioned above. I was able to get the docker container run with the mounted volume (using docker comands) when I was targeting :2017-CU11-ubuntu tag but when I pushed the same thing into the k8s cluster, it crashed and the behavior was the same (immediatelly after couple of seconds the container would crash) and the error was the one mentioned above. |
Same for me, reported here |
Also getting the same issue. running the following compose:
|
Running into same issue.
Instance Id: 562485c4-9f0c-427d-bb73-e04ca6dea42a Ubuntu 16.04.6 LTS |
This is the workaround that works for me, I create a docker volume to persist data between containers and add a host folder to temp in order to share backups between container and host machine
Also SSMS is really slow finding local folders but using Azure Data Studio everything goes smoothly. |
We have the same problem on Ubuntu 16.04 LTS where we use MSSQL 2019 in development. It worked fine under CTP3.1. Oddly enough, our windows machines worked fine when we updated to CTP 3..2, but our native ubuntu machine failed with a core dump and the demsg: operation not permitted error. We rolled back to CTP 3.1 and it works again. We use a regular Docker volume (not bind mount) for data storage. |
1 similar comment
We have the same problem on Ubuntu 16.04 LTS where we use MSSQL 2019 in development. It worked fine under CTP3.1. Oddly enough, our windows machines worked fine when we updated to CTP 3..2, but our native ubuntu machine failed with a core dump and the demsg: operation not permitted error. We rolled back to CTP 3.1 and it works again. We use a regular Docker volume (not bind mount) for data storage. |
Started getting this today on Docker for Windows after an update. Tried deleting and re-creating the volume with no luck. Finally got it to work by adding some resource specifications and privileged: true to docker-compose.yml -- the privileged flag may not be necessary but haven't had a chance to play with it yet:
|
The latest image had this problems some time ago so i switched back to CU12 I am using k8s with smb3 flexvolumes The k8s cluster is used for developing and is running under What i tested without any success: The result with the latest updates and version is that the error "Directory not found" |
Starting from some version, it requires some changes in the volume's path to be done: does not work: docker run -it --restart=always -p 1433:1433 --network=some-network --name mssql -v C:\docker-db:/var/opt/mssql/ mitpdocker.azurecr.io/mssql:v1.0.14 OK: docker run -it --restart=always -p 1433:1433 --network=some-network --name mssql -v C:\docker-db*data*:/var/opt/mssql/data/ mitpdocker.azurecr.io/mssql:v1.0.14 Though, docs update might be required |
I tested it now again with a fresh deploy and mount only into /data and /log. Reason: 0x00000001 |
Do you have any docker container logs? Might it be just an expired evaluation period - from now on, you need to specify either your key/whatever or ENV MSSQL_PID=Developer that you are using the server as a developer. |
Yes, i did and its a segfault I think, the issue comes from some kind of kernel/base-image security fix. That could explain that old versions are failing now too |
I have this issue. Windows 10 x64 Pro with all updates at current date, latest version of docker. When running containter from 2017-latest image (command from docs tutorial), container stay running 5-10sec and than stops.
When run container from image 2017-CU11-ubuntu, this works fine. |
I can confirm that moving the data directory from |
Followed the above and defined the SQL Server directories to the ones on my host machine (Docker on Windows). The following steps & commands worked for me:
|
I have the same issue and can confirm that the work-around above works. By explicitly adding directory mappings for the data, log and backup directories SQL Server does not crash for me. |
Running as is caused error "Kernel bug check: No such file or directory" error. Updating to include data directory based on fix: microsoft/mssql-docker#441 (comment)
I just mapped the data dir.
|
worked for me! thx! |
I'm getting this same issue. I'm on Windows 1903 and using Docker Desktop 2.1.0.5 (not the newer 2.2.0.0 since this gives me other issues), but when I run the following command to start 2017CU14:
I get the following error:
If I switch to using CU13-ubuntu or remove the -v volume binding to my local disk, the problem goes away. |
Fixed this by using /var/opt/mssql/data as mount path instead of /var/opt/mssql/ https://forums.docker.com/t/sql-container-exits-immediatly-when-run-with-persistent-storage/61414/4 |
Not entirely sure if you already fixed your problem, but here you have a couple of examples on how to use volumes: Using a known path from your hostdocker run \
-e "ACCEPT_EULA=Y" -e "SA_PASSWORD=MyPassword" \
-p 1433:1433 \
-v D:/Data:/var/opt/mssql \
--name mssql \
-d mcr.microsoft.com/mssql/server:2017-latest In this case, the volume will use a known path from the Docker host Using a default path with Docker volumesdocker run \
-e "ACCEPT_EULA=Y" -e "SA_PASSWORD=MyPassword" \
-p 1433:1433 \
-v vlm_MyData:/var/opt/mssql \
--name mssql \
-d mcr.microsoft.com/mssql/server:2017-latest In this case, Docker will create a new volume called You can also map the "Data" and "Log" default locations to volumes using the MSSQL_DATA_DIR and MSSQL_LOG_DIR environment variables. |
Could it be Antivirus on your host OS? Also, in my experience using volumes from Windows or MacOS hosts is significantly slower. As suggested above, usually create a volume container in docker if I need persistence and use a host volume mount only for a backup directory that isn't actively read/write like the data and log directories tend to be. |
When can we expect a docker release with a fix for this? The workaround of mapping On a related note, are there any issues with only mapping/persisting the |
Hi All, 2 )Linux-containers are created but api container is failing to connect to sql-db container as below ERROR msg is coming Any update on solutions or should we deploy 2 containers to azure app server for Linux or aci and test ? Thanks |
Solution:Adding the user: root part works for me. Running ubuntu on host. This is my file: docker-compose.yml
I have been searhing for hours |
Yes, When i follow this step, i could start container the same with you, so it looks like is caused by MSSQL images' issues.... LOL... |
…similar issue)
* change tag for sql server due to microsoft/mssql-docker#441 (or some similar issue) * use 2022-latest * fixed mssql tests * format * used new columns * use the custom sql server
We were trying to run the script below on a Windows host (Windows 10 Pro 1809+) configured for Linux docker containers as per these MS docs:
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=" -p 1433:1433 -v :/var/opt/mssql --name mssql -d mcr.microsoft.com/mssql/server:2017-latest
and the SQL server crashes on startup and the container stops running with a 'kernel bug error'. An image from 3+ weeks ago appears to be fine.
The container runs fine if I remove the host volume reference.
The container runs fine if running on a Linux host.
This problem occurs on multiple Windows PCs (4 different PC's).
It would appear 2017-CU14-ubuntu, 2017-latest, 2017 latest-ubuntu all have this problem (same image id's so expected), and we also tried 2019-CTP2.4 which has the same issue. An older image such as 2017-CU13 or earlier worked fine suggesting it's a problem with the latest releases.
The text was updated successfully, but these errors were encountered: