You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Alpine 3.19 runtime is not supported by 6.0.27 #5243
@tmds@agocke since you both responded on that issue, is this something that the DOTNET_RUNTIME_ID environment variable would fix? Would you expect that we set that environment variable in our container images for new OSes on .NET 6/7?
[Triage] I'm unable to reproduce this issue with the latest .NET SDK on Alpine 3.19. I see the portable RID, not the Alpine 3.19 RID when I run dotnet --info on the latest .NET SDK:
> docker pull mcr.microsoft.com/dotnet/sdk:6.0-alpine3.19
> docker run --rm mcr.microsoft.com/dotnet/sdk:6.0-alpine3.19 dotnet --info
Runtime Environment:
OS Name: alpine
OS Version: 3.19
OS Platform: Linux
RID: linux-musl-x64
Base Path: /usr/share/dotnet/sdk/6.0.419/
I noticed that you are running the 6.0.127 version of the SDK. This repo has never shipped a 6.0.127 version of the SDK in a container image. We always ship the latest feature band that's available in container images.
I also noticed that you didn't mention Docker at all in your issue - just want to check that you are running this in one of the official .NET containers (from mcr.microsoft.com/dotnet/*)?
[Triage] I'm unable to reproduce this issue with the latest .NET SDK on Alpine 3.19. I see the portable RID, not the Alpine 3.19 RID when I run dotnet --info on the latest .NET SDK:
> docker pull mcr.microsoft.com/dotnet/sdk:6.0-alpine3.19
> docker run --rm mcr.microsoft.com/dotnet/sdk:6.0-alpine3.19 dotnet --info
Runtime Environment:
OS Name: alpine
OS Version: 3.19
OS Platform: Linux
RID: linux-musl-x64
Base Path: /usr/share/dotnet/sdk/6.0.419/
I noticed that you are running the 6.0.127 version of the SDK. This repo has never shipped a 6.0.127 version of the SDK in a container image. We always ship the latest feature band that's available in container images.
I also noticed that you didn't mention Docker at all in your issue - just want to check that you are running this in one of the official .NET containers (from mcr.microsoft.com/dotnet/*)?
I've encountered this issue with the latest runtime docker image.
The SDK was just installed manually after exec into the container to check what's going on. Sorry for the confusion.
This looks like a bug on the Alpine Linux version of dotnet6. Some logics were backported from 7.0 to automatically add RIDs in the graph rather than adding them manually. It might not have worked, finally. Is this the Alpine Linux package, as added by apk add dotnet6-sdk?
EDIT: Disregard this. it is actually not a problem on the packaged version of Alpine Linux. The logics that we patched in actually work, but because they were never merged upstream runtime should've continued updating the RID graph manually.
FROM mcr.microsoft.com/dotnet/sdk:6.0.419-alpine3.19-amd64 as builder
WORKDIR /app
RUN dotnet new console && \
dotnet add package System.Data.SqlClient && \
echo "new System.Data.SqlClient.SqlConnection("").Open();" >> Program.cs && \
dotnet publish --output publish
FROM mcr.microsoft.com/dotnet/runtime:6.0.27-alpine3.19-amd64
WORKDIR /app
COPY --from=builder /app/publish .
CMD dotnet app.dll
Execution:
docker build . -t test
docker run -it --rm test
output:
Hello, World!
Unhandled exception. System.PlatformNotSupportedException: System.Data.SqlClient is not supported on this platform.
at System.Data.SqlClient.SqlConnection..ctor()
at Program.<Main>$(String[] args) in /app/Program.cs:line 3
I can confirm that setting the DOTNET_RUNTIME_ID=linux-musl-x64 solves the problem:
docker run -e DOTNET_RUNTIME_ID=linux-musl-x64 -it --rm test
Hello, World!
Unhandled exception. System.InvalidOperationException: The ConnectionString property has not been initialized.
at System.Data.SqlClient.SqlConnection.PermissionDemand()
It's not clear to me why the RID graph isn't still being updated for 6.0
Sorry, this one's on me for losing track. We've also had some reorg of ownership of various components.
If bringing RID updates for 6.0 is the only answer, we can do so. That said, I find updating the RID graph in servicing very distasteful. The servicing bar is reserved for bug fixes and security fixes, not support for new platforms. Our willingness to do this in the past speaks to the limited options we had.
If adding DOTNET_RUNTIME_ID is sufficient to provide support for .NET 6, I'd much rather we go with that solution.
I would expect that this issue would affect the portable build targetting alpine-linux available via dotnet.microsoft.com? If that is the case then RIDs should be updated for every alpine release, as that means that the portable build is broken on release. It is expected that .NET 6.0 will reach EOL just before release of Alpine 3.21. Perhaps we should pre-emptively add RIDs for 3.19 and 3.20?
Do you think there is a significant .NET user base of Alpine outside of containers? Honest question.
We're not quite there yet, but our maintenance policy doesn't include support for new OS versions. If there are acceptable workarounds for new OSes, we'll be motivated to rely on those.
If adding DOTNET_RUNTIME_ID is sufficient to provide support for .NET 6, I'd much rather we go with that solution.
I don't have enough knowledge about the runtime to know if the environment variable will fix all scenarios or not. We are debating delaying adding this env var to containers in case we want to add the Alpine 3.19 to the .NET 6 RID graph. Because it would be a second breaking change to remove it after the fact.
The servicing bar is reserved for bug fixes and security fixes
Is this not a kind of bug fix? If we have added RIDs to .NET 6 all the way up through 3.18, I feel like we should continue, otherwise we break users like the author of this issue.
@richlander Good question, I don't know. But, indeed, as @lbussell has said, we've added RIDs all through 3.18, and did the same for Fedora. This is not a question of adding a new platform, but continuing to maintain a rather strange way of doing things that, fortunately, is not required starting with .NET 7 due to work by @tmds, among others.
I didn't realize that you can only specify portable RIDs with this ENV. That's challenging.
One point of context is that we have a floating tag for Alpine. We can only update that to new Alpine versions if we're offering something compatible. We need to continue offering this floating tag because that's what customers expect.
Runtime needs to continue updating the RID graph to this end.
Just tried @attilaersek's repro with mcr.microsoft.com/dotnet/sdk:6.0.421-alpine3.19-amd64 and mcr.microsoft.com/dotnet/runtime:6.0.29-alpine3.19-amd64, the issue appears to be fixed:
PS> docker run --rm test
Hello, World!
Unhandled exception. System.InvalidOperationException: The ConnectionString property has not been initialized.
at System.Data.SqlClient.SqlConnection.PermissionDemand()
...
Activity
lbussell commentedon Mar 6, 2024
Maybe related: dotnet/runtime#96155
@tmds @agocke since you both responded on that issue, is this something that the
DOTNET_RUNTIME_IDenvironment variable would fix? Would you expect that we set that environment variable in our container images for new OSes on .NET 6/7?tmds commentedon Mar 7, 2024
Yes, you should set the envvar in the images, and that should fix this issue.
lbussell commentedon Mar 7, 2024
[Triage] I'm unable to reproduce this issue with the latest .NET SDK on Alpine 3.19. I see the portable RID, not the Alpine 3.19 RID when I run
dotnet --infoon the latest .NET SDK:I noticed that you are running the 6.0.127 version of the SDK. This repo has never shipped a 6.0.127 version of the SDK in a container image. We always ship the latest feature band that's available in container images.
I also noticed that you didn't mention Docker at all in your issue - just want to check that you are running this in one of the official .NET containers (from
mcr.microsoft.com/dotnet/*)?omajid commentedon Mar 7, 2024
cc @ayakael
attilaersek commentedon Mar 7, 2024
I've encountered this issue with the latest runtime docker image.
The SDK was just installed manually after exec into the container to check what's going on. Sorry for the confusion.
attilaersek commentedon Mar 7, 2024
@lbussell please see the runtime mentioned in my report: 6.0.27.
tmds commentedon Mar 7, 2024
We have a test for this here: https://github.com/redhat-developer/dotnet-regular-tests/tree/main/host-probes-rid-assets-legacy.
You can run it in the container image using these commands:
apk update apk add bash git clone https://github.com/redhat-developer/dotnet-regular-tests/ cd dotnet-regular-tests/host-probes-rid-assets-legacy/ ./test.shIf you run it in
mcr.microsoft.com/dotnet/sdk:6.0-alpine3.19, you'll see it fails.If you run it with
DOTNET_RUNTIME_ID=linux-musl-x64orDOTNET_RUNTIME_ID=alpine.3.18-x64set, it will pass.The test creates nuget packages. To avoid picking up the packages from the previous run, it's simplest to use a fresh container each time you run it.
ayakael commentedon Mar 7, 2024
This looks like a bug on the Alpine Linux version of dotnet6. Some logics were backported from 7.0 to automatically add RIDs in the graph rather than adding them manually. It might not have worked, finally. Is this the Alpine Linux package, as added by
apk add dotnet6-sdk?EDIT: Disregard this. it is actually not a problem on the packaged version of Alpine Linux. The logics that we patched in actually work, but because they were never merged upstream runtime should've continued updating the RID graph manually.
tmds commentedon Mar 8, 2024
Yes, the issue is in the upstream/Microsoft builds for .NET 6 witch rely on manual updates of the graph.
attilaersek commentedon Mar 8, 2024
Reproduction:
Dockerfile:
Execution:
output:
Hello, World! Unhandled exception. System.PlatformNotSupportedException: System.Data.SqlClient is not supported on this platform. at System.Data.SqlClient.SqlConnection..ctor() at Program.<Main>$(String[] args) in /app/Program.cs:line 3I can confirm that setting the
DOTNET_RUNTIME_ID=linux-musl-x64solves the problem:2 remaining items
agocke commentedon Mar 9, 2024
Sorry, this one's on me for losing track. We've also had some reorg of ownership of various components.
If bringing RID updates for 6.0 is the only answer, we can do so. That said, I find updating the RID graph in servicing very distasteful. The servicing bar is reserved for bug fixes and security fixes, not support for new platforms. Our willingness to do this in the past speaks to the limited options we had.
If adding
DOTNET_RUNTIME_IDis sufficient to provide support for .NET 6, I'd much rather we go with that solution.richlander commentedon Mar 11, 2024
I think the ENV may be sufficient. I suggest we start with that and see if we get feedback that motivates anything else.
ayakael commentedon Mar 11, 2024
I would expect that this issue would affect the portable build targetting alpine-linux available via dotnet.microsoft.com? If that is the case then RIDs should be updated for every alpine release, as that means that the portable build is broken on release. It is expected that .NET 6.0 will reach EOL just before release of Alpine 3.21. Perhaps we should pre-emptively add RIDs for 3.19 and 3.20?
richlander commentedon Mar 11, 2024
Do you think there is a significant .NET user base of Alpine outside of containers? Honest question.
We're not quite there yet, but our maintenance policy doesn't include support for new OS versions. If there are acceptable workarounds for new OSes, we'll be motivated to rely on those.
https://github.com/dotnet/core/blob/main/release-policies.md#support-phases
lbussell commentedon Mar 11, 2024
I don't have enough knowledge about the runtime to know if the environment variable will fix all scenarios or not. We are debating delaying adding this env var to containers in case we want to add the Alpine 3.19 to the .NET 6 RID graph. Because it would be a second breaking change to remove it after the fact.
Is this not a kind of bug fix? If we have added RIDs to .NET 6 all the way up through 3.18, I feel like we should continue, otherwise we break users like the author of this issue.
From @ayakael:
Yes, that is the build that we ship here in the Microsoft-created .NET container images.
richlander commentedon Mar 11, 2024
No, it isn't a bug fix. There is no "bug".
This is what it is.
ayakael commentedon Mar 11, 2024
@richlander Good question, I don't know. But, indeed, as @lbussell has said, we've added RIDs all through 3.18, and did the same for Fedora. This is not a question of adding a new platform, but continuing to maintain a rather strange way of doing things that, fortunately, is not required starting with .NET 7 due to work by @tmds, among others.
richlander commentedon Mar 11, 2024
I didn't realize that you can only specify portable RIDs with this ENV. That's challenging.
One point of context is that we have a floating tag for Alpine. We can only update that to new Alpine versions if we're offering something compatible. We need to continue offering this floating tag because that's what customers expect.
Runtime needs to continue updating the RID graph to this end.
ayakael commentedon Mar 11, 2024
PRed made: dotnet/runtime#99560
lbussell commentedon Apr 12, 2024
Just tried @attilaersek's repro with
mcr.microsoft.com/dotnet/sdk:6.0.421-alpine3.19-amd64andmcr.microsoft.com/dotnet/runtime:6.0.29-alpine3.19-amd64, the issue appears to be fixed:Thanks @agocke @ayakael @richlander for pushing this through!