Skip to content
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

Cannot increase mdf file size when using docker volumes on Windows 10 #241

Open
Ranger1230 opened this issue Jan 18, 2018 · 14 comments
Open

Comments

@Ranger1230
Copy link

OS: Windows 10 Pro Version 1709 OS Build 16299.192
Docker: Docker Containers Version 17.12.0-ce-win47 (15139) Channel stable

I have a database where the entire mssql folder it contained inside a docker volume (this is for dev so having all those files someplace I can access is useful). Lately I've had an issue where once the mdf files are created after creating a new DB, they cannot increase the size of the file from when it was created. I tried uninstalling docker and re installing and using a different empty folder for the volume but still no luck. When I change it so that all the database files are contained inside the container everything seems to work fine. Here is the command I use to create the container:

docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=Password1" -e "MSSQL_PID=Developer" -p 1433:1433 -v /C/Users/ranger1230/Documents/SQLDataBase:/var/opt/mssql
-d microsoft/mssql-server-linux:2017-latest

And here is the error message I receive when I try to do something that will require the database files to grow (yes Autogrow is enabled):

TITLE: Microsoft SQL Server Management Studio

Restore of database 'Episerver' failed. (Microsoft.SqlServer.Management.RelationalEngineTasks)


ADDITIONAL INFORMATION:

System.Data.SqlClient.SqlError: MODIFY FILE encountered operating system error 31(A device attached to the system is not functioning.) while attempting to expand the physical file '/var/opt/mssql/data/Episerver.mdf'. (Microsoft.SqlServer.SmoExtended)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=13.0.16106.4+((SSMS_Rel_16_5).170125-2137)&LinkId=20476


BUTTONS:

OK

@Ranger1230
Copy link
Author

Downgrading docker to Version 17.09.0-ce-win33 (13620) seems to resolve the issue. This seems to be introduced in the 17.12 release of docker.

@twright-msft
Copy link
Collaborator

@friism - Do you know if this is related to a known issue/regression on the Docker side in 17.12?

@friism
Copy link
Contributor

friism commented Jan 18, 2018

@twright-msft sorry, I'm out of the loop - what regression?

@twright-msft
Copy link
Collaborator

See detailed description above in this issue. Basically in 17.12 the database file in a SQL Server on Linux container in a mounted volume on Windows cannot grow in size. Prior versions of Docker worked OK.

@akimd
Copy link

akimd commented Jan 19, 2018

We have recently identified this issue (docker/for-mac#2449), and installed a fix. Expect a fix release really soon.

As a temporary workaround, it might work to change the disk size, quit docker, remove the disk image, and reset docker.

@thesushil
Copy link

@friism is the fix coming in next version of docker?

@friism
Copy link
Contributor

friism commented Feb 11, 2018

ping @ebriney for status

@ebriney
Copy link

ebriney commented Feb 12, 2018

I think the issue is due to Linuxkit, dockerd is now running in a container and samba share is only available in this namespace.
I'm trying to figure out what is going wrong with that configuration.

@gingters
Copy link

gingters commented Mar 12, 2018

@ebriney @friism I am currently running into the same issue. on Docker for Windows 17.12.0-ce-win47 (15139). I created the container like this:

docker pull microsoft/mssql-server-linux:2017-CU4
docker create --name mySqlServerExpress -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=MyStr0ng!Pa$$w0rd" -e "MSSQL_PID=Express" --publish 1433:1433 --mount type=bind,source="%~dp0sqlData",target=/var/opt/mssql microsoft/mssql-server-linux:2017-CU4

And when I run it, I get the following error:
2018-03-12 14:51:16.28 spid6s Database 'master' running the upgrade step from version 863 to version 864.
2018-03-12 14:51:16.35 spid6s Error: 17053, Severity: 16, State: 1.
2018-03-12 14:51:16.35 spid6s /var/opt/mssql/data/mastlog.ldf: Operating system error 31(A device attached to the system is not functioning.) encountered.
2018-03-12 14:51:17.42 spid6s Error: 928, Severity: 20, State: 1.
2018-03-12 14:51:17.42 spid6s During upgrade, database raised exception 9002, severity 17, state 0, address 0000000484D0157E. Use the exception number to determine the cause.
2018-03-12 14:51:17.45 spid6s Error: 9002, Severity: 17, State: 0.
2018-03-12 14:51:17.45 spid6s The transaction log for database 'master' is full due to 'NOTHING'.

When can we expect a fix for that? Or is there a workaround?

/cc @twright-msft

Edit Update: Updating to EDGE release 18.03.0-ce-rc1-win54 (16164) dot not fix the issue.

@ebriney
Copy link

ebriney commented Mar 12, 2018

@gingters I did tries changing the way we do the mounting in the vm but cannot make it work again.
So unfortunately no news on that.
Why do you need to bind mount a local db?
Docker volumes are working, tough it's not local, you can use it as persistent volume and run debug container in parallel.

@gingters
Copy link

@ebriney I am currently creating a test-environment. But I think I can work around that by creating a volume, and then using a temporary container to copy the files from the host into the volume and then attaching the volume to the actual sql server container and run it from there (for eacht test run).

However, this is only a work around, and this issue should be fixed.

@MordantWastrel
Copy link

This looks like #136

@Ranger1230
Copy link
Author

This seems to be resolved for me in the 2017-CU7 tag of the docker image. Currently running Docker version 18.03.1-ce-win65 (17513) with a container running mssql-server-linux:2017-CU7 and I am able to successfully restore my databases.
Is it resolved for everyone else?

@KELightsey
Copy link

I get this failure when attempting to restore a database from a bak file of 10,063,164KB in size. For my other database restores, with bak files up to 454,215KB there is not problem. This is for a container started as:
docker run -v c:/data:/data -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<secure_password>' -p 1310:1433 -d --name=dmt_10 linux_with_agent
Built from:
https://github.com/dbafromthecold/SqlOnLinuxAgent/blob/master/dockerfile
S C:\Users\kl100930> docker version
Client:
Version: 18.06.0-ce
API version: 1.38
Go version: go1.10.3
Git commit: 0ffa825
Built: Wed Jul 18 19:05:28 2018
OS/Arch: windows/amd64
Experimental: false

Server:
Engine:
Version: 18.06.0-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: 0ffa825
Built: Wed Jul 18 19:13:46 2018
OS/Arch: linux/amd64
Experimental: false

untitled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants