<?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 Issues making requests to Databricks from AWS Lambda in Databricks Free Edition Help</title>
    <link>https://community.databricks.com/t5/databricks-free-edition-help/issues-making-requests-to-databricks-from-aws-lambda/m-p/176350#M1028</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;I am getting acquainted with Databricks, of which I have signed up for a free account.&amp;nbsp;&lt;BR /&gt;I have a Lambda function using Python 3.14 and the databricks-sql-connector library that runs on a schedule, to take data from a file in S3 and put the differential data into a workspace in Databricks. There are two errors that I am having:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;1.&amp;nbsp; RequestError: &lt;SPAN class=""&gt;Error&lt;/SPAN&gt; during request to server: BAD_REQUEST: Cannot create the resource, please try again later.&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;Here is a snippet:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;from databricks import sql

conn = sql.connect(server_hostname=databricks_host,
                    http_path="/sql/1.0/warehouses/%s" % warehouse,
                    access_token=databricks_token,
            ) &lt;/LI-CODE&gt;&lt;P&gt;This code works fine locally, but in AWS lambda seems to fail randomly without much explanation. I tried to consult with Genie, other LLMs, Google, etc. to figure out the issue. Genie recommended that I implement a retry loop, but I am not sure if that makes sense since subsequent invocations of the code also had the same error.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Instead, I implemented that Lambda makes a &lt;A href="https://docs.databricks.com/api/warehouses/v1/start-warehouse" target="_self"&gt;REST API call to Databricks&lt;/A&gt; before the "connection" takes place. It seemed to work for a bit, then I started getting the next error:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;2.&amp;nbsp;requests.&lt;SPAN class=""&gt;exceptions&lt;/SPAN&gt;.HTTPError: 400 Client &lt;SPAN class=""&gt;Error&lt;/SPAN&gt;: Bad Request for url:&lt;BR /&gt;&lt;/STRONG&gt;Snippet:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;response = requests.post(
            "%s/api/2.0/sql/warehouses/%s/start" % (databricks_host,warehouse),
            headers={
                "Authorization": "Bearer %s" % databricks_token
            }
        )
        
response.raise_for_status()&lt;/LI-CODE&gt;&lt;P&gt;AWS logs shows the URL which the request failed with, and that URL when consulting with Genie also seems fine. This code also works just fine locally as well.&lt;BR /&gt;&lt;BR /&gt;I tried to search within this forum to see similar issues, but did not find any. If anyone could help it would be appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Nov 2026 13:36:22 GMT</pubDate>
    <dc:creator>Sunioj</dc:creator>
    <dc:date>2026-11-13T13:36:22Z</dc:date>
    <item>
      <title>Issues making requests to Databricks from AWS Lambda</title>
      <link>https://community.databricks.com/t5/databricks-free-edition-help/issues-making-requests-to-databricks-from-aws-lambda/m-p/176350#M1028</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;I am getting acquainted with Databricks, of which I have signed up for a free account.&amp;nbsp;&lt;BR /&gt;I have a Lambda function using Python 3.14 and the databricks-sql-connector library that runs on a schedule, to take data from a file in S3 and put the differential data into a workspace in Databricks. There are two errors that I am having:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;1.&amp;nbsp; RequestError: &lt;SPAN class=""&gt;Error&lt;/SPAN&gt; during request to server: BAD_REQUEST: Cannot create the resource, please try again later.&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;Here is a snippet:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;from databricks import sql

conn = sql.connect(server_hostname=databricks_host,
                    http_path="/sql/1.0/warehouses/%s" % warehouse,
                    access_token=databricks_token,
            ) &lt;/LI-CODE&gt;&lt;P&gt;This code works fine locally, but in AWS lambda seems to fail randomly without much explanation. I tried to consult with Genie, other LLMs, Google, etc. to figure out the issue. Genie recommended that I implement a retry loop, but I am not sure if that makes sense since subsequent invocations of the code also had the same error.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Instead, I implemented that Lambda makes a &lt;A href="https://docs.databricks.com/api/warehouses/v1/start-warehouse" target="_self"&gt;REST API call to Databricks&lt;/A&gt; before the "connection" takes place. It seemed to work for a bit, then I started getting the next error:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;2.&amp;nbsp;requests.&lt;SPAN class=""&gt;exceptions&lt;/SPAN&gt;.HTTPError: 400 Client &lt;SPAN class=""&gt;Error&lt;/SPAN&gt;: Bad Request for url:&lt;BR /&gt;&lt;/STRONG&gt;Snippet:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;response = requests.post(
            "%s/api/2.0/sql/warehouses/%s/start" % (databricks_host,warehouse),
            headers={
                "Authorization": "Bearer %s" % databricks_token
            }
        )
        
response.raise_for_status()&lt;/LI-CODE&gt;&lt;P&gt;AWS logs shows the URL which the request failed with, and that URL when consulting with Genie also seems fine. This code also works just fine locally as well.&lt;BR /&gt;&lt;BR /&gt;I tried to search within this forum to see similar issues, but did not find any. If anyone could help it would be appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2026 13:36:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/databricks-free-edition-help/issues-making-requests-to-databricks-from-aws-lambda/m-p/176350#M1028</guid>
      <dc:creator>Sunioj</dc:creator>
      <dc:date>2026-11-13T13:36:22Z</dc:date>
    </item>
  </channel>
</rss>

