Skip to content

fix(launcher): base64-encode user-data in Provision (#127) - #128

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/127-provision-userdata-base64
Jun 12, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/127-provision-userdata-base64

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

launcher.Provision assigned the raw bootstrap script to LaunchConfig.UserData; Launch passes it verbatim to RunInstances, which requires base64. Every headless launch (lagotto --action spawn) failed with Invalid BASE64 encoding of user data, blocking the lagotto#19 watch→launch→run flow on its first real launch.

Fix: add launcher.EncodeLinuxUserData (gzip+base64, matching the CLI's encodeUserDataForOS for Linux) and use it in Provision. Regression tests decode the output and assert it gunzips back to the script — the contract real EC2 enforces but substrate didn't, which is why the original test missed it. Corrected the misleading LaunchConfig.UserData doc.

Closes #127. Needs a spawn patch release + a lagotto bump to consume it.

Provision assigned the raw BuildLinuxBootstrap script to LaunchConfig.UserData,
which Launch passes verbatim to RunInstances — but EC2 requires base64. So every
headless launch (lagotto --action spawn) failed with "Invalid BASE64 encoding of
user data", blocking the lagotto#19 flow on its first real launch. The substrate
test missed it because substrate doesn't validate the encoding.

Add launcher.EncodeLinuxUserData (gzip+base64, matching the CLI's
encodeUserDataForOS for Linux) and use it in Provision. Regression tests assert
the encoded output is valid base64 that gunzips back to the script. Also correct
the LaunchConfig.UserData doc (it must be base64, not "plain text or base64").
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit ea726e2 into main Jun 12, 2026
6 of 9 checks passed
@scttfrdmn
scttfrdmn deleted the fix/127-provision-userdata-base64 branch June 12, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

launcher.Provision passes un-base64'd user-data → RunInstances InvalidParameterValue; every headless launch fails

1 participant