- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi @Sunioj ,
Both errors most likely mean that the SQL warehouse could not start at that moment, so the first step is to read the real error text. requests.raise_for_status() hides the response body, so log response.status_code and response.text before you raise; the JSON body has an error_code and a message that say why the start was refused. Free Edition has fixed limits that matter here: one SQL warehouse, limited to 2X-Small, and a fair usage quota. The Free Edition limitations page says that if you exceed your quota, "your workspace's compute resources will be shut down and unavailable for the rest of the day". A scheduled Lambda that wakes the warehouse many times a day can reach that limit, and then both the connect and the start call fail until the quota resets. That can look random, and it can also explain why a test from your laptop at another time works. To check, open SQL Warehouses in the workspace when the Lambda fails, look at the warehouse state, and note the time of day of the failures. A retry with a growing wait (for example 30 seconds, 2 minutes, 5 minutes) is fine for a short start-up problem, but it will not help when the quota is used up, so run the Lambda less often or load more data per run. Also note that Free Edition has no SLA or support, so a paid workspace is the safer place for a production schedule.
Docs: https://docs.databricks.com/aws/en/getting-started/free-edition-limitations