microsoft / mssql-docker

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

Unable to start container on Linux 6.7 #868

Open quinnjr opened 9 months ago

quinnjr commented 9 months ago

Currently unable to start the container on Arch Linux as the host OS. The dump files for the failing sqlservr process don't really provide any insight as to why:

docker compose logs db
db-1  | SQL Server 2022 will run as non-root by default.
db-1  | This container is running as user mssql.
db-1  | Your master database file is owned by mssql.
db-1  | To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.
db-1  | This program has encountered a fatal error and cannot continue running at Mon Jan 15 18:19:00 2024
db-1  | The following diagnostic information is available:
db-1  | 
db-1  |          Reason: 0x00000001
db-1  |          Signal: SIGABRT - Aborted (6)
db-1  |           Stack:
db-1  |                  IP               Function
db-1  |                  ---------------- --------------------------------------
db-1  |                  000064eb280a3ce1 std::__1::bad_function_call::~bad_function_call()+0x96661
db-1  |                  000064eb280a36a6 std::__1::bad_function_call::~bad_function_call()+0x96026
db-1  |                  000064eb280a2c2f std::__1::bad_function_call::~bad_function_call()+0x955af
db-1  |                  00007c18f8810520 __sigaction+0x50
db-1  |                  00007c18f88649fc pthread_kill+0x12c
db-1  |                  00007c18f8810476 raise+0x16
db-1  |                  00007c18f87f67f3 abort+0xd3
db-1  |                  000064eb28074d96 std::__1::bad_function_call::~bad_function_call()+0x67716
db-1  |                  000064eb280b15b4 std::__1::bad_function_call::~bad_function_call()+0xa3f34
db-1  |                  000064eb280df318 std::__1::bad_function_call::~bad_function_call()+0xd1c98
db-1  |                  000064eb280df0fa std::__1::bad_function_call::~bad_function_call()+0xd1a7a
db-1  |                  000064eb2807b20a std::__1::bad_function_call::~bad_function_call()+0x6db8a
db-1  |                  000064eb2807ae80 std::__1::bad_function_call::~bad_function_call()+0x6d800
db-1  |         Process: 10 - sqlservr
db-1  |          Thread: 157 (application thread 0x264)
db-1  |     Instance Id: 83ef72ce-1100-44c4-913c-45d0df61ae44
db-1  |        Crash Id: 05e56c63-9bd1-47db-b3d5-c1f58cebd578
db-1  |     Build stamp: a9299dd605c652a3cea4246273441bcfaf48afb4b482ab9dc43771eecaf6600b
db-1  |    Distribution: Ubuntu 22.04.3 LTS
db-1  |      Processors: 32
db-1  |    Total Memory: 67119079424 bytes
db-1  |       Timestamp: Mon Jan 15 18:19:00 2024
db-1  |      Last errno: 2
db-1  | Last errno text: No such file or directory
db-1  | Capturing a dump of 10
db-1  | Successfully captured dump: /var/opt/mssql/log/core.sqlservr.1_15_2024_18_19_0.10
db-1  | Executing: /opt/mssql/bin/handle-crash.sh with parameters
db-1  |      handle-crash.sh
db-1  |      /opt/mssql/bin/sqlservr
db-1  |      10
db-1  |      /opt/mssql/bin
db-1  |      /var/opt/mssql/log/
db-1  |      
db-1  |      83ef72ce-1100-44c4-913c-45d0df61ae44
db-1  |      05e56c63-9bd1-47db-b3d5-c1f58cebd578
db-1  |      
db-1  |      /var/opt/mssql/log/core.sqlservr.1_15_2024_18_19_0.10
db-1  | 
db-1  | Ubuntu 22.04.3 LTS
db-1  | Capturing core dump and information to /var/opt/mssql/log...

Docker-compose file:

