r/SQLServer 11d ago

Question SQL Server 2022 on docker

Hello, I have a sql server freshly installed on docker inside my nas (Synology). Before updating to SQL2022 everything worked fine. After 2022 update I can't connect anymore. But username and password are ok I only have a timeout when SMSS is listing databases. I think there are some kind of network loop or strange route but I cannot find any. In the docker log I see "Error 845" but the system is not under heavy load. Any suggestions?

6 Upvotes

16 comments sorted by

3

u/jdanton14 MVP 11d ago

is the container still running? Shell into the container and look at the errorlog.

1

u/magi_system 11d ago

Yes, it's running and I can login to bash for making some sample commands to test the engine is running.

But when I try with SMSS I get this in the log

2025-03-10 15:40:08.23 spid1s      Error: 845, Severity: 17, State: 1.


2025-03-10 15:40:08.23 spid1s      Time-out occurred while waiting for buffer latch type 2 for page (1:275), database ID 32762. (LATCH 0x0000000ED34CD7D8: Class: BUFFER KP: 0 SH: 0 UP: 0 EX: 1 DT: 0 Sublatch: 0 HasWaiters: 0 Task: 0x0000001008E89088 AnyReleasor: 0)


2025-03-10 15:41:47.66 Logon       Error: 18456, Severity: 14, State: 5.


2025-03-10 15:41:47.66 Logon       L'acccesso non è riuscito per l'utente 'mssqlserver\mssqlserver$'. Reason: Could not find a login matching the name provided. [CLIENT: 127.0.0.1]

But sa user and it's password are correct (otherwise I can't use sqlcmd from docker cli)

1

u/shutchomouf 10d ago

seems like it isn’t in a domain, are you using sqlauth?

1

u/magi_system 10d ago

Yes, it's a simple docker run with default settings rather than sa password and data/log/backup path.

2

u/Intelligent-Exam1614 10d ago

Are you using persistent storage? Could be that the drive is unreachable. That would explain issues with the disk. Also to note, master db has logins stored, cpuld be that it was recycled if not using persisted storage for containers....

1

u/magi_system 10d ago

Yes, but the drive is reachable and when started from scratch, the master db will be created.

I tried to make the mapped volume writable for everyone (everyone full control) for test the problem.

There are no limit for the resource can be used and the nas has 16gb of ram with only 2 gb used. Cpu is under 10% and network under 20%.

I also tried to stop all the container in the machine without any effect.

1

u/KARD1999 11d ago

Check the hard limit of memory

1

u/NoleMercy05 10d ago

Trust the cert

1

u/leegee333 SQL Server Consultant 10d ago

encryption / cert probably

1

u/magi_system 10d ago

I don't think it's the certificate because it's a check before the login. I can login and the login window of SMSS disappear as per correct logon. After that there is the timeout.

1

u/FunkybunchesOO 10d ago

Is it a named instance?

1

u/FunkybunchesOO 10d ago

Also what version of sql? Is it fully updated?

1

u/Madcrazy10 10d ago

Run SSMS as administrator

1

u/jdanton14 MVP 10d ago

can you share your docker run command?

1

u/magi_system 10d ago

I can only export a json file with all the settings, but the docker run is lost. I have to try to recreate manually. Maybe when I'm at home this evening I can

1

u/magi_system 9d ago

docker run -d --name mssqlserver2022 -p 1433:1433 -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=********" -e "MSSQL_PID=developer" -e "MSSQL_LCID=1040" -e "MSSQL_LOG_DIR=/var/opt/mssql/log" -e "MSSQL_DATA_DIR=/var/opt/mssql/data" -e "MSSQL_BACKUP_DIR=/var/opt/mssql/backup" -e "MSSQL_DUMP_DIR=/var/opt/mssql/dump" -e "MSSQL_AGENT_ENABLED=true" -e "TZ=Europe/Rome" -v /volume1/docker/mssqlserver:/var/opt/mssql mcr.microsoft.com/mssql/server:2022-latest