I mount a windows 10 or windows server 2016 share (smb,cifs) into ubuntu and map that folder into docker container. At first it looks ok, the files can be read, created and deleted. But when it comes to expanding the files, it fails. The problem pops up when mapping mssql-server-linux data folder on the shared drive. The same problem occurs with sqlite.
If i share the folder from an old synology disk station also using smb (but version 1) it works as expected.
Tested Docker versions 17.09, 17.12, 18.02
on Ubuntu Server 16.04 with kernels 4.4, 4.8, 4.15).
This is a sample setup that duplicates error with mssql-server-linux image.
A. Windows Part
create windows user testone pass testone
share a folder as “share” (file system doesn’t matter ntfs,exfat,fat32)
give full permission to testone (on share and ntfs if applicable)
B. Linux Part
mount directory
mkdir ~/hostshare
sudo mount -t cifs ///share ~/hostshare -o username=testone,password=testone,file_mode=0777,dir_mode=0777,vers=3.0
run microsoft/mssql-server-linux
docker run
–rm
-it
–name=mssql01
-p 1433:1433
-v ~/hostshare:/var/opt/mssql/data
-e “ACCEPT_EULA=Y”
-e “MSSQL_SA_PASSWORD=TestOne01”
microsoft/mssql-server-linux
run fails when updating mastlog.ldf (expand file)
2018-02-12 16:38:11.25 spid5s Database ‘master’ running the upgrade step from version 862 to version 863.
2018-02-12 16:38:11.32 spid5s Database ‘master’ running the upgrade step from version 863 to version 864.
2018-02-12 16:38:11.37 spid5s Error: 17053, Severity: 16, State: 1.
2018-02-12 16:38:11.37 spid5s /var/opt/mssql/data/mastlog.ldf: Operating system error 31(A device attached to the system is not functioning.) encountered.
2018-02-12 16:38:12.40 spid5s Error: 928, Severity: 20, State: 1.
2018-02-12 16:38:12.40 spid5s During upgrade, database raised exception 9002, severity 17, state 0, address 0000000404DA13DE. Use the exception number to determine the cause.
2018-02-12 16:38:12.41 spid5s Error: 9002, Severity: 17, State: 0.
2018-02-12 16:38:12.41 spid5s The transaction log for database ‘master’ is full due to ‘NOTHING’.
The same thing with Sqlite, Database and journal files created, but when creating db objects
it can’t expand database file and fails. There is some dotnet code needed for that example
which i can provide if anyone is interested.
So it’s not microsoft mssql server exlusive error.
PS: tried also with volumes, but the result is unchanged.
Update:
Just found one solution:
downgrade windows server side to SMB 1.
This can be done by installing windows feature
SMB 1.0/CIFS File Sharing Support -> SMB 1.0/CIFS Server
install and reboot
change mount to vers=1.0
this exposes some serious security issues so i hope that someone figures out how to use SMB 2 or 3.