bottlerocket-os / bottlerocket-os/twoliter

persistent failure if initial manifest fetch fails

Open
#351 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
34
Forks
45
Avg merge
11h 13m
Merged PRs (30d)
16

Description

On a new build host, I ran `twoliter fetch` without first configuring Docker to use the containerd snapshotter, or installing crane.

This failed, and the following directory was created under build:
```
build/external-kits/cache/sha256-b075d3764a0efc5f17bc4b27b040efa438310db30e9145588c32393ceeead9fa
```

Even after installing crane, I continued to see this error:
```
$ make
Found Twoliter v0.4.4 installed.
Skipping installation.
[2024-08-22T17:01:54Z TRACE twoliter::project] Looking for Twoliter.toml in '.'
[2024-08-22T17:01:54Z TRACE twoliter::project] This project does not have a Release.toml file (this is not a problem)
[2024-08-22T17:01:54Z DEBUG twoliter::project] Project file loaded from '/home/ec2-user/bottlerocket-playground/Twoliter.toml'
Error: Unable to read from '/home/ec2-user/bottlerocket-playground/build/external-kits/cache/sha256-b075d3764a0efc5f17bc4b27b040efa438310db30e9145588c32393ceeead9fa/index.json'

Caused by:
No such file or directory (os error 2)
make: *** [Makefile:28: fetch] Error 1
```

If the directory exists, Twoliter assumes that `index.json` will be present, but it might not be. I'd expect it to recover from this error gracefully.

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with `twoliter fetch` before the required Docker or crane setup, then retry through `Makefile:28`. Start by tracing how the fetch path handles `build/external-kits/cache/...` and missing `index.json`; done means a partially created cache directory no longer prevents a later successful fetch.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.