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

accounting-service failing to start #1798

Closed
MMartyn opened this issue Nov 27, 2024 · 8 comments · Fixed by #1805
Closed

accounting-service failing to start #1798

MMartyn opened this issue Nov 27, 2024 · 8 comments · Fixed by #1805
Labels
bug Something isn't working

Comments

@MMartyn
Copy link
Contributor

MMartyn commented Nov 27, 2024

Bug Report

Which version of the demo you are using? ghcr.io/open-telemetry/demo:latest-accountingservice@sha256:a4c22f54468bf16fc32fc788e8f71d663b6886158847a5e555eb90381b6aae0e

Symptom

The container is in a restart loop. The logs report:

Unhandled exception. System.IO.FileLoadException: Could not load file or assembly 'AccountingService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

What is the expected behavior?

I would expect the container to reach a running state.

What is the actual behavior?

Container is in a restart loop.

Reproduce

Run make start

We will close this issue if:

  • The steps you provided are complex.
  • If we can not reproduce the behavior you're reporting.

Additional Context

I am attempting to run this on a Macbook Pro M2, so it would be pulling the arm64 versions.

@MMartyn MMartyn added the bug Something isn't working label Nov 27, 2024
@julianocosta89
Copy link
Member

Hey @MMartyn thanks for reporting this.
I just tested it and I can see the same behaviour.

I solved it running:

docker compose build accountingservice

and after the build: make start.

I'll check why the published image is not the latest one, but for now, that would solve.

@julianocosta89
Copy link
Member

@puckpuck it seems that we may have an issue with the current nightly release.
Maybe changing the action to use the new buildx introduced by you should solve. WDYT?!

@julianocosta89
Copy link
Member

@puckpuck I've done some digging and as now we have ARG TARGETARCH in the Dockerfiles, we need to also add this arg in here:
https://github.com/open-telemetry/opentelemetry-demo/blob/main/.github/workflows/component-build-images.yml#L198

I'll do some further investigation tomorrow to see if we can dinamically get this value, as we are passing it via platforms:https://github.com/open-telemetry/opentelemetry-demo/blob/main/.github/workflows/component-build-images.yml#L196

@MMartyn
Copy link
Contributor Author

MMartyn commented Dec 1, 2024

@julianocosta89 That arg should automatically be getting set. https://docs.docker.com/build/building/variables/#pre-defined-build-arguments

@MMartyn
Copy link
Contributor Author

MMartyn commented Dec 1, 2024

My guess would be the second stage needs to be something like this:

FROM builder AS publish
ARG TARGETARCH
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./AccountingService.csproj" --use-current-runtime -r linux-musl-$TARGETARCH -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

@julianocosta89
Copy link
Member

I'm not sure it is actually setting it.
If we build locally it works fine, and if we use the buildx script from the makefile it also works, but in the make step we are manually setting the targetarch

@MMartyn
Copy link
Contributor Author

MMartyn commented Dec 1, 2024

It's getting set. I had checked the build log and see it being set. But I think it needs to have those changes I mentioned in the second stage. If you look at the cart image you can see that the argument is being used in both stages and I think that is what is missing.

@julianocosta89
Copy link
Member

Thanks @MMartyn, I've sent a PR with the change.
Locally it is building fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants