[bug-bash] edit and theme failures silently return exit 1 without a machine-readable stderr error
維護者通常 1 天內回覆
評估
研究方向
Start by tracing how command failures reach stderr and how --output json, --quiet, and -c affect error handling; compare the failing theme use, theme validate, and edit commands with the working not-a-real-command case. Run the PowerShell reproductions in the issue and capture stdout, stderr, and exit codes. Done when these failures emit explanatory structured JSON to stderr while retaining a nonzero exit code.
由索引模型根據 Issue 內容生成。
描述
Environment
Windows x64, CosmosDBShell 1.1.291-preview (db49321323).
No Cosmos DB connection or credentials are required.
Repro (PowerShell)
$package = "$env:USERPROFILE\.dotnet\tools\.store\cosmosdbshell\1.1.291-preview"
$shell = Join-Path $package 'cosmosdbshell.win-x64\1.1.291-preview\tools\net10.0\win-x64\CosmosDBShell.exe'
& $shell --version
$work = Join-Path ([IO.Path]::GetTempPath()) ("cosmos-errors-" + [guid]::NewGuid().ToString("N"))
New-Item -ItemType Directory -Path $work | Out-Null
Set-Location $work
& $shell --output json -c 'theme use missing-bug-bash-theme'
"Exit code: $LASTEXITCODE"
Actual:
- Exit code: 1
- stdout: empty
- stderr: empty
The same silent failure reproduces with:
& $shell --output json -c 'theme validate .\missing-theme.toml'
Exact headless edit reproduction, including input redirection and output capture:
'bug-bash sample' | Set-Content -Encoding utf8 .\sample.txt
'' | & $shell --output json -c 'edit sample.txt' 1> .\edit.stdout.txt 2> .\edit.stderr.txt
$editExit = $LASTEXITCODE
[pscustomobject]@{
ExitCode = $editExit
StdoutBytes = (Get-Item .\edit.stdout.txt).Length
StderrBytes = (Get-Item .\edit.stderr.txt).Length
}
Actual: ExitCode 1, StdoutBytes 0, StderrBytes 0. Interactive external editing
should be rejected with an explanation in this context, not fail silently.
The same edit result was also observed with --quiet and default -c mode.
Expected
Failures in machine mode emit an explanatory structured JSON error object to
stderr, consistent with the documented automation contract and other commands.
The existing exit code can remain nonzero.
For example:
{"status":"error","error":"Unknown theme ..."}
Working control
& $shell --output json -c 'not-a-real-command'
This correctly returns exit code 2 and a structured stderr error:
{"status":"error","error":"'not-a-real-command' is not recognized ..."}
cat with a missing file, filter with a missing expression, and invalid ftab
formats also emit structured diagnostics; the silence is not a harness-wide
capture problem.
Impact
Automation can detect failure but cannot explain it, surface remediation, or
collect useful bug reports. Empty stderr also makes rejected interactive editing
indistinguishable from an unexplained internal failure.
Validation
Reproduced with direct child-process execution, captured stdout and stderr,
and closed/redirected stdin. The edit failure reproduces with --output json,
--quiet, and default -c machine mode. Both invalid theme operations reproduce
without a database connection.
- 主要語言
- C#
- 星號
- 4
- 分支
- 7
- 平均合併
- 1 天 23 小時
- 30 天內合併 PR
- 23
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
Azure/CosmosDBShell 的其他 Issue
-
[bug-bash] print maps a missing item's HTTP 404 to exit 1 instead of documented not-found exit 5可能已有人在做 @mkrueger 今天認領。 未關閉bug bug-bash
難度 2/5 1-3 小時 新手友好度 78/100
Azure/CosmosDBShell#279 ·
維護者通常 1 天內回覆
-
[bug-bash] Sequential script commands leak their result into rm as implicit pipe input可能已有人在做 @mkrueger 今天認領。 未關閉bug bug-bash
難度 3/5 1-2 天 新手友好度 75/100
Azure/CosmosDBShell#281 ·
維護者通常 1 天內回覆
-
[bug-bash] Invalid command arguments return general-failure exit 1 instead of documented usage exit 2可能已有人在做 @mkrueger 今天認領。 未關閉bug bug-bash
難度 3/5 1-2 天 新手友好度 68/100
Azure/CosmosDBShell#280 ·
維護者通常 1 天內回覆
-
[bug-bash] Multi-statement -c and piped stdin silently drop intermediate output and file redirections可能已有人在做 @mkrueger 今天認領。 未關閉bug bug-bash
難度 3/5 1-2 天 新手友好度 75/100
Azure/CosmosDBShell#277 ·
維護者通常 1 天內回覆
-
難度 3/5 1-2 天 新手友好度 35/100
Azure/CosmosDBShell#274 · 1 則留言 ·
維護者通常 1 天內回覆
查看 Azure/CosmosDBShell 的全部 Issue
相似的 Issue
-
要トリアージ
難度 2/5 1-3 小時 新手友好度 64/100
維護者通常 1 天內回覆
-
S: Untriaged
難度 2/5 1-3 小時 新手友好度 62/100
Trauma-Station/Trauma-Station#5285 ·
維護者通常 1 天內回覆
-
.NET good first issue testing
難度 2/5 1-3 小時 新手友好度 76/100
HelloblueAI/HelloblueGK#311 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 77/100
unoplatform/uno#26080 ·
維護者通常 1 天內回覆
-
area:app
難度 2/5 1-3 小時 新手友好度 63/100
KSAModding/Borea#1162 · 1 則留言 ·
維護者通常 1 天內回覆