version: '3'
services:
  db:
    image: 'mcr.microsoft.com/mssql/server:2022-latest'
    environment:
      - ACCEPT_EULA=Y
      - MSSQL_SA_PASSWORD=<there would be a password here>
      - MSSQL_PID=Developer
    volumes:
      - ./logs:/var/opt/mssql/log
      - ./data:/var/opt/mssql/data
    ports:
      - 1433:1433

Docker logs and data directory are set as UID:GID 10001:10001.

thomasvm commented 7 months ago

2022-latest works perfectly on 6.8.1-arch1-1

sergiuser1 commented 7 months ago

Not exactly related to the issue, but I upgrade to 2022-latest from 2019-latest and now I get the following error when I connect from a .NET core application:

 Login failed for user 'sa'. Reason: An error occurred while evaluating the password.

The password specified in the MSSQL_SA_PASSWORD env variable is the same as the one in the app, and the logs from it are:

 Microsoft.Data.SqlClient.SqlException (0x80131904): Login failed for user 'sa'.

Has anyone had the same issue?

andros0689 commented 7 months ago

Not exactly related to the issue, but I upgrade to 2022-latest from 2019-latest and now I get the following error when I connect from a .NET core application:

 Login failed for user 'sa'. Reason: An error occurred while evaluating the password.

The password specified in the MSSQL_SA_PASSWORD env variable is the same as the one in the app, and the logs from it are:

Microsoft.Data.SqlClient.SqlException (0x80131904): Login failed for user 'sa'.

Has anyone had the same issue?

Hi @sergiuser1

No, I don't have that error but I still using SA_PASSWORD, not MSSQL_SA_PASSWORD

sergiuser1 commented 7 months ago

Not exactly related to the issue, but I upgrade to 2022-latest from 2019-latest and now I get the following error when I connect from a .NET core application:

 Login failed for user 'sa'. Reason: An error occurred while evaluating the password.

The password specified in the MSSQL_SA_PASSWORD env variable is the same as the one in the app, and the logs from it are:

Microsoft.Data.SqlClient.SqlException (0x80131904): Login failed for user 'sa'.

Has anyone had the same issue?

Turns out it was a race condition, and MSSQL was simply not completely up yet. I've added a healthcheck to it, and waiting for service_healthy before starting the .NET app fixes it.

sergiuser1 commented 7 months ago

Not exactly related to the issue, but I upgrade to 2022-latest from 2019-latest and now I get the following error when I connect from a .NET core application:

 Login failed for user 'sa'. Reason: An error occurred while evaluating the password.

The password specified in the MSSQL_SA_PASSWORD env variable is the same as the one in the app, and the logs from it are:

Microsoft.Data.SqlClient.SqlException (0x80131904): Login failed for user 'sa'.

Has anyone had the same issue?

Hi @sergiuser1

No, I don't have that error but I still using SA_PASSWORD, not MSSQL_SA_PASSWORD

That's deprecated according to Microsoft: https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker?view=sql-server-2017&tabs=cli&pivots=cs1-bash#run-the-container

rubnogueira commented 6 months ago

Is it possible to backport the 2022-latest fix but for azure-sql-edge v1? I'm using that version because I need arm64 support, which is currently deprecated in v2, and I can't use it anymore.

toxik commented 6 months ago

an azure-sql-edge v1.0.8 arm64 with the patch would be very much appreciated!

JimMoen commented 6 months ago

The image has been updated: 2022-latest amd64 No Dockerfile Ubuntu 22.04 05/31/2022 03/14/2024 latest amd64 No Dockerfile Ubuntu 22.04 09/21/2018 03/14/2024

It works for me again on Fedora 6.7.9-200.fc39.x86_64

Yes. the fix included in 2022-CU12 change log: https://learn.microsoft.com/en-us/troubleshoot/sql/releases/sqlserver-2022/cumulativeupdate12#2958874

Unfortunately, SQL Server 2019 havn't release a new cumulative-update with the fix.

leonardohtorres commented 6 months ago

For me, I had to use MSSQL 2022 image instead 2019 and then everything worked (Of course previously, I got the last backup from the databases and restored it to the MSSQL 2022). The MSSQL is running on Openshift/OKD 4.15

