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
@@ -0,0 +1,15 @@
bundle:
name: test-bundle
uuid: 11111111-2222-3333-4444-555555555555

# Restrict the sync to a single file under src/ so the file upload (and thus the
# forced failure below) is deterministic and does not sweep up acceptance-harness
# files written during the run.
sync:
paths:
- src

resources:
jobs:
job_one:
name: job one

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

>>> [CLI] bundle deploy
Error: Failed to acquire deployment lock: Internal error
Error: Internal error (500 INTERNAL_ERROR)

Endpoint: POST [DATABRICKS_URL]/api/2.0/workspace-files/import-file/Workspace%2FUsers%2F[USERNAME]%2F.bundle%2Ftest-bundle%2Fdefault%2Fstate%2Fdeploy.lock?overwrite=false
HTTP Status: 500 Internal Server Error
API error_code: INTERNAL_ERROR
API message: Internal error


Exit code: 1

>>> cat out.requests.txt

=== resources_metadata is reported without state_engine on a failed deploy
>>> cat telemetry.json
{
"resources": [
{
"resource_type": "jobs",
"count": 1
}
]
}

=== state_engine is null even though the engine was resolved before the failure
>>> cat telemetry.json
null
16 changes: 16 additions & 0 deletions acceptance/bundle/telemetry/deploy-failed-engine-unknown/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
errcode trace $CLI bundle deploy

trace cat out.requests.txt | jq 'select(has("path") and .path == "/telemetry-ext") | .body.protoLogs[] | fromjson' > telemetry.json

# resources_metadata is present (per-type counts come from the config), but there is
# no state_engine key: the deploy failed before deployCore ran, so b.Metrics.StateEngine
# is still the zero value and its omitempty drops it. This absence is the "unknown
# engine" the dashboard reports for failed/cancelled deploys.
title "resources_metadata is reported without state_engine on a failed deploy"
trace cat telemetry.json | jq '.entry.databricks_cli_log.bundle_deploy_event.resources_metadata'

title "state_engine is null even though the engine was resolved before the failure"
trace cat telemetry.json | jq '.entry.databricks_cli_log.bundle_deploy_event.resources_metadata.state_engine'

rm out.requests.txt
rm telemetry.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello
23 changes: 23 additions & 0 deletions acceptance/bundle/telemetry/deploy-failed-engine-unknown/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Reproduces the "unknown engine" deploy telemetry.
#
# A deploy that fails before it starts applying resources (here it fails while
# acquiring the deployment lock) still emits a bundle_deploy_event via the deferred
# LogDeployTelemetry in cmd/bundle/utils/process.go. But b.Metrics.StateEngine is
# assigned only inside deployCore (bundle/phases/deploy.go), which never runs on this
# path, so it is still the zero value. resources_metadata is therefore reported with
# per-type counts (which come from the config) but with no state_engine field, and
# the dashboard surfaces that null as engine="unknown" - even though the engine was
# fully resolved (ResolveEngineSetting) long before the deploy failed.
#
# The output is engine-agnostic: the lock is acquired in the shared deploy phase
# before any engine-specific plan/apply, and a failed deploy records no per-resource
# state sizes for either engine.
#
# The stubbed endpoint is the one the workspace filer writes through, so the first
# write - the deploy.lock file in lock.Acquire - is what fails here.
Cloud = false

[[Server]]
Pattern = "POST /api/2.0/workspace-files/import-file/{path...}"
Response.StatusCode = 500
Response.Body = '''{"error_code": "INTERNAL_ERROR", "message": "Internal error"}'''
Loading