Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE] databricks bundle init #795

Open
mzwiesler opened this issue Feb 1, 2024 · 6 comments
Open

[ISSUE] databricks bundle init #795

mzwiesler opened this issue Feb 1, 2024 · 6 comments

Comments

@mzwiesler
Copy link

mzwiesler commented Feb 1, 2024

Description

Calling databricks bundles init returns the following error:

Error: failed to compute file content for {{.project_name}}/databricks.yml.tmpl. template: :35:31: executing "" at <user_name>: error calling user_name: unexpected error handling request: json: cannot unmarshal number into Go struct field APIErrorBody.error_code of type string. This is likely a bug in the Databricks SDK for Go or the underlying REST API. Please report this issue with the following debugging information to the SDK issue tracker at https://github.com/databricks/databricks-sdk-go/issues.

Reproduction
Running databricks bundles init:

databricks bundle init    

Welcome to the default Python template for Databricks Asset Bundles!
Please provide the following details to tailor the template to your preferences.

Unique name for this project [my_project]: 
Include a stub (sample) notebook in 'my_project/src': yes
Include a stub (sample) Delta Live Tables pipeline in 'my_project/src': no
Include a stub (sample) Python package in 'my_project/src': no

Expected behavior
Creation of databricks asset bundle

Is it a regression?
using databricks cli v0.212.3

Debug Logs
Request log:

GET /api/2.0/preview/scim/v2/Me
> * Host: 
> * Accept: application/json
> * Authorization: REDACTED
> * User-Agent: cli/0.212.3 databricks-sdk-go/0.30.1 go/1.21.6 os/darwin cmd/bundle_init auth/pat
< HTTP/2.0 403 Forbidden
< * Content-Length: 52
< * Content-Type: application/json; charset=utf-8
< * Date: Thu, 01 Feb 2024 07:11:53 GMT
< * Server: databricks
< * Vary: Accept-Encoding
< * X-Databricks-Reason-Phrase: Invalid access token.
< {
<   "error_code": 403,
<   "message": "Invalid access token."
< }

Other Information

  • OS: macOS
  • Version: 14.3

Additional context
Add any other context about the problem here.

@christopher-danz
Copy link

Having the same issue.

@christopher-danz
Copy link

Hey @mzwiesler , I solved it for me. Do you have multiple user profiles in your .databrickscfg file?

@mzwiesler
Copy link
Author

Hi @christopher-danz
Yes I have a couple of them and a default one. Tried the command with profile and without but nothing worked so far. Did you solve it?

@christopher-danz
Copy link

I feel like I tried everything there is to troubleshoot.. empty cache, create new .databrickscfg file, generate new token, ... the whole thing and I am not entirely sure what made the differnce in the end..

After ensuring you authenticate correctly, try to run:
databricks jobs list
... it should list all the jobs for your DEFAULT profile.

then run:
databricks jobs list --profile=YOUR_DESIRED_PROFILE_TO_USE_DAB
and it should list the jobs for the other host, right?

I then ran:
databricks bundle init (specified the unique name and the additional stuff)
and it worked then.

I hope this will solve your issue, if not let me know. Maybe I can further assist you.

@mzwiesler
Copy link
Author

Hi @christopher-danz
True it seems it really was a token issue. It now works with a new token.
Still not 100% sure what happened. Thanks for your support.

@christopher-danz
Copy link

I'm glad it worked out for both of us. 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants