mssql-docker icon indicating copy to clipboard operation
mssql-docker copied to clipboard

sql server container exits immediately in windows

Open Vinodh247 opened this issue 6 years ago • 5 comments

I am trying to run SQL Server in windows 2016 server (OS Version: 10.0.14393 N/A Build 14393), i have tried multiple ways but the container jus exits after 5 seconds with error code (1). The logs are not clear and truncated, so i could not find anything. The worst part is i have been following up with MS support for almost a month but they say dont have the expertise to fix as this is a new technology, infact they referred this page to me to raise the issue and see if i am getting any help.

----The docker command i use docker run --name sqldkr1 -it -d -p 14112:1433 -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=' -e ExitOnError=N microsoft/mssql-server-windows-developer

I have used the "-e ExitOnError=N" switch as well but no use!

---The error logs [2J[H[1;33;40mVERBOSE: Starting SQL Server[22;37;40m [1;31;40mstart-service : Service 'SQL Server (MSSQLSERVER) (MSSQLSERVER)' cannot be [22;37;40m [1;31;40mstarted due to the following error: Cannot start service MSSQLSERVER on [22;37;40m [1;31;40mcomputer '.'.[22;37;40m [1;31;40mAt C:\start.ps1:27 char:1[22;37;40m [1;31;40m+ start-service MSSQLSERVER[22;37;40m [1;31;40m+ ~~~~~~~~~~~~~~~~~~~~~~~~~[22;37;40m [1;31;40m + CategoryInfo : OpenError: (System.ServiceProcess.ServiceControl [22;37;40m [1;31;40m ler:ServiceController) [Start-Service], ServiceCommandException[22;37;40m [1;31;40m + FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Comman [22;37;40m [1;31;40m ds.StartServiceCommand[22;37;40m [1;31;40m [22;37;40m

Vinodh247 avatar May 10 '19 14:05 Vinodh247

Having exact same issue here, the container stayed up for about 4 seconds then it exit!

rustedwizard avatar May 12 '19 23:05 rustedwizard

Hi,

I can run your docker command without error. Which version of docker are you using? Is that any particular reason to use windows containers?

forkazmoden avatar May 13 '19 02:05 forkazmoden

Hi,

I can run your docker command without error. Which version of docker are you using? Is that any particular reason to use windows containers?

I tried following command: docker run -d -p 1433:1433 -e sa_password= -e ACCEPT_EULA=Y microsoft/mssql-server-windows-developer above command runs without problem, container stays up without problem. However, when I change the image to microsoft/mssql-server-windows-developer:2017-latest, the container exit right after startup.

rustedwizard avatar May 13 '19 04:05 rustedwizard

VERBOSE: Starting SQL Server start-service : Service 'SQL Server (MSSQLSERVER) (MSSQLSERVER)' cannot be started due to the following error: Cannot start service MSSQLSERVER on computer '.'. At C:\start.ps1:27 char:1

  • start-service MSSQLSERVER
  •   + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceControl
     ler:ServiceController) [Start-Service], ServiceCommandException
      + FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Comman
     ds.StartServiceCommand
    
    
    

It looks like it is trying to start the sql server services but getting stopped with error. The error logs are of not much use since they're truncated in the end. Does anyone have an idea how to view the error log without getting truncated? Only then we can come to conclusion as to which is hindering the sql service from starting.

Vinodh247 avatar May 14 '19 14:05 Vinodh247

I am currently having this issue with SQL2019 development edition. Anyone figured out a way around this?

Jdipietro3 avatar Oct 07 '24 20:10 Jdipietro3