microsoft / mssql-docker

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

Config file emptied on restart of SQL edge module #546

Open FMauroy opened 4 years ago

FMauroy commented 4 years ago

Hello,

we are using SQL Server on an edge device, using the default module (microsoft/mssql-server-linux:latest). The edge device runs Ubuntu 18.04 with the Azure Edge runtime 1.08.

I installed it yesterday and have been doing tests, all went well. This morning, I could not connect using SSMS on my Windows laptop, so I restarted the module using this command: "iotedge restart SQLServerModule". After that, the module failed, with the following unique line in the log (iotedge logs SQLServerModule):

sqlservr: The configuration file '/var/opt/mssql/mssql.conf' failed to load (error: Line 0: The INI file is formatted incorrectly. File must contain at least one section.).

Checking the directory, the config file has a size of 0 byte.

Is this a known issue? Or sheer bad luck? An incompatibility with the edge runtime maybe?

Thanks for your help! fred

FMauroy commented 4 years ago

Answering my own question, I nanoed into the file and put just this:

[EULA]
accepteula = Y

nano /var/lib/docker/volumes/sqlVolume/_data/mssql.conf

I restarted the module using the same command as above, and SQL Server recovered all by itself. All is good, and the connection through my Win10 laptop is restored...

Problem solved, but if anyone has any idea about what happened and how to prevent it, it would be greatly appreciated!

Cheers fred