Urgent.News

What's breaking now, across thousands of outlets.

Tech

Docker failed to calculate checksum of ref, in CI

Docker failed to calculate checksum of ref is BuildKit naming the content reference it was hashing when a path under it could not be read. Two nearby sentences that circulate widely, the compute variant of this one and a claim about a file changing during the build, are not produced by any Docker component, and searching for them is why this failure is so hard to research. BuildKit emits "failed…

When Docker attempts to compute a checksum for a content reference during a build, it can fail if it encounters a path that cannot be read. This error message, "failed to calculate checksum of ref," is emitted by BuildKit when the referenced path is missing from the context, excluded by an ignore file, or resolved against an unexpected root. Searching for this error can be difficult because BuildKit does not emit any other sentences about the issue.

A build failure occurs when there is a problem with a COPY or ADD command, and the message contains a long, opaque identifier in the middle along with a quoted path at the end. The identifier changes with every run, making the failure appear non-deterministic even though it is completely deterministic. Due to this, people often search for a half-remembered phrase and find no results, leading to wasted time.

The most common cause of this error is that the path is not part of the tree being hashed. This is usually due to the path being absent from the context, excluded by an ignore file, or resolved against an unexpected root. When searching for the error, remove the leading slash from the quoted path and list it to determine if it is a missing file or the wrong root.

Another possible cause is that the tree being hashed is a stage, not the context. When a `COPY --from` or a bind mount from another stage is used, it hashes that stage's filesystem. If the quoted path appears to exist only within a builder image, it is a stage and checking the repository will not help. Check which stage the failing line reads from first.

In rare cases, the file may have been removed mid-build, which can be caused by a background job, test suite writing to the context directory, or a cache restore racing the build. This failure is uncommon and does not reproduce on a rerun of the identical commit. The fix involves adjusting the sequencing rather than modifying the Dockerfile.

To prevent this error, sequence every step that writes into the build context before the build, never alongside it. Exclude generated directories to ensure the builder never hashes a tree that is still changing. When searching for build errors, focus on the longest alphabetic fragment of the error message, not the entire line. If quoting an error in your own documentation, copy it directly from a terminal rather than relying on memory.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

The Answer Checker Explains the Missing Question

Our practice page grades answers with one line: parse ( $( '#practice-answer' ) . value ) . eq ( answer ) If answer is undefined , that line throws.

  • Practice page grades answer submissions with a single line of code
  • Undefined answer throws error instead of marking incorrect
  • Fix requires updating grader to recognize undefined slopes

maven could not transfer artifact ci, not a missing jar

A maven could not transfer artifact ci failure means the resolver tried to move bytes and could not, which is a different failure from the repository telling Maven the artifact is not there.

  • "Could not transfer artifact" message differs from "Could not resolve dependencies"
  • Cached failure related to "not-found" issue, not retry property
  • Timeout of 30 minutes often triggers job kill before error appears

I built 154 PDF and video tools that run entirely in the browser: how, and how to check

Most free online PDF tools work the same way: you upload your file, a server processes it, and you download the result. For a passport scan or a bank statement, that is a lot to ask of a stranger's…

  • Stayput Tools processes data directly in user's browser, eliminating file uploads.
  • Utilizes various browser technologies: PDF-lib, pdf.js, OCR, WebCodecs, ONNX Runtime.
  • Verification methods: inspect Network tab, check byte counts, observe Content-Security-Policy.

More from Sunday 15 November →