databricks / cli

Databricks CLI
Other
132 stars 50 forks source link

Panic Error Occurs with Versions Above 0.218.1 for Specific Repositories #1497

Closed JulienBouveret closed 2 months ago

JulienBouveret commented 3 months ago

Hello,

I am experiencing a panic error when using Databricks CLI versions above 0.218.1. This issue does not occur with version 0.218.1 or earlier versions. The error is specific to certain repositories and does not affect all of them. image

pietern commented 3 months ago

Thanks for confirming. Can you confirm the Databricks CLI version you're running?

JulienBouveret commented 3 months ago

We are running the latest version of databricks cli on the repos where we dont have the panic error and on the ones that have the panic issue we are running the 0.218.1

andrewnester commented 3 months ago

@JulienBouveret if I understood correctly you don't have these panic errors if you're using 0.221.1 (latest version)? If so, is there anything that prevents you to upgrading to latest version everywhere?

JulienBouveret commented 3 months ago

No we still do face the issue even in 0.221.1 (latest version) for again specific repos.

Envoyé à partir de Outlook pour Androidhttps://aka.ms/AAb9ysg


From: Andrew Nester @.> Sent: Monday, June 24, 2024 12:49:22 PM To: databricks/cli @.> Cc: JULIEN BOUVERET (EXTERNAL) @.>; Mention @.> Subject: [EXTERNAL]Re: [databricks/cli] Panic Error Occurs with Versions Above 0.218.1 for Specific Repositories (Issue #1497)

EXTERNAL: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

@JulienBouverethttps://github.com/JulienBouveret if I understood correctly you don't have these panic errors if you're using 0.221.1 (latest version)? If so, is there anything that prevents you to upgrading to latest version everywhere?

— Reply to this email directly, view it on GitHubhttps://github.com/databricks/cli/issues/1497#issuecomment-2186270310, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BHVQ2D6FL6HYCEOFLC4JP2LZI72TFAVCNFSM6AAAAABJOARA56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBWGI3TAMZRGA. You are receiving this because you were mentioned.Message ID: @.***>

pietern commented 3 months ago

Some questions:

What's odd is that this could have happened in versions before v0.219.0, not after.

How are you currently pinning the CLI version in the action?

JulienBouveret commented 3 months ago

The panic error occurs during the "deployment" phase of the bundle and during the "bundle run" phase. We deploy two bundles for two different environments (EU and NA) in the same repository. The concurrency of the deployment is set to 1, so deployments are not simultaneous.

We never faced this issue before v0.219.0. Currently, for the deployments or pipelines throwing the panic error, we revert the CLI to v0.218.1.

pietern commented 3 months ago

Are the two environments different targets or different bundle directories altogether?

I suppose that ods_cdm ignition_extraction_eu is only defined in the EU bundle, correct?

ayoubbenz-db commented 3 months ago

With @pietern's help, we have managed to understand the root cause of the issue and find a solution.

Root cause In this project, DABs is used to deploy different assets on both regions EU and NA. To manage this custom deployment, there are two different jobs definitions : one for EU (job_eu.yml) and one for NA (job_na.yml). There is also a third empty file job.yml that is included in the databricks.yml definition of the bundle.

And at the Github Actions level, the EU workflow has (and it works similarly for NA):

This was working until 0.218.1. Starting from the version 0.219.1, the configuration import changed for DABs. The configuration is loaded per job, so for the deployment job it loads a configuration, and it loads it again for the run job. However, the copy of the file is done only for the deployment job. Hence, the panic error for the run job, because it cannot resolve the file.

Solutions

  1. Add a copy task of the job_eu.yml to job.yml, before running databricks bundle run <job_name>. This has been tested, and it is working fine.
  2. Use two different bundles: one for EU, and one for NA. But first, make sure that there aren't any code dependencies between NA and EU.
Ribeiro-Breno commented 3 months ago

It worked with this solution!!! Thank you, @ayoubbenz-db!