Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ resources:
database_id: my-database
postgres_database: app_db
# The referenced role is never declared anywhere; the live API
# rejects database creation with "role not found".
# rejects database creation because the role does not exist.
role: ${resources.postgres_branches.main.id}/roles/does-not-exist
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/bad-role-ref-[UNIQUE_NAME]/default/files...
Created postgres_branches.main
Created postgres_projects.my_project
Error: cannot create resources.postgres_databases.my_database: role not found; role_id:"does-not-exist" [TraceId: [TRACE_ID]] (404 NOT_FOUND)
Error: cannot create resources.postgres_databases.my_database: [API_MESSAGE] (404 NOT_FOUND)

Endpoint: POST [DATABRICKS_URL]/api/2.0/postgres/projects/test-pg-proj-[UNIQUE_NAME]/branches/main/databases?database_id=my-database
HTTP Status: 404 Not Found
API error_code: NOT_FOUND
API message: role not found; role_id:"does-not-exist" [TraceId: [TRACE_ID]]
API message: [API_MESSAGE]

Files: 0 uploaded, 0 deleted

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ cleanup() {
}
trap cleanup EXIT

musterr $CLI bundle deploy 2>&1 | contains.py "role not found"
musterr $CLI bundle deploy 2>&1 | contains.py "cannot create resources.postgres_databases.my_database:" "HTTP Status: 404 Not Found" "API error_code: NOT_FOUND"
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# Stub the database create endpoint to reject the unknown role reference,
# matching the live API behavior observed on aws-prod-ucws 2026-05-19:
# 404 Not Found: role not found; role_id:"<id>" [TraceId: <hex>]
# matching the live API error with the fully-qualified role resource name.
# The default testserver does not validate that the referenced role exists.
[[Server]]
Pattern = "POST /api/2.0/postgres/projects/{project_id}/branches/{branch_id}/databases"
Response.StatusCode = 404
Response.Body = '''{"error_code": "NOT_FOUND", "message": "role not found; role_id:\"does-not-exist\" [TraceId: [TRACE_ID]]"}'''
Response.Body = '''{"error_code": "NOT_FOUND", "message": "Role with name 'projects/test-pg-proj-[UNIQUE_NAME]/branches/main/roles/does-not-exist' not found"}'''

# Backend error wording is not part of the CLI contract.
[[Repls]]
# Cloud responses include a "[TraceId: <hex>]" suffix on this error; normalize.
Old = '\[TraceId: [a-f0-9]+\]'
New = '[TraceId: [TRACE_ID]]'
Order = 5
Old = '(?m)^(Error: cannot create resources\.postgres_databases\.my_database: )[^\r\n]*( \(404 NOT_FOUND\))$'
New = '${1}[API_MESSAGE]${2}'

[[Repls]]
Old = '(?m)^API message: [^\r\n]*$'
New = 'API message: [API_MESSAGE]'
Loading