-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segmentation fault error occurs while running EF core migration bundle in docker desktop on MacOS after migrating from ef core 6 to ef core 8 #2220
Comments
Moving this to the SqlClient repo. See also Encrypt defaults to true for SQL Server connections. |
Thanks, Arthur. Yeah, I saw that breaking change and that is why I have added Encrypt=false. |
Just a tiny update - I just have tested this on mac with Intel I7 based chip (running ventura 13.6) and all works fine there. |
@nikjuice so, is it confirmed that this is not SqlClient related issue? |
@JRahnama I don't think it is confirmed. With my knowledge and result that I have it is hard to say is it SQLClient related or not. I suspect that it is something specific in core .net related to Linux implementation that is used by SQLClient. |
I am getting a similar issue, but in our case we are running a build server on Ubuntu (via Azure Devops), using Standard_F2s_v2 Azure virtual machines. This started to happen after we updated EF core to .net 8. Here is how we generate the bundle:
And then we run it during release (on the same build environment). Note that we have always used the 'Encrypt=True' option in the connection string here:
Here is the error we are seeing
I tried it with the --verbose flag, but there are no additional logs - it seems to crash right away? |
I was having a similar issue but on version 6. In my case Microsoft.EntityFrameworkCore.SqlServer 6.0.4 was depending on Microsoft.Data.SqlClient version 2.1.4, which has known problems with segfaults on linux machines (See here) Adding an explicit dependency on Microsoft.Data.SqlClient for version 5.1.2 fixed the peer dependency for me, and removed the SegFault. I imagine anything >4.8.4 would work, but cannot verify that. |
@Zaragor Yes, I thought this might be the case, but the 8.0.0 version of Microsoft.EntityFrameworkCore.SqlServer has an implicit dependency to 5.1.1 of Microsoft.Data.SqlClient. I am somewhat worried that this problem has reappeared in dotnet 8 :/ Explicitly adding a dependency to 5.1.2 did not make a difference. Here are some additional details about the build environment. |
We're also seeing this when running our application inside of Docker on a ARM Mac with Rosetta. Running the application outside of Docker works. Tried the same as @ajorkowski. I've got docker image: 8.0.100-1-bookworm-slim-amd64 |
This workaround worked for me: dotnet/runtime#94909 (comment) |
I managed to fix my issue as well - I think it may have been the fact that I was using |
Workaround mentioned by @henrikwidlund also works for me. |
Hi,
I'm currently in the process of updating my project from .NET 6 to .NET 8, which involves migrating from EF Core 6 to EF Core 8. The project heavily relies on Docker containers.
I've provided the Dockerfile below, which is responsible for building the database:
`FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY //Here I copy project files
RUN dotnet tool install dotnet-ef --tool-path "./bin" --version 8.0.0
RUN ./bin/dotnet-ef migrations bundle --self-contained -r linux-x64 -o ./bin/efbundle
FROM mcr.microsoft.com/mssql/server:2022-CU8-ubuntu-20.04
ENV MSSQL_SA_PASSWORD=PASSWORD
ENV DB_NAME=DBNAME
ENV ACCEPT_EULA Y
ENV DOTNET_BUNDLE_EXTRACT_BASE_DIR=/var/tmp/bundle-extract
EXPOSE 1433
COPY --from=build PATH_TO_THE_PROJECT /var/tmp/
USER mssql
RUN ( /opt/mssql/bin/sqlservr & ) | grep -q "Recovery is complete"
&& ./var/tmp/efbundle --connection "Data Source=.;Initial Catalog=$DB_NAME;User Id=sa;Password=$MSSQL_SA_PASSWORD;Encrypt=False;"
&& pkill sqlservr
`
The project references are the following:
first after I changed SDK and EF core version, first I get the following error:
A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 - An internal exception was caught)
7.818 ---> System.Security.Authentication.AuthenticationException: The remote certificate was rejected by the provided RemoteCertificateValidationCallback.
To resolve this, I modified the connection string to have Encrypt=false (the same result was observed with TrustServerSertificate=true). However, this led to a new error: "Segmentation fault"
when I tried to disable rosetta, I got a bit different but similar error:
I asked collegue with windows machine to test this and it works there.
My setup is: MacOS sonoma 14.1 on m2 pro chip. Docker desktop 4.25.1 running with Rosetta emulation enabled.
Any insights or suggestions on resolving this issue would be greatly appreciated.
Thank you!
The text was updated successfully, but these errors were encountered: