Skip to content

Updating to .net10.0 (from net8.0) Switcher with ChakraCore now causes containers to exit unexpectedly #121

@coultonluke

Description

@coultonluke

The issue

I have been running .net 8.0 for years on AWS ECS without issue. I have updated to net 10.0 just updated the packages that were required as per the upgrade instructions excluding entity framework.

dotnet outdated -mv 10.0 --exclude pomelo --exclude entity --include Microsoft.AspNetCore --include Microsoft.Extensions --include System.Net.Http.Json --include system. -u

I'm now periodically getting containers that are exiting on AWS with "Exit code: 139." where it logs a single line and then the container becomes unresponsive and shortly afterwards deprovisioned. Apparently 139 is a SIGFAULT or error accessing memory?

"terminate called after throwing an instance of 'Js::JavascriptException.

I'm running it in AWS ECS as root and using mcr.microsoft.com/dotnet/sdk:10.0 as the base image.

I'm not sure that I'm doing anything exotic. I'm using ReactJS.net which is an older library and it uses Chakracore-linux which is what handles Javascript, but why would it have an issue every now and again just cause it's a new version of .NET?

I'm building it within codepipeline using docker build.

Unfortunately this is stopping me from upgrading to .net10.0. I have a feeling it's something to do with Chakracore to generate SSR react. Grok says switch to Jint of V8, not sure if that's the answer here just cause I've updated to .net10 and new docker base images.

Of note, Microsoft have switched form Debian to Ubuntu, will this be an issue?

Thanks in advance for any insight from anyone.

Image

Which .NET image(s) are you using?

mcr.microsoft.com/dotnet/sdk:10.0

Steps to reproduce

Build using docker file, push to AWS ECR an deploy to ECS. Website has heavy traffic. This is my docker file:

FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build-env
EXPOSE 80
WORKDIR /app

# Copy csproj and restore as distinct layers
COPY *.sln .
COPY MySite.WebUI.Core/*.csproj ./MySite.WebUI.Core/

RUN dotnet restore

# Copy everything else
COPY . ./

FROM 369074612400.dkr.ecr.us-east-1.amazonaws.com/node:20.11.1-buster as node-env
WORKDIR /app

# Run webpack
COPY --from=build-env /app ./

WORKDIR /app/MySite.WebUI.Core
RUN npm ci
RUN npm run release
RUN ls -R -1 ./wwwroot/dist

FROM mcr.microsoft.com/dotnet/sdk:10.0 AS second-build-env
WORKDIR /app
COPY --from=node-env /app .
RUN dotnet publish MySite.WebUI.Core -c Release -o out

# Copy static files to S3
FROM 369074612400.dkr.ecr.us-east-1.amazonaws.com/amazon/aws-cli:2.15.28 AS copy-static-content-env
ARG AWS_DEFAULT_REGION
ARG AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
ARG AWS_SECRET_ACCESS_KEY
ARG AWS_ACCESS_KEY_ID
ARG AWS_SESSION_TOKEN
WORKDIR /app
COPY --from=second-build-env /app/out ./out
RUN ls -1 -R ./out/wwwroot/dist
RUN aws s3 cp ./out/wwwroot/dist s3://MySitelive/dist --recursive

# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS website
WORKDIR /app
ENV ASPNETCORE_HTTP_PORTS=80
COPY --from=copy-static-content-env ./app/out .
USER root
CMD ["dotnet", "MySite.WebUI.Core.dll"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions