-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error Uploading results to dbt_artifacts.invocations #270
Comments
Hi @leeainscough, thanks for raising this, and apologies for the delay in getting back to you. Please could you let me know which version of Thanks! |
Hi Gemma,
I am using the latest version 2.2.2 when this happens
Thanks
Lee
…On Fri, Mar 31, 2023 at 1:57 PM Gemma Down ***@***.***> wrote:
Hi @leeainscough <https://github.com/leeainscough>, thanks for raising
this, and apologies for the delay in getting back to you.
Please could you let me know which version of dbt_artifacts you are using
within your packages.yml file? If it is not the latest (2.2.2), please
can you upgrade to the latest version and see if that resolves it. In the
current version the single quotes look to be being escaped correctly, but I
just want to check whether this behaviour is still occurring despite that
or not.
Thanks!
—
Reply to this email directly, view it on GitHub
<#270 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AK2RTZFUA6CIFVQLIUCQRODW63ICHANCNFSM6AAAAAAVJTLQBY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi Any updates on this? To confirm, if my project is ran via dbt cloud scheduling it is fine. If I orchestrate this from airflow, I get the about error when writing the results |
I'm afraid I've not been able to replicate this behaviour myself. Please could you provide a minimal example which produces the error so that I can run against the same thing that you are seeing it in? Many thanks. |
Does this help?
insert into prod_db.dbt_artifacts.invocations
select
$1,
$2,
$3,
$4,
$5,
$6,
$7,
$8,
$9,
$10,
nullif($11, ''),
nullif($12, ''),
nullif($13, ''),
nullif($14, ''),
nullif($15, ''),
parse_json($16),
parse_json($17),
parse_json($18),
parse_json($19)
from values
(
'0fae58e9-cec4-4307-8c6e-fbd66bb1ef6b',
'1.3.4',
'snowflake_dbt',
'2023-04-24 14:09:57.245098+00:00',
'run',
'False',
'user',
'default',
'analysis',
4,
'203743',
'191997',
'143650132',
'other',
'Triggered via Apache Airflow by task \'trigger_dbt_cloud_job_run\'
in the airtable_ingest DAG.',
null,
null,
'{"write_json": true, "use_colors": true, "printer_width": 80,
"version_check": true, "partial_parse": true, "static_parser": true,
"profiles_dir": "/tmp/jobs/143650132/.dbt", "send_anonymous_usage_stats":
true, "event_buffer_size": 100000, "quiet": false, "no_print": false,
"cache_selected_only": false, "profile": "user", "target": "default",
"which": "run", "rpc_method": "run", "indirect_selection": "eager"}',
'{"DBT_CLOUD_PROJECT_ID": "203743", "DBT_CLOUD_RUN_ID":
"143650132", "DBT_CLOUD_JOB_ID": "191997", "DBT_CLOUD_RUN_REASON":
"Triggered via Apache Airflow by task 'trigger_dbt_cloud_job_run' in the
airtable_ingest DAG.", "DBT_CLOUD_RUN_REASON_CATEGORY": "other"}'
)
2023-04-24 14:10:27.492455 (MainThread): [0m14:10:27 Snowflake adapter:
Snowflake query id: 01abd7b2-0202-73ff-0000-5bd9094bfada
2023-04-24 14:10:27.492724 (MainThread): [0m14:10:27 Snowflake adapter:
Snowflake error: 001003 (42000): SQL compilation error:
syntax error line 52 at position 170 unexpected 'trigger_dbt_cloud_job_run'.
2023-04-24 14:10:27.494773 (MainThread): [0m14:10:27 Database error while
running on-run-end
2023-04-24 14:10:27.495188 (MainThread): [0m14:10:27 On master: Close
2023-04-24 14:10:27.677435 (MainThread): [0m14:10:27 Connection 'master'
was properly closed.
2023-04-24 14:10:27.677716 (MainThread): [0m14:10:27 Connection
'model.dbt_artifacts.fct_dbt__test_executions' was properly closed.
2023-04-24 14:10:27.677864 (MainThread): [0m14:10:27 Connection
'model.dbt_artifacts.dim_dbt__snapshots' was properly closed.
2023-04-24 14:10:27.677998 (MainThread): [0m14:10:27 Connection
'model.dbt_artifacts.dim_dbt__sources' was properly closed.
2023-04-24 14:10:27.678140 (MainThread): [0m14:10:27 Connection
'model.dbt_artifacts.dim_dbt__tests' was properly closed.
2023-04-24 14:10:27.678453 (MainThread): [0m14:10:27 Sending event:
{'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context':
[<snowplow_tracker.self_describing_json.SelfDescribingJson object at
0x7f9a602fb430>, <snowplow_tracker.self_describing_json.SelfDescribingJson
object at 0x7f9a602fb460>,
<snowplow_tracker.self_describing_json.SelfDescribingJson object at
0x7f9a602fb6a0>]}
2023-04-24 14:10:27.678770 (MainThread): [0m14:10:27 Flushing usage events
2023-04-24 14:10:27.706163 (MainThread): Database Error
001003 (42000): SQL compilation error:
syntax error line 52 at position 170 unexpected
'trigger_dbt_cloud_job_run'.
…On Mon, Apr 24, 2023 at 2:26 PM Gemma Down ***@***.***> wrote:
I'm afraid I've not been able to replicate this behaviour myself. Please
could you provide a minimal example which produces the error so that I can
run against the same thing that you are seeing it in? Many thanks.
—
Reply to this email directly, view it on GitHub
<#270 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AK2RTZCKBXJ6PQOIGGRPX5LXCZ5OZANCNFSM6AAAAAAVJTLQBY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I believe the very last part of the insert "Triggered via Apache Airflow by task 'trigger_dbt_cloud_job_run' in the needs to be wrapped as "Triggered via Apache Airflow by task \'trigger_dbt_cloud_job_run\' in the Thanks |
Thanks for the extra detail. @danthelion was able to spot that it's related to the environment variable field rather than the |
Great - thankyou! |
If I schedule a dbt job from within dbt cloud, the results of the invocations are uploaded without error.
However,if I call the dbt cloud job from airflow, the results being inserted into dbt_artifacts.invocations are throwing an error due to the escape sequences/single quotes within the message
example
Triggered via Apache Airflow by task 'trigger_dbt_cloud_job_run' in the airtable_ingest DAG.
Database Error
001003 (42000): SQL compilation error:
syntax error line 52 at position 170 unexpected 'trigger_dbt_cloud_job_run'.
The text was updated successfully, but these errors were encountered: