databricks / cli

Databricks CLI
Other
132 stars 50 forks source link

invalid character 'b' looking for beginning of value #1644

Closed madslyng closed 2 months ago

madslyng commented 2 months ago

Describe the issue

When running the command databricks --debug bundle init git@github.com:HIDDEN/poc-bundle-templates.git --template-dir template-name --output-dir="./bundles" --config-file="./config.yml", the CLI throws an error:

Error: failed to load config from file ./config.yml: invalid character 'b' looking for beginning of value
08:07:41 ERROR failed execution pid=269407 exit_code=1 error="failed to load config from file ./config.yml: invalid character 'b' looking for beginning of value"

Steps to reproduce the behavior

  1. Prepare a basic bundle-template that requires the project_name variable to be set.
  2. Prepare a config.yml file with the following content:
bundle:
  name: hello-bundle

variables:
  project_name: "test"
  1. run command: databricks --debug bundle init git@github.com:username/basic-bundle-template.git --template-dir template-name --output-dir="./bundles" --config-file="./config.yml"

Expected Behavior

Bundle is created in the folder ./bundles/project_name

Actual Behavior

databricks --debug bundle init git@github.com:username/basic-bundle-template.git --template-dir template-name --output-dir="./bundles" --config-file="./config.yml"
08:16:48  INFO start pid=289056 version=0.225.0 args="databricks, --debug, bundle, init, git@github.com:username/template-name.git, --template-dir, repository-name, --output-dir=./bundles, --config-file=./config.yml"
08:16:48 DEBUG running: git clone git@github.com:username/basic-bundle-template.git /tmp/template-name.git-1899811190 --no-tags --depth=1 pid=289056
Error: failed to load config from file ./config.yml: invalid character 'b' looking for beginning of value
08:16:50 ERROR failed execution pid=289056 exit_code=1 error="failed to load config from file ./config.yml: invalid character 'b' looking for beginning of value"

OS and CLI version

OS NAME="EndeavourOS" PRETTY_NAME="EndeavourOS" ID="endeavouros" ID_LIKE="arch" BUILD_ID="2023.08.05" ANSI_COLOR="38;2;23;147;209" HOME_URL="https://endeavouros.com" DOCUMENTATION_URL="https://discovery.endeavouros.com" SUPPORT_URL="https://forum.endeavouros.com" BUG_REPORT_URL="https://forum.endeavouros.com/c/general-system/endeavouros-installation" PRIVACY_POLICY_URL="https://endeavouros.com/privacy-policy-2" LOGO="endeavouros"

CLI Databricks CLI v0.225.0

Terraform Terraform v1.9.3 on linux_amd64

Is this a regression?

Unknown

Debug Logs

08:07:39 INFO start pid=269407 version=0.223.2 args="databricks, --debug, bundle, init, git@github.com:HIDDEN/poc-bundle-templates.git, --template-dir, HIDDEN-template, --output-dir=./bundles, --config-file=./config.yml" 08:07:39 DEBUG running: git clone git@github.com:HIDDEN/poc-bundle-templates.git /tmp/poc-bundle-templates.git-1055135399 --no-tags --depth=1 pid=269407 Error: failed to load config from file ./config.yml: invalid character 'b' looking for beginning of value 08:07:41 ERROR failed execution pid=269407 exit_code=1 error="failed to load config from file ./config.yml: invalid character 'b' looking for beginning of value"

madslyng commented 2 months ago

It seems the config file needs to be in JSON format instead of YAML. When I use JSON it works.

{
  "project_name": "testing"
}