devenv: Failed to copy container. Digest did not match
Describe the bug
I’m trying to copy my container to AWS ECR from my Linux X64 CI server, but hitting the following issue. Failed to copy container. Digest did not match.
To reproduce
# also tried with `--system x86_64-linux`, does not make a difference
devenv container build processes
# ecr login
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123123123123.dkr.ecr.us-east-1.amazonaws.com
# ecr create repository
if ! aws ecr describe-repositories --repository-names processes --region us-east-1; then
aws ecr create-repository --repository-name processes --region us-east-1
fi
# ecr push. also tried with `--copy-args="--preserve-digests"`. does not make a difference
devenv container \
--registry docker://123123123123.dkr.ecr.us-east-1.amazonaws.com/ \
copy processes
Output:
• Building processes container ...
• Using Cachix: devenv
/nix/store/31g4rq1p6spmihc95qm3qc2iy8w7hm5b-image-processes.json
✔ Building processes container in 2.2s.
• Copying processes container ...• Running /nix/store/g96s72rwnk3vdkqnvd5wmkmnrmk0z9sk-copy-container /nix/store/31g4rq1p6spmihc95qm3qc2iy8w7hm5b-image-processes.json docker://123123123123.dkr.ecr.us-east-1.amazonaws.com/ --preserve-digests
Copying container /nix/store/31g4rq1p6spmihc95qm3qc2iy8w7hm5b-image-processes.json to docker://123123123123.dkr.ecr.us-east-1.amazonaws.com/processes:latest
Getting image source signatures
Copying blob sha256:67eb02cf19ceef2d35b6a7373359a5f7ede6f478e59ef55ef0688be70b03[97](https://github.com/transloadit/api2/actions/runs/8615325344/job/23610670898#step:6:98)d2
Copying blob sha256:2ac708344cd9024282848c53dbd92614463d4ce574312949cd43f09ff92e8e85
time="2024-04-09T12:10:47Z" level=fatal msg="writing blob: Patch \"https://123123123123.dkr.ecr.us-east-1.amazonaws.com/v2/processes/blobs/uploads/27a9a11e-ad6e-46cb-92fe-56617689e652\": happened during read: Digest did not match, expected sha256:67eb02cf19ceef2d35b6a7373359a5f7ede6f478e59ef55ef0688be70b0397d2, got sha256:8b155f8b3b4bca1f56a387a409238782eb8578fa86fe57df5a9d4961cb13a6d2"
✔ Copying processes container in 70.3s.
Error: × Failed to copy container
Version
- While developing (locally):
devenv 1.0.3 (aarch64-darwin) - While building (CI):
devenv 1.0.3 (x86_64-linux)
Not sure what to do next 🤔 any idea?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 5
- Comments: 29 (10 by maintainers)
@domenkozar Thanks! I made a PR https://github.com/domenkozar/nix/pull/1 with this fix https://github.com/NixOS/nix/pull/10456 to backport the fix to devenv-nix 2.21.
It fixed the issue for me, so at least we know what the issue is now 😃
Ah, single mode! I’m going to bump Nix to also fix https://github.com/cachix/devenv/issues/1137, so hang tight!
Huh! Well, the only thing that stands out from all of this is Nix running in single-user mode. But that would seem an unlikely culprit…