Repository navigation
fix(provisioner/terraform): detect text file busy in init -json output - #31688
ethanndickson wants to merge 2 commits into
Conversation
Terraform 1.9 and later run init with -json. In that mode, Terraform writes the "Failed to install provider ... text file busy" diagnostic to stdout as JSON, and stderr stays empty. The detector from #15078 only scanned stderr, so since #20503 it never logs the CRITICAL "init: text file busy" message or the provider stack trace. Scan both stdout and stderr, and log stdout with the stack trace. The fake terraform in TestProvision_TextFileBusy now emits the JSON diagnostic on stdout when it gets -json, and the test covers a pre-1.9 version (stderr) and the bundled version (stdout).
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: da467dc694
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review re: Bound the stdout captured during initialization Declining this one. The stdout copy is bounded by the size of |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Relates to #14726
Relates to https://linear.app/codercom/issue/CORE-807
#15078 added a
CRITICALlog, with a stack trace fromterraform-provider-coder, for whenterraform initfails withtext file busy. It's been dead since #20503 started runninginitwith-json. In JSON mode, terraform writes the error as a diagnostic on stdout and leaves stderr empty, and we only ever checked stderr:To fix, we'll just check stdout as well, and include it in the log. The existing test missed this because its fake terraform always wrote the error to stderr. It now writes the JSON diagnostic to stdout when it's passed
-json, and the test also runs against a pre-1.9 version, which still reports the error on stderr.