Panic listing a resource group with an Azure SQL Elastic Job agent: invalid input in armid.formatScope
関連するプルリクエストがすでにマージされています。
- #691 @magodo による — マージ済み
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
調査の方向性
報告では、aztft の internal/populate/populate_mssql_job.go:31-32 と internal/populate/populate_stream_analytics_job.go:36 の該当行が指摘されています。これらの append 操作を読み、次に修正を組み込んだ状態で、issue に記載されているリソースグループ一覧表示コマンドを実行します。正常終了し、パニックを起こさずに一覧のリソースをエクスポートできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Version
aztfexport v0.20.0 (d52e1c5), with aztft at v0.3.1-0.20260625235534-b710d5ecffdc.
What happens
Listing a resource group that holds an Azure SQL Elastic Job agent with a scheduled job panics:
aztfexport rg --non-interactive --plain-ui --generate-mapping-file -o <dir> <resource-group>
panic: invalid input: len([servers jobAgents jobs schedules]) != len([servers jobAgents jobs schedules default])
github.com/magodo/armid.formatScope(...)
github.com/magodo/[email protected]/armid.go:888
github.com/magodo/armid.(*ScopedResourceId).String(...)
github.com/magodo/[email protected]/armid.go:764
github.com/magodo/aztft/aztft.queryType.func1(...)
github.com/magodo/[email protected]/aztft/aztft.go:168
The process exits with code 2, so nothing is exported from that resource group.
Cause
In aztft, internal/populate/populate_mssql_job.go:31-32:
sid.AttrTypes = append(sid.AttrTypes, "schedules")
sid.AttrNames = append(sid.AttrTypes, "default")
The second line appends to AttrTypes where AttrNames is meant, so AttrNames ends up one element longer than AttrTypes and String() panics.
internal/populate/populate_stream_analytics_job.go:36 has the same pattern. We have not run that path. Both lines are still present at aztft head (1e6fd26).
Fix we tested
Changing AttrTypes to AttrNames on the right-hand side of both lines, built against the aztft commit above. The same command then exits 0, and the mapping file lists the agent, its jobs, schedules, steps and target groups. Exporting the azurerm_mssql_* resources from that mapping with --hcl-only also runs without a panic.
Could this go into aztft and a new aztfexport release?
- 主要言語
- Go
- スター
- 1.9k
- フォーク
- 223
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 4
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Azure/aztfexport のほかの issue
-
question
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
Azure/aztfexport#676 · コメント 1 件 ·
-
question
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
Azure/aztfexport#663 · コメント 3 件 ·
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
Azure/aztfexport#652 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Azure/aztfexport#649 · リアクション 1 件 ·
-
upstream-provider
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
Azure/aztfexport#637 · コメント 1 件 · リアクション 1 件 ·
Azure/aztfexport の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
JakeChampion/lang#14392 ·
メンテナーはふだん 1 日以内に返信
-
agent-butler-finding bug
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
jordansmall/spindrift#6557 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] Custom tool truncation leaves unused stream copies open対応中かも @OUAO-FRANK が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
[v3] KeyBindingManager calls (Add/Remove) are not converted into a case-insensitive accelerator.KeyオープンBug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
crmne/hyprmoncfg#114 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信