dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.82k stars 453 forks source link

Sql Server `WithDataBindMount` Failed To Start #5055

Open Alirexaa opened 3 months ago

Alirexaa commented 3 months ago

Is there an existing issue for this?

Describe the bug

Adding SqlServer using WithDataBindMount failed to start. I use Windows 10 and think SqlServer has some issues with mount volume to the Windows host (see: https://stackoverflow.com/a/66238175).

Expected Behavior

The container starts without any errors.

Steps To Reproduce

Just add SqlServerServerResource using WithDataBindMount

var builder = DistributedApplication.CreateBuilder(args);

var sqlserver = builder.AddSqlServer("sqlserver")
.WithDataBindMount("C:\\sqldata");

builder.Build().Run();

Exceptions (if any)

No response

### .NET Version info .NET SDK: Version: 8.0.303 Commit: 29ab8e3268 Workload version: 8.0.300-manifests.280f8661 MSBuild version: 17.10.4+10fbfbf2e Runtime Environment: OS Name: Windows OS Version: 10.0.19045 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\8.0.303\ .NET workloads installed: [android] Installation Source: SDK 8.0.300, VS 17.10.34916.146 Manifest Version: 34.0.95/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.95\WorkloadManifest.json Install Type: FileBased [aspire] Installation Source: SDK 8.0.300, VS 17.10.34916.146 Manifest Version: 8.0.1/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.0.1\WorkloadManifest.json Install Type: FileBased [ios] Installation Source: SDK 8.0.300, VS 17.10.34916.146 Manifest Version: 17.2.8053/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.2.8053\WorkloadManifest.json Install Type: FileBased [maccatalyst] Installation Source: SDK 8.0.300, VS 17.10.34916.146 Manifest Version: 17.2.8053/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.2.8053\WorkloadManifest.json Install Type: FileBased [maui-windows] Installation Source: SDK 8.0.300, VS 17.10.34916.146 Manifest Version: 8.0.21/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.21\WorkloadManifest.json Install Type: FileBased Host: Version: 8.0.7 Architecture: x64 Commit: 2aade6beb0 .NET SDKs installed: 8.0.300 [C:\Program Files\dotnet\sdk] 8.0.303 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.30 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.19 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation] Environment variables: Not set global.json file: Not found Learn more: https://aka.ms/dotnet/info Download .NET: https://aka.ms/dotnet/download

Anything else?

Container Logs:

SQL Server 2022 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 24 18:28:29 2024
The following diagnostic information is available:
Reason: 0x00000006
Message: Termination of \SystemRoot\system32\AppLoader.exe was due to fatal error 0xC0000001
Address: 0x3fff99a6a868
Stack Trace:
file://package6/windows/system32/sqlpal.dll+0x0000000000209C12
file://package6/windows/system32/sqlpal.dll+0x0000000000208156
file://package6/windows/system32/sqlpal.dll+0x000000000026A9D0
file://package6/windows/system32/sqlpal.dll+0x000000000026A868
file://package6/windows/system32/sqlpal.dll+0x0000000000269296
file://package6/windows/system32/sqlpal.dll+0x0000000000201F6E
file://package6/windows/system32/sqlpal.dll+0x00000000003A02FB
file:///windows/system32/ntdll.dll+0x00000000000F64AF
file:///windows/system32/AppLoader.exe+0x0000000000002ED7
file:///windows/system32/AppLoader.exe+0x000000000000301D
file:///windows/system32/AppLoader.exe+0x000000000000303D
file:///windows/system32/AppLoader.exe+0x000000000000A378
file:///Windows/SYSTEM32/KERNEL32.DLL+0x0000000000017AF4
file:///windows/system32/ntdll.dll+0x00000000000244A1
Process: 10 - sqlservr
Thread: 52 (application thread 0xa4)
Instance Id: 9f17bc3e-874d-455e-b7a0-1a24219be74a
Crash Id: 486aeaae-86b9-4d81-b764-71c32ea25e64
Build stamp: d986b523c576d701c33a57ed10ecb573fee0027b11dee759032623389580414d
Distribution: Ubuntu 22.04.4 LTS
Processors: 4
Total Memory: 13303603200 bytes
Timestamp: Wed Jul 24 18:28:29 2024
Capturing a dump of 10
Successfully captured dump: /var/opt/mssql/log/core.sqlservr.7_24_2024_18_28_29.10
Executing: /opt/mssql/bin/handle-crash.sh with parameters
handle-crash.sh
/opt/mssql/bin/sqlservr
10
/opt/mssql/bin
/var/opt/mssql/log/
9f17bc3e-874d-455e-b7a0-1a24219be74a
486aeaae-86b9-4d81-b764-71c32ea25e64
/var/opt/mssql/log/core.sqlservr.7_24_2024_18_28_29.10
Ubuntu 22.04.4 LTS
Capturing core dump and information to /var/opt/mssql/log...
/bin/cat: /proc/10/maps: Permission denied
cat: /proc/10/environ: Permission denied
find: '/proc/10/map_files': Permission denied
find: '/proc/10/map_files': Permission denied
find: '/proc/10/map_files': Permission denied
find: '/proc/10/map_files': Permission denied
dmesg: read kernel buffer failed: Operation not permitted
timeout: failed to run command 'journalctl': No such file or directory
timeout: failed to run command 'journalctl': No such file or directory
Wed Jul 24 18:28:40 UTC 2024 Capturing program information
Dump already generated: /var/opt/mssql/log/core.sqlservr.7_24_2024_18_28_29.10, moving to /var/opt/mssql/log/core.sqlservr.10.temp/core.sqlservr.10.gdmp
Moving logs to /var/opt/mssql/log/core.sqlservr.10.temp/log/paldumper-debug.log
Wed Jul 24 18:28:40 UTC 2024 Capturing program binaries
Wed Jul 24 18:28:41 UTC 2024 Not compressing the dump files, moving instead to: /var/opt/mssql/log/core.sqlservr.07_24_2024_18_28_38.10.d
andrewzolotukhin commented 3 months ago

I got the same issue here. I think the problem is that files under the data volume are mounted under the wrong permissions (wrong owner). But not sure how I can fix that using Windows (my files are not inside of WSL2).