vars set with `deploy` not used by `run`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with the databricks bundle deploy and databricks bundle run entry points and the variable assignment sources named in the error, including .databricks/bundle/<target>/variable-overrides.json. Reproduce the two-step command sequence with a required variable and verify that a value passed to deploy is available to run without repeating --var, while preserving the required-variable error when no value is supplied.
Written by the indexing model from the issue text.
Description
Describe the issue
This may not be a bug but I couldn't find supporting documentation on this behavior.
When variables that do not have a default value are set with --var at deploy time, they do not carry over to run. Instead the below error is returned
Error: no value assigned to required variable <variable> ...
The variable does indeed get set in the job so I'd expect run to know the value was already set.
Configuration
Create a job that uses the below variable
databricks.yml:
bundle:
name: dash_2
include:
- ./resources/*.yaml
variables:
my_variable:
description: no default value
targets:
prod:
mode: production
workspace:
host: <your host>
root_path: /Workspace/Users/${workspace.current_user.userName}/.bundle/${bundle.name}/${bundle.target}
Steps to reproduce the behavior
- run
databricks bundle deploy -t prod --var="my_variable=new_value" - Run
databricks bundle run -t prod <job_name> - See error
Expected Behavior
If a non-default var is set at deploy time then run will know that and pass without the var set there as well. It should act as you triggered the job from the UI.
Actual Behavior
run does not know the vars set at deploy time.
OS and CLI version
macos and ubuntu
cli v0.239.1
Is this a regression?
No
Debug Logs
11:10:33 DEBUG Apply pid=80996 mutator=load mutator=seq
11:10:33 DEBUG Apply pid=80996 mutator=load mutator=seq mutator=EntryPoint
11:10:33 DEBUG Apply pid=80996 mutator=load mutator=seq mutator=scripts.preinit
11:10:33 DEBUG No script defined for preinit, skipping pid=80996 mutator=load mutator=seq mutator=scripts.preinit
11:10:33 DEBUG Apply pid=80996 mutator=load mutator=seq mutator=ProcessRootIncludes
11:10:33 DEBUG Apply pid=80996 mutator=load mutator=seq mutator=ProcessRootIncludes mutator=seq
11:10:33 DEBUG Apply pid=80996 mutator=load mutator=seq mutator=ProcessRootIncludes mutator=seq mutator=ProcessInclude(resources/dash_1_scoping.yaml)
11:10:33 DEBUG Apply pid=80996 mutator=load mutator=seq mutator=ProcessRootIncludes mutator=seq mutator=ProcessInclude(resources/pt__monthly_update.yaml)
11:10:33 DEBUG Apply pid=80996 mutator=load mutator=seq mutator=ProcessRootIncludes mutator=seq mutator=ProcessInclude(resources/pt__new_cohort.yaml)
11:10:33 DEBUG Apply pid=80996 mutator=load mutator=seq mutator=VerifyCliVersion
11:10:33 DEBUG Apply pid=80996 mutator=load mutator=seq mutator=EnvironmentsToTargets
11:10:33 DEBUG Apply pid=80996 mutator=load mutator=seq mutator=ComputeIdToClusterId
11:10:33 DEBUG Apply pid=80996 mutator=load mutator=seq mutator=InitializeVariables
11:10:33 DEBUG Apply pid=80996 mutator=load mutator=seq mutator=DefineDefaultTarget(default)
11:10:33 DEBUG Apply pid=80996 mutator=load mutator=seq mutator=PythonMutator(load)
11:10:33 DEBUG Apply pid=80996 mutator=load mutator=seq mutator=validate:unique_resource_keys
11:10:33 DEBUG Apply pid=80996 mutator=load mutator=seq mutator=SelectTarget(dev)
11:10:33 DEBUG Loading profile dev because of host match pid=80996
11:10:33 DEBUG Apply pid=80996 mutator=<func>
11:10:33 DEBUG Apply pid=80996 mutator=initialize
11:10:33 INFO Phase: initialize pid=80996 mutator=initialize
11:10:33 DEBUG Apply pid=80996 mutator=initialize mutator=seq
11:10:33 DEBUG Apply pid=80996 mutator=initialize mutator=seq mutator=validate:AllResourcesHaveValues
11:10:33 DEBUG Apply pid=80996 mutator=initialize mutator=seq mutator=RewriteSyncPaths
11:10:33 DEBUG Apply pid=80996 mutator=initialize mutator=seq mutator=SyncDefaultPath
11:10:33 DEBUG Apply pid=80996 mutator=initialize mutator=seq mutator=SyncInferRoot
11:10:33 DEBUG Apply pid=80996 mutator=initialize mutator=seq mutator=PopulateCurrentUser
11:10:34 DEBUG GET /api/2.0/preview/scim/v2/Me
< HTTP/2.0 200 OK
< {
< "active": true,
< "emails": [
< {
< "primary": true,
< "type": "work",
< }
< ],
< "groups": [
< {
< },
< {
< },
< {
< }
< ],
< "id": "8793528040177278",
< "name": {
< },
< "roles": [
< {
< ],
< "schemas": [
< "urn:ietf:params:scim:schemas:core:2.0:User",
< "... (1 additional elements)"
< ],
< } pid=80996 mutator=initialize mutator=seq mutator=PopulateCurrentUser sdk=true
11:10:34 DEBUG Apply pid=80996 mutator=initialize mutator=seq mutator=LoadGitDetails
11:10:34 DEBUG Apply pid=80996 mutator=initialize mutator=seq mutator=ApplySourceLinkedDeploymentPreset
11:10:34 DEBUG Apply pid=80996 mutator=initialize mutator=seq mutator=DefineDefaultWorkspaceRoot
11:10:34 DEBUG Apply pid=80996 mutator=initialize mutator=seq mutator=ExpandWorkspaceRoot
11:10:34 DEBUG Apply pid=80996 mutator=initialize mutator=seq mutator=DefaultWorkspacePaths
11:10:34 DEBUG Apply pid=80996 mutator=initialize mutator=seq mutator=PrependWorkspacePrefix
11:10:34 DEBUG Apply pid=80996 mutator=initialize mutator=seq mutator=RewriteWorkspacePrefix
11:10:34 DEBUG Apply pid=80996 mutator=initialize mutator=seq mutator=SetVariables
11:10:34 ERROR Error: no value assigned to required variable DBT_PROJECT_SCHEMA. Assignment can be done using "--var", by setting the BUNDLE_VAR_DBT_PROJECT_SCHEMA environment variable, or in .databricks/bundle/<target>/variable-overrides.json file pid=80996 mutator=initialize mutator=seq mutator=SetVariables
11:10:34 ERROR Error: no value assigned to required variable DBT_PROJECT_SCHEMA. Assignment can be done using "--var", by setting the BUNDLE_VAR_DBT_PROJECT_SCHEMA environment variable, or in .databricks/bundle/<target>/variable-overrides.json file pid=80996 mutator=initialize mutator=seq
11:10:34 ERROR Error: no value assigned to required variable DBT_PROJECT_SCHEMA. Assignment can be done using "--var", by setting the BUNDLE_VAR_DBT_PROJECT_SCHEMA environment variable, or in .databricks/bundle/<target>/variable-overrides.json file pid=80996 mutator=initialize
Error: no value assigned to required variable DBT_PROJECT_SCHEMA. Assignment can be done using "--var", by setting the BUNDLE_VAR_DBT_PROJECT_SCHEMA environment variable, or in .databricks/bundle/<target>/variable-overrides.json file
11:10:34 ERROR failed execution pid=80996 exit_code=1 error="no value assigned to required variable DBT_PROJECT_SCHEMA. Assignment can be done using \"--var\", by setting the BUNDLE_VAR_DBT_PROJECT_SCHEMA environment variable, or in .databricks/bundle/<target>/variable-overrides.json file"
- Dominant language
- Go
- Stars
- 427
- Forks
- 267
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 233
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from databricks/cli
-
Apps commands only accept relative path to app.ymlPossibly taken @yuri-rod claimed this 38 days ago. OpenCLI
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
databricks/cli#6910 ·
Maintainers usually reply within 1 day
-
DABs
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
databricks/cli#6670 · 1 reaction ·
Maintainers usually reply within 1 day
-
Bump vulnerable dependencies workflow is failingPossibly taken @shreyas-goenka claimed this today. Openbump-vuln-deps-failure
databricks/cli#7531 · 1 comment · 7 assignees ·
Maintainers usually reply within 1 day
-
bundle run on an app fails with "not in RUNNING state" when the app's compute is UPDATINGPossibly taken @andrewnester claimed this 1 day ago. OpenBug DABs
Difficulty 3/5 1-2 days Newbie friendliness 76/100
databricks/cli#7451 · 1 assignee ·
Maintainers usually reply within 1 day
-
Bundle deploy of an AI/BI dashboard breaks viewers' private bookmarks (UI save + publish does not)Open
Difficulty 4/5 3-5 days Newbie friendliness 45/100
databricks/cli#7419 ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
prime-radiant-inc/evener#6241 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
coder/openstorage#807 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
NVIDIA/kubectl-nv#100 ·
Maintainers usually reply within 1 day
-
TestNoEagerPackageRegexps red on main: internal/gui/feedback.go:19 compiles a package-level regexpOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day