As with anything open source you’re prone to things changing without you necessarily being aware and the error message in the blog title is something that has been sprung upon me whilst tidying up demo’s for my latest session on Docker and SQL Server On Linux. I hadn’t touched these particular demo’s since October 2017 so as to when things stopped working, I don’t know but they certainly worked the last time I did the session but doing a re-pull of the images, things broke.
With the micorosft/mssql-server-linux images, if you wish to mount a volume to a container then you will experience an error message I’ve never seen in SQL Server:
The transaction log for database ‘master’ is full due to ‘NOTHING’.
I have tested:
and the issue was apparent on both images. The reason as highlighted on GitHub seems to be related to the filesystem, seeing as I’m running Docker for Windows I can’t change my file system from ext3 to ext4 like what others have done.
There is a workaround for this. The issue (certainly for me) only seems to be apparent if you try to mount a volume to a folder that already exists (ie. /var/opt/mssql/data/), mount to a new folder (ie. /sqlserver/data) then it will work:
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=P@ssword1' ` --cpus="2" ` --name SQLLinuxLocal1 -d -i ` -p 1433:1433 ` -v C:\Docker\SQLServer\Linux\SQLLinuxLocal:/sqlserver/data/ ` microsoft/mssql-server-linux:latest
Does not work:
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=P@ssword1' ` --cpus="2" ` --name SQLLinuxLocal2 -d -i ` -p 15106:1433 ` -v C:\Docker\SQLServer\Linux\SQLLinuxLocal:/var/opt/mssql/data/ ` microsoft/mssql-server-linux:latest
Or if you can, create a data volume instead and use that 😉
Once you have the files you need (ie. .bak file) in the /sqlserver/data folder within the container, you can then restore it using WITH MOVE to the /var/opt/mssql/data/ folder and this will work.