[Bug]: Table writes fail (HTTP 500) for entities defined in a linked `data-source-files` config
メンテナーはふだん 1 日以内に返信
@souvikghosh04 がすでに取り組んでいます。
2026年7月7日 から。
評価
この issue はまだ評価されていません。
説明
When
Using a multi-database setup where a root config links a second database config via data-source-files:
# Root config (database 1)
dab init --database-type mssql --connection-string "@env('DAB_SQL_DB1')" --host-mode Development -c dab-config.json
dab add Db1Orders --source dbo.Orders --permissions "anonymous:*" --source.type table -c dab-config.json
# Linked config (database 2)
dab init --database-type mssql --connection-string "@env('DAB_SQL_DB2')" --host-mode Development -c dab-config-db2.json
dab add Db2Customers --source dbo.Customers --permissions "anonymous:*" --source.type table -c dab-config-db2.json
# Link them
dab configure --data-source-files dab-config-db2.json -c dab-config.json
dab start -c dab-config.json
Then send a write to a table entity that is defined in the linked file (dab-config-db2.json):
POST /api/Db2Customers
Content-Type: application/json
{ "Name": "test" }
Expected
The insert succeeds and returns HTTP 201 with the created row, the same as an equivalent table entity defined in the root config. Table writes should work regardless of whether the entity's data source is in the root config or in a linked data-source-files config.
Actual
The request returns HTTP 500 with a generic error:
{
"error": {
"code": "UnexpectedError",
"message": "While processing your request the server ran into an unexpected error.",
"status": 500
}
}
The server log shows a KeyNotFoundException keyed by the entity name, thrown in the SQL mutation/insert path:
System.Collections.Generic.KeyNotFoundException: The given key 'Db2Customers' was not present in the dictionary.
at Azure.DataApiBuilder.Core.Resolvers.BaseQueryStructure..ctor(...)
at Azure.DataApiBuilder.Core.Resolvers.SqlInsertStructure..ctor(...)
at Azure.DataApiBuilder.Core.Resolvers.SqlMutationEngine.PerformMutationOperation(...)
Scope / Root cause (confirmed by test)
The failure is positional, not database- or table-specific. Swapping the topology proves it — the same table behaves differently based only on which config file it lives in:
| Table | In root config | In linked data-source-files config |
|---|---|---|
dbo.Categories |
POST succeeds (200/201) | POST fails (500) |
dbo.Category |
POST succeeds (200/201) | POST fails (500) |
Additional observations:
- Reads (
GET) work for linked-file entities. - Stored procedures in linked files work (they use the
executepath, not the table-mutation path). - Only table mutations (
POST/PUT/PATCH/DELETE) on linked-file entities fail. dab validatepasses and reports REST paths for all entities across both files.
Impact
In a multi-database DAB instance, tables in any linked (non-root) database are effectively read-only. Only the root database supports table writes.
- 主要言語
- C#
- スター
- 1.5k
- フォーク
- 371
- 平均マージ
- 9日 2時間
- マージ済み PR(30日)
- 10
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Azure/data-api-builder のほかの issue
-
pgsql
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Azure/data-api-builder#3598 ·
メンテナーはふだん 1 日以内に返信
-
2.x cli mcp-server
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Azure/data-api-builder#3576 ·
メンテナーはふだん 1 日以内に返信
-
2.x health-endpoint
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Azure/data-api-builder#3570 ·
メンテナーはふだん 1 日以内に返信
-
2.x telemetry
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Azure/data-api-builder#3564 ·
メンテナーはふだん 1 日以内に返信
-
2.x telemetry
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Azure/data-api-builder#3562 ·
メンテナーはふだん 1 日以内に返信
Azure/data-api-builder の issue をすべて見る
似ている issue
-
area-System.Numerics.Tensors untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
dotnet/runtime#134691 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
unoplatform/uno.templates#2277 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/fluentui-blazor#5344 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
difficulty/starter 🚀 good first issue kind/bug platform/all project/core-tools 🛠️ triage/untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
unoplatform/uno#24757 ·
メンテナーはふだん 1 日以内に返信
-
ci-failure-cause test-failure
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信