skip to Main Content

I’m currently trying to use docker-compose to set up two containers, one is using Dockerfile while another is from a public available image:

version: '3.4'

services:
  sampleweb:
    image: ${DOCKER_REGISTRY-}saucedsampleweb
    build:
      context: .
      dockerfile: SaucedSampleWeb/Dockerfile
    links:
      - "mssql:database"
  mssql:
    image: mcr.microsoft.com/mssql/server:2019-latest
    container_name: sauced_mssql
    restart: on-failure
    environment:
      - MSSQL_SA_PASSWORD=<YourStrong@PassW0rd>
      - ACCEPT_EULA=Y
      - MSSQL_PID=Express
    ports:
      - "1433:1433"
    volumes:
      - ./mssql_volume:/var/opt/mssql

The web version is boosting up nicely, however there is a problem with the SQL Server container:

SQL Server 2019 will run as non-root by default.
This container is running as user mssql.
To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.
** ERROR: [AppLoader] Failed to load LSA: 0xc0070102
AppLoader: Exiting with status=0xc0070102
This program has encountered a fatal error and cannot continue running at Wed Jul  5 00:57:05 2023
The following diagnostic information is available:
         Reason: 0x00000006
        Message: Termination of SystemRootsystem32AppLoader.exe was due to fatal error 0xC0000001
        Address: 0x3fffb308a14f
    Stack Trace:
                 file://package4/windows/system32/sqlpal.dll+0x000000000000E7AF
                 file://package4/windows/system32/sqlpal.dll+0x000000000000BA99
                 file://package4/windows/system32/sqlpal.dll+0x000000000008A3B2
                 file://package4/windows/system32/sqlpal.dll+0x000000000008A14F
                 file://package4/windows/system32/sqlpal.dll+0x0000000000088558
                 file://package4/windows/system32/sqlpal.dll+0x0000000000003D1F
                 file://package4/windows/system32/sqlpal.dll+0x0000000000205468
                 file:///windows/system32/AppLoader.exe+0x000000000000371F
                 file:///windows/system32/AppLoader.exe+0x0000000000003869
                 file:///windows/system32/AppLoader.exe+0x0000000000003889
                 file:///windows/system32/AppLoader.exe+0x000000000000A8E8
                 file:///Windows/SYSTEM32/KERNEL32.DLL+0x0000000000014414
                 file:///windows/system32/ntdll.dll+0x0000000000075541
        Modules:
                 file://package4/windows/system32/sqlpal.dll=81C2F86CAE7091994C5F4BA9E6CEFADE1
                 file:///windows/system32/AppLoader.exe=C4DBE7266EFD0F6D4CAEBDEC5FA8C5091
                 file:///Windows/SYSTEM32/KERNEL32.DLL=C715300FB2664729A6126A3F591E6F302
                 file:///windows/system32/ntdll.dll=45137AA3F9814512B3123991067EEE6E2
        Process: 9 - sqlservr
         Thread: 39 (application thread 0x74)
    Instance Id: d48cac8a-44b7-41e8-bfda-896e01e47003
       Crash Id: 32e0f422-0851-4543-9238-f1f58c7892eb
    Build stamp: b983254682fd9a2a773ef70df14ef5648600759bd09a8dfcfe416e983a820c93
   Distribution: Ubuntu 20.04.6 LTS
     Processors: 8
   Total Memory: 8187215872 bytes
      Timestamp: Wed Jul  5 00:57:05 2023
Capturing a dump of 9
Successfully captured dump: /var/opt/mssql/log/core.sqlservr.7_5_2023_0_57_5.9
Executing: /opt/mssql/bin/handle-crash.sh with parameters
     handle-crash.sh
     /opt/mssql/bin/sqlservr
     9
     /opt/mssql/bin
     /var/opt/mssql/log/
     
     d48cac8a-44b7-41e8-bfda-896e01e47003
     32e0f422-0851-4543-9238-f1f58c7892eb
     
     /var/opt/mssql/log/core.sqlservr.7_5_2023_0_57_5.9
Ubuntu 20.04.6 LTS
Capturing core dump and information to /var/opt/mssql/log...
/bin/cat: /proc/9/maps: Permission denied
/bin/cat: /proc/9/environ: Permission denied
/usr/bin/find: '/proc/9/task/9/fdinfo': Permission denied
/usr/bin/find: '/proc/9/task/11/fdinfo': Permission denied
/usr/bin/find: '/proc/9/task/12/fdinfo': Permission denied
/usr/bin/find: '/proc/9/task/13/fdinfo': Permission denied
...
/usr/bin/find: '/proc/9/map_files': Permission denied
/usr/bin/find: '/proc/9/fdinfo': Permission denied
/usr/bin/find: '/proc/9/task/9/fdinfo': Permission denied
...

When I use docker to run the image in admin level it still build the container normally:

docker run -d -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=<YourStrong@PassW0rd>" --name my-mssql-server -p 1433:1433 mcr.microsoft.com/mssql/server:2019-latest

Since I assume the issue is related to permission level, I have attempt to:

  • Run the Visual Studio as Administrator then either use docker-compose up or start debugging with docker compose option.
  • Run sudo docker compose up -d <docker> in admin level of permission

But neither of those resolve the issue. What is wrong with my current set-up?

2

Answers


  1. Chosen as BEST ANSWER

    I managed to resolve the issue, and turns out it is not about the root user permission level that is the issue. From this post about MSSQL volume mount I need to mount /var/opt/mssql/data instead of just /var/opt/mssql/ since it has something to do with using Windows as host machine.


  2. Going by the error. SQL server will need root privilege to run.

    Good read on the same:
    Get root access inside mssql docker container

    Adding below the line in Dockerfile:

    user: root
    

    This configuration allows your SQL process to run on elevated privilege and thus have access to the proc directory which is required to create pid in Linux OS.

    Hope this helps.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search