microsoft / mssql-docker

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

PAGELATCH_SH on model_replicatedmaster + Login failed for user 'sql1\sql1$' #907

Open cedro-gasque opened 6 days ago

cedro-gasque commented 6 days ago

Attempting to deploy the image onto Synology DSM, I have two different errors that keep occurring, the first hard crashing the server after a few minutes whether container is restarted or fresh.

sudo docker run -e "ACCEPT_EULA=Y" \
   -e "TZ=America/Los_Angeles" --rm \
   -e "MSSQL_SA_PASSWORD=[ my password is not the issue ]" \
   -v sql-dev:/var/opt/mssql \
   -p 1433:1433 --name sql1 --hostname sql1 -d \
   mcr.microsoft.com/mssql/server:2022-latest
> uname -a
> Linux [ . . . ] 4.4.302+ #69057 SMP Fri Jan 12 17:01:14 CST 2024 x86_64 GNU/Linux synology_r1000_923+

The first:

A time-out occurred while waiting for buffer latch -- type 2, bp 00000006D07B21C0, page 1:275, stat 0x10b, database id: 32762, allocation unit Id: 281474980642816/3932160, task 0x0000000D893B4CA8 : 0, waittime 300 seconds, flags 0x1a, owning task 0x0000000D8057A108. Not continuing to wait.

I've checked on multiple containers and the database id always points to the model_replicatedmaster. I have also attempted to investigate through many a Microsoft tutorial but all I have figured out is that it's a PAGELATCH_SH. I can rarely connect and run any queries to debug before the server stops waiting.

The second:

Error: 18456, Severity: 14, State: 5.
Login failed for user 'sql1\sql1$'. Reason: Could not find a login matching the name provided. [CLIENT: 127.0.0.1]

This error will just randomly appear every 5 seconds. I've "fixed" it by creating a container with the same configuration on Windows and just copying the entire /var/opt/mssql/ to the NAS and mounting it on the container, which seems to stop this one from appearing, but not the other one.

It also used to say '\sql1$' but I think it changed when I started to force chown and chgrp mssql the volume.

Is this a lost cause? I've been trying to get it working for weeks...

cedro-gasque commented 6 days ago

UPDATE: I found a random forum post that actually solved it. The bug seems to only exist with the 2022 image and both errors completely disappear if I use the 2019 image (2019-latest)