Skip to content
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

Using EF & SQLite crashes in aspnet:5.0-alpine docker image with Segmentation Fault #25703

Closed
drathnow opened this issue Aug 25, 2021 · 7 comments
Assignees
Labels
area-adonet-sqlite closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported punted-for-6.0 type-bug
Milestone

Comments

@drathnow
Copy link

drathnow commented Aug 25, 2021

This issue was originally reported over two years ago here and I followed the thread and reference to the new issue. The Docker image used in that issue was microsoft/dotnet:2.2.1-aspnetcore-runtime-alpine and the issue is listed as resolved but I am having the same issue with EF and Sqlite in the Docker image aspnet:5.0-alpine. I can't figure out if this is an issue with EF, .NET Runtime, or with the 5.0-alpine image.

I have created a project that can reproduce the problem:

git clone repro repo https://github.com/drathnow/SqliteTestApp.git
cd SqliteTestApp/SqliteTestApp
dotnet publish -c Release -v n -o ./obj/Docker/publish SqliteTestApp.csproj
docker build -t sqlitetestapp .
docker run -it --rm sqlitetestapp /bin/sh
dotnet SqliteTestApp.dll

Has anyone else come across this problem? Is there a solutions/workaround?

If this is the wrong forum to ask this question could you point me in the right direction?

Thanks.

@bricelam
Copy link
Contributor

Have you tried using a newer version of SQLitePCLRaw?

<PackageReference Include="SQLitePCLRaw.bundle_green" Version="1.1.14" />

@BravoTango86
Copy link

Had the same issue overnight although with plain Microsoft.Data.Sqlite. There seems to be an issue with journaling and setting journal_mode of the connection to MEMORY or OFF works and I can run your sample. Will try to find some time to take a deeper dive later but I'm not anything that would necessitate a rollback.

@drathnow
Copy link
Author

drathnow commented Sep 6, 2021

I am using the latest version of Microsoft.Data.Sqlite. If I wanted to use SQLitePCLRaw, is it a straight replacement or is there other work that needs to be done?

@Lazer91
Copy link

Lazer91 commented Sep 9, 2021

I have the same issue, downgrading to .NET Core 3.1 and using 3.1-alpine image, it is working.

@gimmi
Copy link

gimmi commented Dec 6, 2021

The issue seems to be resolved using Microsoft.Data.Sqlite v6.0.0 on net6

@ajcvickers ajcvickers modified the milestones: Backlog, 6.0.0 Dec 6, 2021
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Dec 9, 2021
@mockjv
Copy link

mockjv commented May 11, 2022

I appear to be experiencing this same issue with .NET 6.0 on Alpine arm64v8, but not on amd64 or bullseye-slim-arm64v8 (just as a base image comparison). Once I gather enough details I'll probably publish a new issue on the matter (been trying to experiment with the options suggested across the various related issues first).

@Davide-DD
Copy link

Have you tried using a newer version of SQLitePCLRaw?

<PackageReference Include="SQLitePCLRaw.bundle_green" Version="1.1.14" />

I'm reading that people are still experiencing this issue, in my case I just had to install the latest version of the suggested package above and everything worked fine. I'm using mcr.microsoft.com/dotnet/aspnet:6.0-alpine as Docker image (NET 6 user).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-adonet-sqlite closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported punted-for-6.0 type-bug
Projects
None yet
Development

No branches or pull requests

9 participants