You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
query errors in on-run-start and on-run-end hooks aren't appropriately caught/handled.
Example backtrace:
Traceback (most recent call last):
File "/usr/local/bin/dbt", line 11, in <module>
load_entry_point('dbt==0.8.2', 'console_scripts', 'dbt')()
File "/usr/local/Cellar/dbt/0.8.2/libexec/lib/python3.6/site-packages/dbt/main.py", line 37, in main
handle(args)
File "/usr/local/Cellar/dbt/0.8.2/libexec/lib/python3.6/site-packages/dbt/main.py", line 63, in handle
res = run_from_args(parsed)
File "/usr/local/Cellar/dbt/0.8.2/libexec/lib/python3.6/site-packages/dbt/main.py", line 117, in run_from_args
result = task.run()
File "/usr/local/Cellar/dbt/0.8.2/libexec/lib/python3.6/site-packages/dbt/task/run.py", line 18, in run
results = runner.run_models(self.args.models, self.args.exclude)
File "/usr/local/Cellar/dbt/0.8.2/libexec/lib/python3.6/site-packages/dbt/runner.py", line 800, in run_models
should_run_hooks=True)
File "/usr/local/Cellar/dbt/0.8.2/libexec/lib/python3.6/site-packages/dbt/runner.py", line 770, in run_types_from_graph
should_execute)
File "/usr/local/Cellar/dbt/0.8.2/libexec/lib/python3.6/site-packages/dbt/runner.py", line 627, in execute_nodes
self.run_hooks(profile, flat_graph, dbt.utils.RunHookType.End)
File "/usr/local/Cellar/dbt/0.8.2/libexec/lib/python3.6/site-packages/dbt/runner.py", line 496, in run_hooks
adapter.execute_all(profile=profile, sqls=compiled_hooks)
File "/usr/local/Cellar/dbt/0.8.2/libexec/lib/python3.6/site-packages/dbt/adapters/default.py", line 547, in execute_all
connection, _ = cls.add_query(profile, sql, model_name)
File "/usr/local/Cellar/dbt/0.8.2/libexec/lib/python3.6/site-packages/dbt/adapters/default.py", line 526, in add_query
cursor.execute(sql)
psycopg2.ProgrammingError: relation "dbt_jthandy.some_table" does not exist
The text was updated successfully, but these errors were encountered:
This particular error shouldn't happen anymore. If there's an error in an on-run-start or on-run-end hook, dbt will hard exit, but will not show a backtrace.
$ dbt run
Encountered an error:
schema "bad_schema" does not exist
LINE 1: create table if not exists bad_schema.hook_test (id int)
^
$
@jthandy what do you think should happen if an on-run-start hook fails? I don't think we can skip dependents as we do with models, since every model is a dependent! My instinct is that cancelling the run makes sense, but the above output would benefit from more info for the end-user.
I don't think error messages (even ones that are passed through from the database) are a bad thing here. The only thing that would be helpful is if dbt could tell the user what it was attempting to run when it encountered that error message. Could it say:
$ dbt run
Encountered an error **while running pre-hook**:
schema "bad_schema" does not exist
LINE 1: create table if not exists bad_schema.hook_test (id int)
^
query errors in
on-run-start
andon-run-end
hooks aren't appropriately caught/handled.Example backtrace:
The text was updated successfully, but these errors were encountered: