Symptoms
Every build after the first (i.e., when the awscli cache layer is restored) fails with:
replace aws/install? [y]es, [n]o, [A]ll, [N]one, [r]ename: NULL
(EOF or read error, treating as "[N]one" ...)
! awscli: Failed to extract AWS CLI
ERROR: failed to build: exit status 1
Root cause
In bin/build, the buildpack always downloads a fresh awscli.zip and extracts it into $AWS_CLI_LAYER_DIR regardless of whether the cache was restored. When the cache IS restored, $AWS_CLI_LAYER_DIR already contains the aws/ directory from the previous install. Running unzip -q awscli.zip (no -o flag) causes unzip to prompt about replacing existing files. In a non-interactive build environment, unzip reads EOF and treats it as "None" (skip all), then exits with a non-zero code. The || { exit 1 } error handler catches this and prints "Failed to extract AWS CLI".
Fix
Two changes in bin/build:
-
Immediate: Change unzip -q awscli.zip → unzip -qo awscli.zip (-o = overwrite without prompting). This prevents the EOF prompt failure.
-
Correct: Add proper cache reuse logic — if the cached binary exists and is for the same architecture, skip the download+install entirely. This avoids the 64MB download on every build.
Impact
Observed on neeto-deploy-slug-compiler-web production builds — all builds since the cache was first written are failing.
Symptoms
Every build after the first (i.e., when the
awsclicache layer is restored) fails with:Root cause
In
bin/build, the buildpack always downloads a freshawscli.zipand extracts it into$AWS_CLI_LAYER_DIRregardless of whether the cache was restored. When the cache IS restored,$AWS_CLI_LAYER_DIRalready contains theaws/directory from the previous install. Runningunzip -q awscli.zip(no-oflag) causes unzip to prompt about replacing existing files. In a non-interactive build environment, unzip reads EOF and treats it as "None" (skip all), then exits with a non-zero code. The|| { exit 1 }error handler catches this and prints "Failed to extract AWS CLI".Fix
Two changes in
bin/build:Immediate: Change
unzip -q awscli.zip→unzip -qo awscli.zip(-o= overwrite without prompting). This prevents the EOF prompt failure.Correct: Add proper cache reuse logic — if the cached binary exists and is for the same architecture, skip the download+install entirely. This avoids the 64MB download on every build.
Impact
Observed on
neeto-deploy-slug-compiler-webproduction builds — all builds since the cache was first written are failing.