Skip to content

DAB dynvar: cannot parse resource keys starting with digits when permissions are set #7387

Open

Description

@Codo155

Problem

Resource keys starting with a digit (e.g. 00_clear_silver_and_gold) fail with cannot parse when permissions are defined on the resource.

Error message:
Error: cannot plan resources.jobs.00_clear_silver_and_gold.permissions: cannot parse "/jobs/${resources.jobs.00_clear_silver_and_gold.id}" Error: planning failed

The same key works fine without permissions. Renaming the key to not start with a digit (e.g. clear_silver_and_gold) while keeping name: 00_clear_silver_and_gold resolves the issue.

Reproduction

CLI version: 1.7.0

resources:
  jobs:
    00_clear_silver_and_gold:
      name: 00_clear_silver_and_gold
      permissions:
        - group_name:  engineer-group
          level: CAN_MANAGE
        - group_name: admin-group
          level: CAN_MANAGE
      tasks:
        - task_key: example_task
          notebook_task:
            notebook_path: ${workspace.file_path}/src/example

Running databricks bundle deploy or databricks bundle plan produces:
Error: cannot plan resources.jobs.00_clear_silver_and_gold.permissions: cannot parse "/jobs/${resources.jobs.00_clear_silver_and_gold.id}"

Expected behavior
Resource keys starting with digits should be supported, consistent with how Terraform and the Databricks API handle job names.

Activity

  1. devteamaegis commented on Nov 10, 2026

    @devteamaegis

    I reproduced this on main (688c228) with the local acceptance harness: a job keyed 00_clear with a permissions block fails bundle plan with the same cannot parse "/jobs/${resources.jobs.00_clear.id}" error.

    Cause: the direct engine links the permissions node to its job through an internal ${resources.jobs.<key>.id} reference. The reference grammar (dynvar.BaseVarDef in libs/dyn/dynvar/ref.go, mirrored by _base_var_def in the Python package) requires each path segment to start with a letter, optionally after underscores. Leading digits are rejected on purpose: see the leading-digit-* cases in libs/dyn/dynvar/testdata/reference_vectors.json. A key like this deploys until something has to reference it, such as permissions, grants or a user-written ${resources.jobs.00_clear.id}.

    I see two ways to fix it:

    1. Allow segments to start with digits as long as they contain a letter, so ${1} stays a literal. This would change Go, Python and the shared vectors together, the same way dynvar: fix references to resource keys with trailing underscores #6965 does for trailing underscores.
    2. Keep the grammar and have bundle validate reject resource keys that can't be referenced, with a clear error.

    Since this changes a rule the tests check on purpose, which approach would you accept? I can send a PR for either one.

    This was investigated and written with an AI coding agent (Claude) working on my behalf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions