mssql-docker
mssql-docker copied to clipboard
Time freezes upon suspend (ubuntu) - GETDATE(), GETUTCDATE()
I'm running mssql on my laptop with:
- Ubuntu 20.04.1
- Kernel: 5.4.0-52-generic
- Docker: 19.03.13, build 4484c46d9d
- Image: mcr.microsoft.com/mssql/server:2019-CU8-ubuntu-16.04
Normally a query like: SELECT GETDATE() as 'GETDATE()', SYSDATETIME() as 'SYSDATETIME()', GETUTCDATE() as 'GETUTCDATE()'
shows the correct time for all three functions.
However if I put my laptop to sleep (suspend) and then wake it up they return different values.
GETDATE()
and GETUTCDATE()
get stuck at the time the computer was suspended. SYSDATETIME()
still works correctly.
Running date
inside the container also works correctly.
If I restart the container everything works fine again. Seems like the way ubuntu goes to sleep doesn't play nice with how mssql gets it's time? :man_shrugging:
Hy, I've come across the same issue: Ubuntu: 20.04.1 Docker: 19.03.13 Image: mcr.microsoft.com/mssql/server:2019-CU3-ubuntu-18.04
Having the same problem on fedora. Fedora: 33 Docker: 20.10.6, build 370c289 Image: mcr.microsoft.com/mssql/server Version: Microsoft SQL Server 2019 (RTM-CU8) (KB4577194) - 15.0.4073.23 (X64)
Just wanted to mention that this isn't limited to Docker or Linux. We're having the same issue running without containers on Win10 systems as well. We never had a call about this with our SQL-backed app with SQL 2014->2017. Since updating to 2019, we've had many customers call with "frozen" report dates in the system. We've traced it down to the same details as above... following system suspend/resume, GetUTCDate returns the same timestamp forever until the SQL service is restarted.
I have exactly the same issue.
Ubuntu 20.04 | Manjaro latest docker 20.10.12, build e91ed5707e Image: mcr.microsoft.com/mssql/server Version: Microsoft SQL Server 2019 (RTM-CU13) (KB5005679) - 15.0.4178.1 (X64)
Is there any reasonable workaround? I may develop a script that restarts the container on each resume from suspend, but it is totally unneeded if a proper fix appers.
[mcr.microsoft.com/mssql/server:2019-GDR1-ubuntu-16.04]
Same issue.
The same situation. Better to use SYSDATETIME() instead GETDATE() or GETUTCDATE()