Marcosdg3 commented 6 months ago

Are there any plans for a SQL Server 2019 release?

Marcosdg3 commented 5 months ago

Are there any plans for a SQL Server 2019 release?

Looks like this has been fixed in 2019-CU26-ubuntu-20.04 release which is now 2019-latest.

Table here hasn't been updated here yet https://hub.docker.com/_/microsoft-mssql-server/ but checked the tag list and saw the new release (https://mcr.microsoft.com/v2/mssql/server/tags/list). All is working great now on macos, thank you!

hockdudu commented 5 months ago

I can confirm that the latest version of 2019-latest resolved the issue, tested on Fedora with Linux 6.8.7.

MPavleski commented 5 months ago

Also confirming that 2019-latest resolved the issue under Linux 6.8.7, tested on Arch.

Domgru commented 4 months ago

an azure-sql-edge v1.0.8 arm64 with the patch would be very much appreciated!

Downgrading the kernel to v6.6.4 helped for me. But v1.0.8 would be great.

beikov commented 3 months ago

Running into the same problem with the 2017 image when upgrading to Fedora 40 which comes with kernel 6.8. Please release a fixed docker image for the 2017 version. We need that for testing in Hibernate ORM.

kelkmere commented 1 month ago

This problem just happens to my AWS EC2 Ubuntu 22.04 instance. I fixed it by downgrading the kernel from 6.8.0-1015-aws to 6.5.0-1014-aws. Here's the instruction: https://discourse.ubuntu.com/t/how-to-downgrade-the-kernel-on-ubuntu-20-04-to-the-5-4-lts-version/26459

Illutax commented 1 month ago

It happened also on my AWS EC2 Ubuntu 22.04.

We fixed it by updating the MSSQL Image from mcr.microsoft.com/mssql/server:2019-CU13-ubuntu-20.04 to mcr.microsoft.com/mssql/server:2019-CU28-ubuntu-20.04

martin-schulze-e2m commented 3 weeks ago

Are there any plans for a SQL Server 2019 release?

Looks like this has been fixed in 2019-CU26-ubuntu-20.04 release which is now 2019-latest.

Table here hasn't been updated here yet https://hub.docker.com/_/microsoft-mssql-server/ but checked the tag list and saw the new release (https://mcr.microsoft.com/v2/mssql/server/tags/list). All is working great now on macos, thank you!

I just found 2017-latest to be updated on 2024-09-10 in https://hub.docker.com/_/microsoft-mssql-server/ and it is working again.

jcompagner commented 3 weeks ago

this week i upgraded and restart my ubuntu 22.04.5 LTS and i noticed that the kernel did go from: 6.5.0-1024-aws to 6.8.0-1015-aws. After restart the sqlserver 2022 didn't work anymore We did a pull of all the latest versions of that or specific CU's (like 12,13 or the latest) but none of them work. But in these comments it is said that it is fixed but why do we still get:

` This program has encountered a fatal error and cannot continue running at Wed Sep 25 20:20:18 2024 The following diagnostic information is available:

     Reason: 0x00000001
     Signal: SIGABRT - Aborted (6)
      Stack:
             IP               Function
             ---------------- --------------------------------------
             00005e170c63ca61 std::__1::bad_function_call::~bad_function_call()+0x97ab1
             00005e170c63c426 std::__1::bad_function_call::~bad_function_call()+0x97476
             00005e170c63b9af std::__1::bad_function_call::~bad_function_call()+0x969ff
             0000702c8cb12520 __sigaction+0x50
             0000702c8cb669fc pthread_kill+0x12c
             0000702c8cb12476 raise+0x16
             0000702c8caf87f3 abort+0xd3
             00005e170c63b88e std::__1::bad_function_call::~bad_function_call()+0x968de
             00005e170c5ce351 std::__1::bad_function_call::~bad_function_call()+0x293a1
             00005e170c5ced5d std::__1::bad_function_call::~bad_function_call()+0x29dad
             00005e170c59879b std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char>>::str() const+0xc7fb
             00005e170c57acfc <unknown>
             0000702c8caf9d90 __libc_init_first+0x90

`

