databricks / databricks-sdk-py

Databricks SDK for Python (Beta)
https://databricks-sdk-py.readthedocs.io/
Apache License 2.0
377 stars 125 forks source link

Job creation fail with regular expression error #394

Closed dipankarkush-db closed 1 year ago

dipankarkush-db commented 1 year ago

I was trying to install UCX on GCP and got this error. This error does not happen for AWS and Azure. Here is the full stack trace. Related issue - https://github.com/databrickslabs/ucx/issues/419

01:58 INFO [] Creating configuration file: /Users/dipankar.kushari@databricks.com/.ucx/config.yml Open config file in the browser and continue installing? (default: yes): 01:59 INFO [] Uploading wheel to dbfs:/Users/dipankar.kushari@databricks.com/.ucx/wheels/databricks_labs_ucx-0.3.1+2720231010015907-py3-none-any.whl 01:59 INFO [] Uploading wheel to /Workspace/Users/dipankar.kushari@databricks.com/.ucx/wheels/databricks_labs_ucx-0.3.1+2720231010015907-py3-none-any.whl 01:59 INFO [] Creating new job configuration for step=assessment Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/Users/dipankar.kushari/Library/CloudStorage/GoogleDrive-dipankar.kushari@databricks.com/My Drive/10x/UC/UCX/ucx/src/databricks/labs/ucx/install.py", line 644, in installer.run() File "/Users/dipankar.kushari/Library/CloudStorage/GoogleDrive-dipankar.kushari@databricks.com/My Drive/10x/UC/UCX/ucx/src/databricks/labs/ucx/install.py", line 82, in run self._run_configured() File "/Users/dipankar.kushari/Library/CloudStorage/GoogleDrive-dipankar.kushari@databricks.com/My Drive/10x/UC/UCX/ucx/src/databricks/labs/ucx/install.py", line 86, in _run_configured self._create_jobs() File "/Users/dipankar.kushari/Library/CloudStorage/GoogleDrive-dipankar.kushari@databricks.com/My Drive/10x/UC/UCX/ucx/src/databricks/labs/ucx/install.py", line 284, in _create_jobs self._deployed_steps[step_name] = self._ws.jobs.create(settings).job_id ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/76/zv4jmwyd2djf6c35f2nly9br0000gp/T/tmp.6lb6NBtPaF/lib/python3.11/site-packages/databricks/sdk/service/jobs.py", line 2999, in create res = self._api.do('POST', '/api/2.1/jobs/create', body=body, headers=headers) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/76/zv4jmwyd2djf6c35f2nly9br0000gp/T/tmp.6lb6NBtPaF/lib/python3.11/site-packages/databricks/sdk/core.py", line 1061, in do return retryable(self._perform)(method, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/76/zv4jmwyd2djf6c35f2nly9br0000gp/T/tmp.6lb6NBtPaF/lib/python3.11/site-packages/databricks/sdk/retries.py", line 47, in wrapper raise err File "/private/var/folders/76/zv4jmwyd2djf6c35f2nly9br0000gp/T/tmp.6lb6NBtPaF/lib/python3.11/site-packages/databricks/sdk/retries.py", line 29, in wrapper return func(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/76/zv4jmwyd2djf6c35f2nly9br0000gp/T/tmp.6lb6NBtPaF/lib/python3.11/site-packages/databricks/sdk/core.py", line 1150, in _perform raise self.make_nicer_error(response=response, **payload) from None databricks.sdk.core.DatabricksError: The provided tag value (v0.3.1+2720231010015915) contains invalid character. The value must match the regular expression ^(([A-Za-z0-9][-A-Za-z0-9.])?[A-Za-z0-9])?$.

mgyucht commented 1 year ago

There are different requirements for tagging in each environment based on what is supported in each cloud. See https://docs.gcp.databricks.com/administration-guide/account-settings/usage-detail-tags.html#limitations for a description of what is allowed in GCP's tags. In this case, you can't include + in a tag value.