open-telemetry / opentelemetry-demo

This repository contains the OpenTelemetry Astronomy Shop, a microservice-based distributed system intended to illustrate the implementation of OpenTelemetry in a near real-world environment.
https://opentelemetry.io/docs/demo/
Apache License 2.0
1.77k stars 1.13k forks source link

Feature Flag Service doesn't start when built from repository | server file "missing" #882

Closed kainawroth closed 8 months ago

kainawroth commented 1 year ago

Bug Report

OpenTelemetry Demo 1.4

Symptom

When I build from https://github.com/open-telemetry/opentelemetry-demo with docker compose build, the Feature Flag Service doesn't start and shows in Logs exec /app/bin/server: no such file or directory even though the file is present:

featureflag-notworking-files

When I instead fetch the images from ghcr with docker compose up --no-build, the Feature Flag Service starts without any problems.

Solution

I saved the server file in question from the ghcr image and added it to the version built from the repository, and it fixed the issue:

featureflag-working-files featureflag-working

Reproduce

Build from https://github.com/open-telemetry/opentelemetry-demo repository.

Additional Context

The file from the ghcr image is 2 Bytes bigger (223 Bytes vs 221 Bytes when composed from the repository) even though the content is the same. Attached are both files for comparison:

server-files.zip

julianocosta89 commented 1 year ago

Hello @kainawroth 👋🏽 ,

Which OS are you using?

kainawroth commented 1 year ago

Hi @julianocosta89,

I'm using Docker Desktop on Windows 11.

julianocosta89 commented 1 year ago

@kainawroth is this issue gone?

kainawroth commented 1 year ago

@julianocosta89, I just wanted to check, but I don't even get that far. When I try to compose from the demo repo or from my fork, I'm stuck at the following:

Demo repo:

[+] Building 1359.2s (152/208)
 => => extracting sha256:c1e5026c64577dee4b6bac20b18196f964a41d8b9016fbbbada0c70b601cd5bf                     1274.5s
 => [quoteservice stage-1 3/6] RUN chmod +x /usr/local/bin/install-php-extensions   && install-php-extension  1349.4s
 => => # /src/php/ext/opcache -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I
 => => # /usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -fstack-prote
 => => # ctor-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-str
 => => # ong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wno-implicit-fallthrough -DZEN
 => => # D_ENABLE_STATIC_TSRMLS_CACHE=1 -DZEND_COMPILE_DL_EXT=1 -c /usr/src/php/ext/opcache/shared_alloc_mmap.c -MMD
 => => # -MF shared_alloc_mmap.dep -MT shared_alloc_mmap.lo  -fPIC -DPIC -o .libs/shared_alloc_mmap.o
 => [frauddetectionservice internal] load metadata for gcr.io/distroless/java17-debian11:latest                  1.5s
 => [accountingservice internal] load metadata for docker.io/library/golang:1.19.2-alpine                        1.7s
 => [frauddetectionservice auth] library/gradle:pull token for registry-1.docker.io                              0.0s
 => [accountingservice] importing cache manifest from ghcr.io/open-telemetry/demo:1.4.0-accountingservice        1.8s
 => [accountingservice builder 1/4] FROM docker.io/library/golang:1.19.2-alpine@sha256:e4dcdac3ed37d8c2b3b8bcef  0.0s
 => [accountingservice internal] load build context                                                              0.7s
 => => transferring context: 192.14kB                                                                            0.2s
 => [frauddetectionservice] importing cache manifest from ghcr.io/open-telemetry/demo:1.4.0-frauddetectionservi  2.0s
 => [frauddetectionservice builder 1/5] FROM docker.io/library/gradle:7-jdk17@sha256:b2d88da755a317d084535201eb  0.0s
 => [frauddetectionservice stage-1 1/4] FROM gcr.io/distroless/java17-debian11@sha256:672df6324b5e36527b201135c  0.0s
 => [frauddetectionservice internal] load build context                                                          0.7s
 => => transferring context: 84.90kB                                                                             0.2s
 => CACHED [accountingservice builder 2/4] WORKDIR /usr/src/app/                                                 0.0s
 => CACHED [accountingservice builder 3/4] COPY ./src/accountingservice/ ./                                      0.0s
 => [accountingservice builder 4/4] RUN go build -o /go/bin/accountingservice/                                1341.0s
 => => # go: downloading github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0
 => => # go: downloading golang.org/x/crypto v0.10.0
 => => # go: downloading github.com/jcmturner/rpc/v2 v2.0.3
 => => # go: downloading github.com/jcmturner/aescts/v2 v2.0.0
 => => # go: downloading google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc
 => => # go: downloading golang.org/x/text v0.10.0
 => CACHED [frauddetectionservice stage-1 2/4] WORKDIR /usr/src/app/                                             0.0s
 => CACHED [frauddetectionservice builder 2/5] WORKDIR /usr/src/app/                                             0.0s
 => CACHED [frauddetectionservice builder 3/5] COPY ./src/frauddetectionservice/ ./                              0.0s
 => CACHED [frauddetectionservice builder 4/5] COPY ./pb/ ./src/main/proto/                                      0.0s
 => CANCELED [frauddetectionservice builder 5/5] RUN gradle shadowJar                                           87.2s

My fork:

[+] Building 260.5s (156/208)
 => [quoteservice stage-1 3/6] RUN chmod +x /usr/local/bin/install-php-extensions   && install-php-extensions  253.3s
 => => # r/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/ph
 => => # p/ext -I/usr/local/include/php/ext/date/lib  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D
 => => # _FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_O
 => => # FFSET_BITS=64 -D_GNU_SOURCE   -Wno-implicit-fallthrough -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DZEND_COMPILE_D
 => => # L_EXT=1 -c /usr/src/php/ext/opcache/shared_alloc_posix.c -o shared_alloc_posix.lo  -MMD -MF shared_alloc_pos
 => => # ix.dep -MT shared_alloc_posix.lo
 => => extracting sha256:c1e5026c64577dee4b6bac20b18196f964a41d8b9016fbbbada0c70b601cd5bf                      182.4s
 => [frauddetectionservice internal] load build context                                                          0.5s
 => => transferring context: 84.90kB                                                                             0.2s
 => [frauddetectionservice stage-1 1/4] FROM gcr.io/distroless/java17-debian11@sha256:672df6324b5e36527b201135c  0.0s
 => CACHED [frauddetectionservice stage-1 2/4] WORKDIR /usr/src/app/                                             0.0s
 => [accountingservice internal] load .dockerignore                                                              0.7s
 => => transferring context: 1.22kB                                                                              0.1s
 => [accountingservice internal] load build definition from Dockerfile                                           0.6s
 => => transferring dockerfile: 478B                                                                             0.1s
 => CACHED [frauddetectionservice builder 2/5] WORKDIR /usr/src/app/                                             0.0s
 => CACHED [frauddetectionservice builder 3/5] COPY ./src/frauddetectionservice/ ./                              0.0s
 => CACHED [frauddetectionservice builder 4/5] COPY ./pb/ ./src/main/proto/                                      0.0s
 => [frauddetectionservice builder 5/5] RUN gradle shadowJar                                                   242.3s
 => => #  - Added support for Java 19.
 => => #  - Introduced `--rerun` flag for individual task rerun.
 => => #  - Improved dependency block for test suites to be strongly typed.
 => => #  - Added a pluggable system for Java toolchains provisioning.
 => => # For more details see https://docs.gradle.org/7.6.1/release-notes.html
 => => # Starting a Gradle Daemon (subsequent builds will be faster)
 => [accountingservice internal] load metadata for docker.io/library/golang:1.19.2-alpine                        3.0s
 => [accountingservice] importing cache manifest from ghcr.io/open-telemetry/demo:1.4.0-accountingservice        2.5s
 => [accountingservice builder 1/4] FROM docker.io/library/golang:1.19.2-alpine@sha256:e4dcdac3ed37d8c2b3b8bcef  0.0s
 => [accountingservice internal] load build context                                                              0.2s
 => => transferring context: 623B                                                                                0.1s
 => CACHED [accountingservice builder 2/4] WORKDIR /usr/src/app/                                                 0.0s
 => CACHED [accountingservice builder 3/4] COPY ./src/accountingservice/ ./                                      0.0s
 => CANCELED [accountingservice builder 4/4] RUN go build -o /go/bin/accountingservice/                         89.4s

I won't cancel, but it doesn't stop building either.

julianocosta89 commented 1 year ago

Hmmm, that is odd. I know that it may be a lot of pain, but would you be able to run a docker system prune -a, and then, try again?

kainawroth commented 1 year ago

Thanks, that helped. Unfortunately, I'm still running into the same issue and have to replace the server file after deployment.

julianocosta89 commented 1 year ago

@tsloughter have you ever seen this???

joshleecreates commented 1 year ago

I'm not able to recreate this on ARM64/MacOS — if I have time I will attempt with windows later today.

tsloughter commented 1 year ago

Has anyone else with Windows 11 tried and reproduced?

julianocosta89 commented 1 year ago

@tsloughter we got another user in slack reporting the same issue in Windows 11 and Docker Desktop. Any ideas what could be the culprit? https://cloud-native.slack.com/archives/C03B4CWV4DA/p1690972086181209

IrrelevantElephant commented 1 year ago

I had the same issue with Docker Desktop and Windows 10. I believe the issue is with line endings in the Feature Flag Service source files. When I converted from CRLF to LF it built and ran without issue.

@kainawroth try configuring your git client to checkout with Unix style line endings rather than windows https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings#global-settings-for-line-endings

Also running in WSL worked without issue.

tsloughter commented 1 year ago

@julianocosta89 na, no idea. I can ask around to find Erlang Windows users and see if anyone has experienced similar.

puckpuck commented 9 months ago

Is this still something that we need to track? Do we need to document to use WSL if developing on Windows?

austinlparker commented 8 months ago

Closing this as part of issue cleanup. If there's anything that needs to be done, please create a new issue.

FF Service issues will be mooted by #1388