question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sqlservr: Unable to open /var/opt/mssql/.system/instance_id: File: pal.cpp:574 [Status: 0xC0000022 Access Denied errno = 0xD(13) Permission denied]

See original GitHub issue

sqlservr: Unable to open /var/opt/mssql/.system/instance_id: File: pal.cpp:574 [Status: 0xC0000022 Access Denied errno = 0xD(13) Permission denied]

When I run it using docker-compose all the containers start but one sqldata. I see the error above. Are others facing this error too? How do we resolve this?

I have a SQL Server default instance running on my dev machine.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
khanziaullahcommented, May 17, 2021

Hi @khanziaullah, thank you for reaching out.

It seems to be a docker volume mount issue. Did you change the sqldata volume mount (as shown below) to some directory than the default configuration?

For e.g :

volumes:
      - C:\App\Databases:/var/opt/mssql

If not, could you please try to clean up the existing volumes and run the solution again?

  • To do the clean-up of both docker images and existing docker volumes.
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
docker volume rm $(docker volume ls -q)

!IMPORTANT: Above commands will clean up all running containers and it’s data in your MacOS/Workstation. So you want to be careful on that.

  • To run the app
docker-compose up sqldata

Once it’s ready to accept the new connection, then you can bring up the other container by using the following command from a separate terminal.

docker-compose up

Resolved it by mounting just the data drive

volumes:
      - C:\App\Databases:/var/opt/mssql/data

0reactions
khanziaullahcommented, May 17, 2021

This program has encountered a fatal error and cannot continue running at Mon May 17 07:32:10 2021 SQL Server 2019 will run as non-root by default. The following diagnostic information is available:

     Reason: 0x00000007
     Status: 0xc0000034

This container is running as user mssql. Message: Failed to load persistent registry. status code: c0000034

To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216. Stack Trace: Executing: /opt/mssql/bin/handle-crash.sh with parameters file://package4/windows/system32/sqlpal.dll+0x000000000029697A handle-crash.sh /opt/mssql/bin/sqlservr 10 /opt/mssql/bin /var/opt/mssql/log/

 83bd0c0e-6a4f-4b27-9483-0801fcf4402c
 adad1ffd-af6c-468e-b50e-f88209371789
             file://package4/windows/system32/sqlpal.dll+0x0000000000295BC0

Ubuntu 20.04.2 LTS file://package4/windows/system32/sqlpal.dll+0x00000000002938C3 Capturing core dump and information to /var/opt/mssql/log… file://package4/windows/system32/sqlpal.dll+0x0000000000293A48 Mon May 17 07:32:15 UTC 2021 Capturing program information file://package4/windows/system32/sqlpal.dll+0x0000000000292A01 Mon May 17 07:32:16 UTC 2021 Attempting to capture a dump with paldumper for pid 10 WARNING: Capture attempt failure detected file://package4/windows/system32/sqlpal.dll+0x000000000029186C Attempting to capture a filtered dump with paldumper for pid 10 file://package4/windows/system32/sqlpal.dll+0x0000000000388631 WARNING: Attempt to capture dump failed. Reference /var/opt/mssql/log/core.sqlservr.10.temp/log/paldumper-debug.log for details Process: 10 - sqlservr Mon May 17 07:32:16 UTC 2021 Attempting to capture a dump with gdb Mon May 17 07:32:16 UTC 2021 Captured a dump with gdb Thread: 15 (application thread 0x8) Mon May 17 07:32:16 UTC 2021 Capturing program binaries Instance Id: 83bd0c0e-6a4f-4b27-9483-0801fcf4402c Mon May 17 07:32:17 UTC 2021 Compressing the dump files SQL Server 2019 will run as non-root by default. Crash Id: adad1ffd-af6c-468e-b50e-f88209371789 This container is running as user mssql. To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216. Executing: /opt/mssql/bin/handle-crash.sh with parameters handle-crash.sh /opt/mssql/bin/sqlservr 10 /opt/mssql/bin /var/opt/mssql/log/

 83bd0c0e-6a4f-4b27-9483-0801fcf4402c
 a464d9ab-1bab-4b38-834e-d18281fef4e5

Ubuntu 20.04.2 LTS Build stamp: c16e93856ea3dd0b1aa85aa17f346a411ffee957df855e490fc8f7ab9d05af0d Capturing core dump and information to /var/opt/mssql/log… Mon May 17 07:55:12 UTC 2021 Capturing program information Distribution: Ubuntu 20.04.2 LTS Mon May 17 07:55:12 UTC 2021 Attempting to capture a dump with paldumper for pid 10 Processors: 8 Total Memory: 13257519104 bytes Timestamp: Mon May 17 07:32:10 2021 WARNING: Capture attempt failure detected Last errno: 2 Attempting to capture a filtered dump with paldumper for pid 10 Last errno text: No such file or directory WARNING: Attempt to capture dump failed. Reference /var/opt/mssql/log/core.sqlservr.10.temp/log/paldumper-debug.log for details Mon May 17 07:55:12 UTC 2021 Attempting to capture a dump with gdb Mon May 17 07:55:12 UTC 2021 Captured a dump with gdb /bin/cat: /proc/10/maps: Permission denied Mon May 17 07:55:12 UTC 2021 Capturing program binaries Mon May 17 07:55:12 UTC 2021 Compressing the dump files /bin/cat: /proc/10/environ: Permission denied /usr/bin/find: ‘/proc/10/map_files’: Permission denied /usr/bin/find: ‘/proc/10/map_files’: Permission denied /usr/bin/find: ‘/proc/10/map_files’: Permission denied /usr/bin/find: ‘/proc/10/map_files’: Permission denied dmesg: read kernel buffer failed: Operation not permitted /usr/bin/timeout: failed to run command ‘/bin/journalctl’: No such file or directory /usr/bin/timeout: failed to run command ‘/bin/journalctl’: No such file or directory This program has encountered a fatal error and cannot continue running at Mon May 17 07:55:10 2021 The following diagnostic information is available:

     Reason: 0x00000007
     Status: 0xc0000034
    Message: Failed to load persistent registry. status code: c0000034

Stack Trace:
             file://package4/windows/system32/sqlpal.dll+0x000000000029697A
             file://package4/windows/system32/sqlpal.dll+0x0000000000295BC0
             file://package4/windows/system32/sqlpal.dll+0x00000000002938C3
             file://package4/windows/system32/sqlpal.dll+0x0000000000293A48
             file://package4/windows/system32/sqlpal.dll+0x0000000000292A01
             file://package4/windows/system32/sqlpal.dll+0x000000000029186C
             file://package4/windows/system32/sqlpal.dll+0x0000000000388631
    Process: 10 - sqlservr
     Thread: 15 (application thread 0x8)
Instance Id: 83bd0c0e-6a4f-4b27-9483-0801fcf4402c
   Crash Id: a464d9ab-1bab-4b38-834e-d18281fef4e5
Build stamp: c16e93856ea3dd0b1aa85aa17f346a411ffee957df855e490fc8f7ab9d05af0d

Distribution: Ubuntu 20.04.2 LTS Processors: 8 Total Memory: 13257519104 bytes Timestamp: Mon May 17 07:55:10 2021 Last errno: 2 Last errno text: No such file or directory /bin/cat: /proc/10/maps: Permission denied /bin/cat: /proc/10/environ: Permission denied /usr/bin/find: ‘/proc/10/map_files’: Permission denied /usr/bin/find: ‘/proc/10/map_files’: Permission denied /usr/bin/find: ‘/proc/10/map_files’: Permission denied /usr/bin/find: ‘/proc/10/map_files’: Permission denied dmesg: read kernel buffer failed: Operation not permitted /usr/bin/timeout: failed to run command ‘/bin/journalctl’: No such file or directory /usr/bin/timeout: failed to run command ‘/bin/journalctl’: No such file or directory

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring MSSQL Server on ubuntu - Cannot open or ...
No journal files were opened due to insufficient permissions. /usr/bin/tail: cannot open '/var/log/syslog' for reading: Permission denied ...
Read more >
Access is denied error and SQL Server doesn't start
Right-click the file or folder, select Properties, and then select the Security tab. · Select Advanced, select the Effective Access tab, and then ......
Read more >
Error 0xC0000022 access denied, while trying to activate ...
Hi, Error 0xC0000022 indicates that there's an issue with access rights and it can occur if the Software Protection Service is stopped or ......
Read more >
SQL Server Agent Service Won't Start Due to Access Denied
In this article we look at the SQL Server error failed to initialize SQL Agent log (reason: Access is denied) and how this...
Read more >
Operating system error 5(Access is denied.) on Linux - ...
1 Answer. The error indicates mssql doesn't have permissions to read the backup file. You can give other users (users other than the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found