for all releases of 2022 that we try to use?

tobiajo commented 3 weeks ago

What is causing the issue?

danarj commented 3 weeks ago

I'm having the same issue after upgrading the kernel to 6.8.0 now I don't have any work around

Illutax commented 3 weeks ago

What is causing the issue?

An Linux kernel update. Now older mssql docker images can't be run successfully. Try updating the docker image to an newer release.

jcompagner commented 3 weeks ago

What is causing the issue?

An Linux kernel update. Now older mssql docker images can't be run successfully. Try updating the docker image to an newer release.

But we tried the latest of a 2022 build , and none work anymore on our machine that runs ubuntu 2022.04 LTS with kernen 6.8

005Dikshant commented 3 weeks ago

This is happening for my local ubuntu 22.04.5 with kernel - Linux version 6.8.0-40-generic, when I am trying to build the docker image from the compose file, i am getting similar error -

this is my base image for sql server - FROM mcr.microsoft.com/mssql/server:2017-CU24-ubuntu-16.04

This program has encountered a fatal error and cannot continue running at Mon Sep 30 13:46:01 2024 mssql-prof` | The following diagnostic information is available: mssql-prof | mssql-prof | Reason: 0x00000001 mssql-prof | Signal: SIGABRT - Aborted (6) mssql-prof | Stack: mssql-prof | IP Function mssql-prof | ---------------- -------------------------------------- mssql-prof | 00005f74251cbc35 mssql-prof | 00005f74251cb6c2 mssql-prof | 00005f74251cac11 mssql-prof | 00007af8dcb094c0 killpg+0x40 mssql-prof | 00007af8dcb09438 gsignal+0x38 mssql-prof | 00007af8dcb0b03a abort+0x16a mssql-prof | 00005f7425131fed mssql-prof | 00005f74251d7714 mssql-prof | 00005f74251fbd98 mssql-prof | 00005f74251fbb10 mssql-prof | 00005f74251408f4 mssql-prof | 00005f7425140489 mssql-prof | Process: 12 - sqlservr mssql-prof | Thread: 84 (application thread 0x138) mssql-prof | Instance Id: 252bbfb1-44a3-446a-b822-1c1f310459a2 mssql-prof | Crash Id: 1e0024a2-d6c5-499a-b853-4fbc68acb9e3 mssql-prof | Build stamp: 23b9dfd98170ce033c3334f80ad499e84f504fec8d90876c718146f04b79943f mssql-prof | Distribution: Ubuntu 16.04.7 LTS mssql-prof | Processors: 12 mssql-prof | Total Memory: 33463422976 bytes mssql-prof | Timestamp: Mon Sep 30 13:46:01 2024 mssql-prof | Last errno: 2 mssql-prof | Last errno text: No such file or directory mssql-prof | Executing: /opt/mssql/bin/handle-crash.sh with parameters mssql-prof | handle-crash.sh mssql-prof | /opt/mssql/bin/sqlservr mssql-prof | 12 mssql-prof | /opt/mssql/bin mssql-prof | /var/opt/mssql/log/ mssql-prof |
mssql-prof | 252bbfb1-44a3-446a-b822-1c1f310459a2 mssql-prof | 1e0024a2-d6c5-499a-b853-4fbc68acb9e3 mssql-prof |
mssql-prof | mssql-prof | Ubuntu 16.04.7 LTS mssql-prof | Capturing core dump and information to /var/opt/mssql/log... mssql-prof | dmesg: read kernel buffer failed: Operation not permitted mssql-prof | No journal files were found. mssql-prof | No journal files were found. mssql-prof | Mon Sep 30 13:46:01 UTC 2024 Capturing program information mssql-prof | Mon Sep 30 13:46:02 UTC 2024 Attempting to capture a dump with paldumper for pid 12 mssql-prof | Captured a dump with paldumper mssql-prof | Mon Sep 30 13:46:02 UTC 2024 Capturing program binaries mssql-prof | Mon Sep 30 13:46:02 UTC 2024 Compressing the dump files

Illutax commented 3 weeks ago

This is happening for my local ubuntu 22.04.5 with kernel - Linux version 6.8.0-40-generic, when I am trying to build the docker image from the compose file, i am getting similar error -

this is my base image for sql server - FROM mcr.microsoft.com/mssql/server:2017-CU24-ubuntu-16.04

This program has encountered a fatal error and cannot continue running at Mon Sep 30 13:46:01 2024 mssql-prof` | The following diagnostic information is available: mssql-prof | mssql-prof | Reason: 0x00000001 mssql-prof | Signal: SIGABRT - Aborted (6) mssql-prof | Stack: mssql-prof | IP Function mssql-prof | ---------------- -------------------------------------- mssql-prof | 00005f74251cbc35 mssql-prof | 00005f74251cb6c2 mssql-prof | 00005f74251cac11 mssql-prof | 00007af8dcb094c0 killpg+0x40 mssql-prof | 00007af8dcb09438 gsignal+0x38 mssql-prof | 00007af8dcb0b03a abort+0x16a mssql-prof | 00005f7425131fed mssql-prof | 00005f74251d7714 mssql-prof | 00005f74251fbd98 mssql-prof | 00005f74251fbb10 mssql-prof | 00005f74251408f4 mssql-prof | 00005f7425140489 mssql-prof | Process: 12 - sqlservr mssql-prof | Thread: 84 (application thread 0x138) mssql-prof | Instance Id: 252bbfb1-44a3-446a-b822-1c1f310459a2 mssql-prof | Crash Id: 1e0024a2-d6c5-499a-b853-4fbc68acb9e3 mssql-prof | Build stamp: 23b9dfd98170ce033c3334f80ad499e84f504fec8d90876c718146f04b79943f mssql-prof | Distribution: Ubuntu 16.04.7 LTS mssql-prof | Processors: 12 mssql-prof | Total Memory: 33463422976 bytes mssql-prof | Timestamp: Mon Sep 30 13:46:01 2024 mssql-prof | Last errno: 2 mssql-prof | Last errno text: No such file or directory mssql-prof | Executing: /opt/mssql/bin/handle-crash.sh with parameters mssql-prof | handle-crash.sh mssql-prof | /opt/mssql/bin/sqlservr mssql-prof | 12 mssql-prof | /opt/mssql/bin mssql-prof | /var/opt/mssql/log/ mssql-prof | mssql-prof | 252bbfb1-44a3-446a-b822-1c1f310459a2 mssql-prof | 1e0024a2-d6c5-499a-b853-4fbc68acb9e3 mssql-prof | mssql-prof | mssql-prof | Ubuntu 16.04.7 LTS mssql-prof | Capturing core dump and information to /var/opt/mssql/log... mssql-prof | dmesg: read kernel buffer failed: Operation not permitted mssql-prof | No journal files were found. mssql-prof | No journal files were found. mssql-prof | Mon Sep 30 13:46:01 UTC 2024 Capturing program information mssql-prof | Mon Sep 30 13:46:02 UTC 2024 Attempting to capture a dump with paldumper for pid 12 mssql-prof | Captured a dump with paldumper mssql-prof | Mon Sep 30 13:46:02 UTC 2024 Capturing program binaries mssql-prof | Mon Sep 30 13:46:02 UTC 2024 Compressing the dump files

Try 2017-CU31-GDR2-ubuntu-18.04

005Dikshant commented 3 weeks ago

i downgrade from 6.8.0-40 generic to 6.5.0.41-generic now it is working again for my local system.

alex-jitbit commented 2 weeks ago

This is not an issue with Docker image, but a much bigger issue with MSSQL itself. Upgrading kernel on my AWS instances is now causing mssql 2017 to fail with this exact same error (under kernel 6.8.0). Booting to an older kernel (6.5.0-101`7) resolves the issue.