Skip to content

Granting dashboard permissions to user fails #4488

@hafeja

Description

@hafeja

Issue description

databricks bundle deploy fails with following error:
Error: cannot update permissions: Principal: UserName(<>) does not exist

Configuration

databricks.yml looks like this:

targets:
  dev:
    ...
  prod:
    mode: production
    ...
    resources:
      dashboards:
        dashboard:
          permissions:
            - level: CAN_MANAGE
              group_name: ...
            - level: CAN_RUN
              user_name: x12345@abc.com

The user name is fake due to data protection.

IMPORTANT OBSERVATION

Image

The same user who causes the DAB deploy to fail CAN be found in the databricks UI. But the user is not only found, it can also be granted permissions without any error. When permissions for this user is revoked in the UI and the bundle deploy command is executed again afterwards, it succeeds.

-> If a dashboard is shared to a user using the UI first, the deploy command works afterwards. If the dashboard is not shared to that user beforehand, the DAB deployment fails.

Steps to reproduce the behavior

Run databricks bundle deploy.

Expected Behavior

databricks bundle deploy command succeeds. Afterwards, user has received dashboard permissions defined in databricks.yml

Actual Behavior

databricks bundle deploy fails with following error:

++ databricks bundle deploy --auto-approve --force
Building default...
Uploading dist/<>-py3-none-any.whl...
Uploading bundle files to /Workspace/<>/files...
Deploying resources...
Error: Terraform error during deployment: exit status 1
Error: cannot update permissions: Principal: UserName(<>) does not exist
  with databricks_permissions.dashboard_dashboard,
  on bundle.tf.json line 145, in resource.databricks_permissions.dashboard_dashboard:
 145:       },
Error: permission denied creating or updating dashboard_dashboard.
For assistance, contact the owners of this project.
They can redeploy the project to apply the latest set of permissions.
Please refer to https://docs.databricks.com/dev-tools/bundles/permissions.html for more on managing permissions.

OS and CLI version

databricks --version
Databricks CLI v0.285.0

Is this a regression?

I don't know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DABsDABs related issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions