DataDog/dd-trace-js

latest dd-lib-js-init docker does not have the operator-build folder

roopakv opened this issue ยท 9 comments

the documentation suggests using the following line

COPY --from=datadog/dd-lib-js-init:5 /operator-build/node_modules /dd_tracer/node/

However this fails as follows

failed to compute cache key: failed to calculate checksum of ref ddbf2120-604f-4b90-b1cb-8c450078b6bd::wlqz1xzar6bwj9m9byisfw83d: failed to walk /var/lib/docker/tmp/buildkit-mount3374463185/operator-build: lstat /var/lib/docker/tmp/buildkit-mount3374463185/operator-build: no such file or directory

However if i use v5.19 this works

seeing same issue in our pipeline as well

[stage-2 11/11] COPY --from=datadog/dd-lib-js-init /operator-build/node_modules /dd_tracer/node/:


Dockerfile:54

52 | # copy the Datadog serverless-init into your Docker image
53 | COPY --from=datadog/serverless-init /datadog-init /app/datadog-init
54 | >>> COPY --from=datadog/dd-lib-js-init /operator-build/node_modules /dd_tracer/node/
55 |
56 | ENTRYPOINT ["/app/datadog-init"]

ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 3882bec0-d8f5-4df1-8563-cf5f7db8a86b::tgwtkqzm91cwiq0wi9phuxxy8: failed to walk /var/lib/docker/tmp/buildkit-mount3468765816/operator-build: lstat /var/lib/docker/tmp/buildkit-mount3468765816/operator-build: no such file or directory

Having the same issue running docker build in GitHub Actions.

#14 [runner 2/7] COPY --from=datadog/serverless-init:1 /datadog-init ./datadog-init
#14 CACHED

#15 [runner 1/7] WORKDIR /usr/src/app
#15 CACHED

#16 [runner 3/7] COPY --from=datadog/dd-lib-js-init /operator-build/node_modules /dd_tracer/node/
#16 ERROR: failed to calculate checksum of ref rqtmmk39rm44ndc0514cmawpv::t3mmnzn5a18bam1iy186f3rz2: "/operator-build/node_modules": not found
------
 > [runner 3/7] COPY --from=datadog/dd-lib-js-init /operator-build/node_modules /dd_tracer/node/:
------

 2 warnings found (use docker --debug to expand):
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 37)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 38)
Dockerfile:30
--------------------
  28 |     # Read more: https://docs.datadoghq.com/serverless/google_cloud_run/
  29 |     COPY --from=datadog/serverless-init:1 /datadog-init ./datadog-init
  30 | >>> COPY --from=datadog/dd-lib-js-init /operator-build/node_modules /dd_tracer/node/
  31 |     
  32 |     COPY --from=installer /app .
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref rqtmmk39rm44ndc0514cmawpv::t3mmnzn5a18bam1iy186f3rz2: "/operator-build/node_modules": not found
Error: Process completed with exit code 1.

me 2

--------------------
  85 |     # Iinitalizing Datadog Agent
  86 |     COPY --from=datadog/serverless-init:1 /datadog-init /app/datadog-init
  87 | >>> COPY --from=datadog/dd-lib-js-init /operator-build/node_modules /dd_tracer/node/
  88 |     
  89 |     # Enabling SSH in Azure APP Service as container
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 01946599-6fe3-46af-8b76-fc495b611aad::nl8kpvyazvlttiqs95k2bj2zo: failed to walk /var/lib/docker/tmp/buildkit-mount1912141616/operator-build: lstat /var/lib/docker/tmp/buildkit-mount1912141616/operator-build: no such file or directory

Having the same issue running docker build in Cloud build (google cloud)

2024-08-14 09:48:58.936 JST
Step #0: Step 28/32 : COPY --from=datadog/dd-lib-js-init /operator-build/node_modules /dd_tracer/node/
......
2024-08-14 09:49:04.865 JST
Step #0: COPY failed: stat operator-build/node_modules: file does not exist

having same issue

COPY --from=datadog/serverless-init:1 /datadog-init /app/datadog-init
COPY --from=datadog/dd-lib-js-init /operator-build/node_modules /dd_tracer/node/
Status: Downloaded newer image for datadog/dd-lib-js-init:latest
COPY failed: stat operator-build/node_modules: file does not exist

Having same issue

error building image: error building stage: failed to get files used from context: failed to get fileinfo for /kaniko/datadog/dd-lib-js-init/operator-build/node_modules: lstat /kaniko/datadog/dd-lib-js-init/operator-build/node_modules: no such file or directory

Having the same issue. Seems like it was relocated to /datadog-init/package/node_modules

I got this respone from DD

Hi Roopak / Team,
 
Thank you for your patience. We wanted to provide an update on this issue.
 
Datadog released dd-lib-* container images that were incompatible with the documented 
method for building the .NET and/or NodeJS Datadog tracers into your own containers.
 
We have updated the documentation to remove the dependency upon those container images. 
We have also corrected the container images, to restore compatibility with the legacy build method.
 
If your build was previously failing due to this issue, re-running your build should now succeed. 
You may need to empty the container cache, if the build system has cached the incompatible version. 
We also suggest migrating to the new build instructions.
 
We apologize for this issue and are performing a root cause analysis to prevent this from 
occurring in the future.
 
Regards,

the old method
COPY --from=datadog/dd-lib-js-init --chown=node:node /operator-build/node_modules /dd_tracer/node/
put in /dd_tracer/node/ totally different content than the new method:
RUN npm install --prefix /dd_tracer/node dd-trace --save
the former puts the content of node_modules (without the actual folder) and the later puts a folder node_modules