question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Retry model on connection errors

See original GitHub issue

Hey Guys,

Is it possible to implement re-trying of queries if the query fails due to non-model related errors?

For example, sometimes Azure SQL fails with errors like this:

[2021-02-24 05:50:02,777] {dbt_rpc.py:83} INFO - Failed model `base_signups`: Database Error in model base_thrive_leads_signups (models/02_base/base_signups.sql)
  ('08S01', '[08S01] [Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: Error code 0x68 (104) (SQLExecDirectW)')
  compiled SQL at target/run/my_project/models/02_base/base_signups.sql

This is particularly frustrating in daily, automated runs through airlfow. I have solved it for now by adding retry logic through airflow that re-runs only failed and skipped models, but perhaps it would be worthwhile solving this at the dbt-sqlserver level for everyone?

Thanks, kim

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sdebruyncommented, Oct 7, 2022

The dbt-sqlserver 1.2.0 release includes an option retries in the target configuration which should mitigate these kinds of issues. Let me know if that doesn’t work for you so that I can reopen this issue.

1reaction
nystheecommented, Aug 23, 2022

Hi This is azure sql.

Encountered an error while running operation: Database Error 123 ('28000', "[28000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Login failed for user ''. (18456) (SQLDriverConnect)")

Read more comments on GitHub >

github_iconTop Results From Across the Web

Retry a database connection - iNTERFACEWARE Help Center
Sometimes errors can occur when you are connecting to a Database, because network connections to a database are never 100% perfect. And if...
Read more >
Azure SQL Database - Working with transient errors
Troubleshoot transient connection errors in SQL Database and SQL Managed Instance ... If the error is transient, retry to open a connection.
Read more >
PHP MySQL Connection error - Implementing Retry logic
I would suggest we put number of retries into the call as well with some sleep. I would recommend looking at Transient Fault...
Read more >
Try. And then retry. There can be failure. | Neo4j Developer Blog
To sum this up: Stateful connections are costly to acquire and there are many good reasons to keep them around once created. Connection...
Read more >
Handle transient database connection errors
TransientRetryer is based on the Microsoft Enterprise Library Transient Fault Handling Application Block and it implements retry logic. The ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found