<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: When creating a cluster, ERROR: &amp;quot;Missing required field 'spark_version'&amp;quot; even though i in missing-QuestionPost</title>
    <link>https://community.databricks.com/t5/missing-questionpost/when-creating-a-cluster-error-quot-missing-required-field-spark/m-p/42794#M122</link>
    <description>&lt;P&gt;Hi, Matt. Would be super useful if you could provide a more complete code example on how it worked.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Aug 2023 13:38:47 GMT</pubDate>
    <dc:creator>Norway</dc:creator>
    <dc:date>2023-08-29T13:38:47Z</dc:date>
    <item>
      <title>When creating a cluster, ERROR: "Missing required field 'spark_version'" even though it was specified</title>
      <link>https://community.databricks.com/t5/missing-questionpost/when-creating-a-cluster-error-quot-missing-required-field-spark/m-p/2704#M5</link>
      <description>&lt;P&gt;Every time I try to create a cluster over the API I get this.  Even when I am literally using the example JSON from the API documentation:&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;    "cluster_name": "single-node-cluster",&lt;/P&gt;&lt;P&gt;    "node_type_id": "i3.xlarge",&lt;/P&gt;&lt;P&gt;    "spark_version": "7.6.x-scala2.12",&lt;/P&gt;&lt;P&gt;    "num_workers": 0,&lt;/P&gt;&lt;P&gt;    "custom_tags": {&lt;/P&gt;&lt;P&gt;        "ResourceClass": "SingleNode"&lt;/P&gt;&lt;P&gt;    },&lt;/P&gt;&lt;P&gt;    "spark_conf": {&lt;/P&gt;&lt;P&gt;        "spark.databricks.cluster.profile": "singleNode",&lt;/P&gt;&lt;P&gt;        "spark.master": "[*, 4]"&lt;/P&gt;&lt;P&gt;    }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;I thought maybe that example spark version was too old, so I set it to 13.0 and that made no difference.&lt;/P&gt;&lt;P&gt;This is being submitted using the Python Databricks-CLI class ApiClient.&lt;/P&gt;&lt;P&gt;Full error text:&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;HTTPError: 400 Client Error: Bad Request for url: &lt;A href="https://mothership-production.cloud.databricks.com/api/2.0/clusters/create" target="test_blank"&gt;https://mothership-production.cloud.databricks.com/api/2.0/clusters/create&lt;/A&gt;&lt;/P&gt;&lt;P&gt; Response from server: &lt;/P&gt;&lt;P&gt; { 'details': [ { '@type': 'type.googleapis.com/google.rpc.ErrorInfo',&lt;/P&gt;&lt;P&gt;                 'domain': '',&lt;/P&gt;&lt;P&gt;                 'reason': 'CM_API_ERROR_SOURCE_CALLER_ERROR'}],&lt;/P&gt;&lt;P&gt;  'error_code': 'INVALID_PARAMETER_VALUE',&lt;/P&gt;&lt;P&gt;  'message': "Missing required field 'spark_version'"}&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;In the python debugger, it is using the method `databricks_cli/sdk/api_client.py(174)perform_query()`.&lt;/P&gt;&lt;P&gt;If I have the debugger spit out theparameters for that "query", I get:&lt;/P&gt;&lt;P&gt;data = {'num_workers': '{"cluster_name": "single-node-cluster", "node_type_id": "i3.xlarge", "spark_version": "7.6.x-scala2.12", "num_workers": 0, "custom_tags": {"ResourceClass": "SingleNode"}, "spark_conf": {"spark.databricks.cluster.profile": "singleNode", "spark.master": "[*, 4]"}}'}&lt;/P&gt;&lt;P&gt;path = '/clusters/create'&lt;/P&gt;&lt;P&gt;headers = {'Authorization': 'Bearer [REDACTED]', 'Content-Type': 'text/json', 'user-agent': 'databricks-cli-0.17.7-'}&lt;/P&gt;&lt;P&gt;method = 'POST'&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 20:15:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/missing-questionpost/when-creating-a-cluster-error-quot-missing-required-field-spark/m-p/2704#M5</guid>
      <dc:creator>MattJohn_35453</dc:creator>
      <dc:date>2023-06-22T20:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: When creating a cluster, ERROR: "Missing required field 'spark_version'" even though it was specified</title>
      <link>https://community.databricks.com/t5/missing-questionpost/when-creating-a-cluster-error-quot-missing-required-field-spark/m-p/2705#M6</link>
      <description>&lt;P&gt;Tried using the databricks-sdk instead and just get an error on a different parameter - &lt;/P&gt;&lt;P&gt;"DatabricksError: Exactly 1 of virtual_cluster_size, num_workers or autoscale must be specified."&lt;/P&gt;&lt;P&gt;But, as you can see below, it definitely has "num_workers".  And again, that JSON is literally pulled from the API docs....&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;cluster_spec={&lt;/P&gt;&lt;P&gt;    "cluster_name": "single-node-cluster",&lt;/P&gt;&lt;P&gt;    "node_type_id": "i3.xlarge",&lt;/P&gt;&lt;P&gt;    "spark_version": "7.6.x-scala2.12",&lt;/P&gt;&lt;P&gt;    "num_workers": 0,&lt;/P&gt;&lt;P&gt;    "custom_tags": {&lt;/P&gt;&lt;P&gt;        "ResourceClass": "SingleNode"&lt;/P&gt;&lt;P&gt;    },&lt;/P&gt;&lt;P&gt;    "spark_conf": {&lt;/P&gt;&lt;P&gt;        "spark.databricks.cluster.profile": "singleNode",&lt;/P&gt;&lt;P&gt;        "spark.master": "[*, 4]"&lt;/P&gt;&lt;P&gt;    }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from databricks.sdk import WorkspaceClient&lt;/P&gt;&lt;P&gt;import json&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dbrix_environment = 'production'&lt;/P&gt;&lt;P&gt;dbrix_host = f"https://XXXXXX-{dbrix_environment}.cloud.databricks.com"&lt;/P&gt;&lt;P&gt;dbrix_token = dbutils.secrets.get(scope = 'funstuff', key = 'choo-choo')&lt;/P&gt;&lt;P&gt;w = WorkspaceClient(&lt;/P&gt;&lt;P&gt;    host = dbrix_host,&lt;/P&gt;&lt;P&gt;    token = dbrix_token&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;w.clusters.create(json.dumps(cluster_spec))&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 20:56:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/missing-questionpost/when-creating-a-cluster-error-quot-missing-required-field-spark/m-p/2705#M6</guid>
      <dc:creator>MattJohn_35453</dc:creator>
      <dc:date>2023-06-22T20:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: When creating a cluster, ERROR: "Missing required field 'spark_version'" even though it was specified</title>
      <link>https://community.databricks.com/t5/missing-questionpost/when-creating-a-cluster-error-quot-missing-required-field-spark/m-p/2706#M7</link>
      <description>&lt;P&gt;Well, I feel dumb.&lt;/P&gt;&lt;P&gt;I tried the databricks-cli one again, but instead of passing JSON, I did `**cluster_spec` so it would expand the dict as separate parameters and that seemed to work.&lt;/P&gt;&lt;P&gt;I tried the same on the databricks-sdk one and that didn't seem to make a difference, so I have to fgure that out since the CLI one is deprecated now, I guess.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 21:06:17 GMT</pubDate>
      <guid>https://community.databricks.com/t5/missing-questionpost/when-creating-a-cluster-error-quot-missing-required-field-spark/m-p/2706#M7</guid>
      <dc:creator>MattJohn_35453</dc:creator>
      <dc:date>2023-06-22T21:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: When creating a cluster, ERROR: "Missing required field 'spark_version'" even though i</title>
      <link>https://community.databricks.com/t5/missing-questionpost/when-creating-a-cluster-error-quot-missing-required-field-spark/m-p/42794#M122</link>
      <description>&lt;P&gt;Hi, Matt. Would be super useful if you could provide a more complete code example on how it worked.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 13:38:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/missing-questionpost/when-creating-a-cluster-error-quot-missing-required-field-spark/m-p/42794#M122</guid>
      <dc:creator>Norway</dc:creator>
      <dc:date>2023-08-29T13:38:47Z</dc:date>
    </item>
  </channel>
</rss>

