Unable to connect to mssql docker container with host(Mac)

I have been able to connect to this container for over a month without any issues until today at work, I didn’t configure anything, closed my laptop last Friday, had not opened it since this morning. I was unable to connect to it with Azure Data Studio like I used to. I have tried opening a new container but still cannot connect to it.
This is what the error showed

Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=1; handshake=14999;

But I was able to run this command without any issues.

docker exec -it <containerID> /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P <MyPassword>

Any help would be appreciated. Thanks.

Edit: https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker?view=sql-server-ver15&pivots=cs1-bash This was the guide I followed building my container.

1 Like

Replying to my own issue. So the problem was ESET has its own firewall system, thus blocking my connection.

1 Like

Thanks for this, I’ve been struggling with this for days; I’d blamed it on an OSX update, which is the only change I’d done…

ESET must have updated itself as part of this process and turned it’s firewall on…

Initially thought replying to my own question was stupid until I saw your reply. Glad I could help!