Error “Msg 10054, level 20, State 0, Line 0” with MSSQL under Docker


  • I've set up several docker containers in my Ubuntu 16.04 LTS machine. All of them have in common the same [container image]( 

    It works pretty well, but some users have reported me a common issue when attempting a long-lasting query and about a minute after it execution, they get an error message:

    > Mens. 10054, Nivel 20, Estado 0, Línea 0
    > Error en el nivel del transporte al recibir los resultados del servidor. 
    > (provider: TCP Provider, error: 0 - Se ha forzado la interrupción de una conexión existente por el host remoto.)

    The error message is translated into english as `Msg 10054, level 20, State 0, Line 0`.

    Is there something I can modify under their configuration? 

    PS: I've noticed that in server's properties Connection > Remote servers connections > I've "Permitir conexiones remotas con este servidor checked", having 0 seconds (no wait time) of waittime.

    I'll attach one container's configuration snapshots as soon as I can.

    Thursday, June 14, 2018 6:50 AM

All replies

  • Hello,

    If only some users get a Connection error, then may be because the Firewall on their Workstation is blocking the Access: Configure the Windows Firewall to Allow SQL Server Access

    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Thursday, June 14, 2018 7:30 AM
  • Every user that run the query gets the same error.
    Thursday, June 14, 2018 7:35 AM
  • Hi Jon,


    According to you description, my understanding is that the connection was forcibly closed by the remote host when executing the long-lasting query. If anything is misunderstood, please let me know.


    It seems that the request timeouts when executing the long-lasting query. The TCP connection timeouts or connections to docker containers timeout could be the reason of the error. Please find out configurations about connection in your machine firewall and docker containers, then set them to appropriate values. By the way, have you encounter the same problem when executing other long-lasting requests.


    Best Regards,

    Emily Fei

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Friday, June 15, 2018 9:16 AM
  • Msg 10054, Level 20, State 0, Line 0 occurs when the connection is forcibly closed in SQL Server. The possible reasons could be connection was idle for a long time, database to which connection is connected is restored, or Kill command is issued by any other user. Try to reconnect to the server.  

    Friday, June 22, 2018 12:31 PM