Christophe Oudar
12/27/2023, 2:18 PMreport (and send-report)
I'm running edr send-report --days-back 7 --env prod --s3-bucket-name my_bucket in a custom docker and it fails with:
2023-12-27T10:21:27.957Z 2023-12-27 10:20:22 ā INFO ā Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_test_results", "macro_args": {"days_back": 7, "invocations_per_test": 720, "disable_passed_test_metrics": false}} --project-dir /usr/local/lib/python3.11/site-packages/elementary/monitor/dbt_project
2023-12-27T10:21:27.957Z 2023-12-27 10:21:26 ā ERROR ā Could not generate the report - Error: Failed to run dbt command.
2023-12-27T10:21:27.957Z Please reach out to our community for help with this issue.
2023-12-27T10:21:27.957Z NoneType: None
However here what's very intriguing: I can't reproduce it on my own laptop (vs failing ECS) with same credentials, command and environment variables š¤Æ
What's even more surprising is that if I run dbt run --select elementary --vars '{"elementary_full_refresh": "true"} then it works on ECS but the next day after it starts failing again.
I'm running edr 0.13.2 and dbt package 0.13.1.
Last run query by dbt is /* {"app": "dbt", "dbt_version": "1.7.4", "profile_name": "elementary", "target_name": "prod", "connection_name": "macro_log_macro_results"} */ and the query is successful.
Do you have an idea what could be failing? I would have guessed it's on the edr Python code but I can't really figure out unless I really deep dive š¤Ella Katz
01/01/2024, 10:30 AMChristophe Oudar
01/02/2024, 9:11 AMChristophe Oudar
01/02/2024, 9:17 AMedr) so that it could dump the Stacktrace of the error? It could be very helpful to debug šElla Katz
01/02/2024, 2:07 PMedt_target/edr.logChristophe Oudar
01/02/2024, 2:11 PMElla Katz
01/02/2024, 2:32 PM/usr/local/lib/python3.11/site-packages/elementary/monitor/dbt_project/logs
can you try to see if there's anything of value there?Christophe Oudar
01/02/2024, 2:33 PMChristophe Oudar
01/02/2024, 2:36 PMcat /usr/local/lib/python3.11/site-packages/elementary/monitor/dbt_project/logs/dbt.log to retrieve those expected logs right?Ella Katz
01/02/2024, 2:37 PMlogs because sometimes the log file can split into multiple filesChristophe Oudar
01/02/2024, 2:37 PMChristophe Oudar
01/02/2024, 2:37 PMElla Katz
01/02/2024, 2:37 PMChristophe Oudar
01/02/2024, 3:33 PMChristophe Oudar
01/02/2024, 3:40 PMroot@507de05f6d4f:/usr/app/logs# find / -name "dbt.log"
/usr/app/edr_target/dbt.log
/usr/app/logs/dbt.logChristophe Oudar
01/02/2024, 3:42 PMroot@507de05f6d4f:/usr/app/logs# more dbt.log
13:16:58.113303 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb
30b98ac50>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb30bced750>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb30bf20ad0>]}
============================== 13:16:58.119522 | 5d6da427-e474-4bdf-aec6-88ab8a80eeb8 ==============================
13:16:58.119522 [info ] [MainThread]: Running with dbt=1.7.3
13:16:58.120097 [debug] [MainThread]: running dbt with arguments {'printer_width': '80', 'indirect_selection': 'eager', 'log_cache_events': 'False', 'write_json': 'True', 'partial_parse': 'True', 'cac
he_selected_only': 'False', 'warn_error': 'None', 'fail_fast': 'False', 'version_check': 'True', 'log_path': '/usr/app/logs', 'debug': 'False', 'profiles_dir': '/usr/app/', 'use_colors': 'True', 'use_exp
erimental_parser': 'False', 'no_print': 'None', 'quiet': 'False', 'log_format': 'default', 'static_parser': 'True', 'introspect': 'True', 'invocation_command': 'dbt deps', 'target_path': 'None', 'warn_er
ror_options': 'WarnErrorOptions(include=[], exclude=[])', 'send_anonymous_usage_stats': 'True'}
13:16:58.243398 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '5d6da427-e474-4bdf-aec6-88ab8a80eeb8', 'context': [<snowplow_tracker.self_describing_json.Sel
fDescribingJson object at 0x7fb30b9ff050>]}
13:16:58.244473 [debug] [MainThread]: Set downloads directory='/tmp/dbt-downloads-dkypqfiz'
13:16:58.245042 [debug] [MainThread]: Making package index registry request: GET <https://hub.getdbt.com/api/v1/index.json>
13:16:58.266714 [debug] [MainThread]: Response from registry index: GET <https://hub.getdbt.com/api/v1/index.json> 200
13:16:58.268382 [debug] [MainThread]: Making package registry request: GET <https://hub.getdbt.com/api/v1/dbt-labs/codegen.json>
13:16:58.285552 [debug] [MainThread]: Response from registry: GET <https://hub.getdbt.com/api/v1/dbt-labs/codegen.json> 200
13:16:58.288430 [debug] [MainThread]: Making package registry request: GET <https://hub.getdbt.com/api/v1/dbt-labs/dbt_utils.json>
13:16:58.305585 [debug] [MainThread]: Response from registry: GET <https://hub.getdbt.com/api/v1/dbt-labs/dbt_utils.json> 200
13:16:58.310794 [debug] [MainThread]: Making package registry request: GET <https://hub.getdbt.com/api/v1/elementary-data/elementary.json>
13:16:58.331236 [debug] [MainThread]: Response from registry: GET <https://hub.getdbt.com/api/v1/elementary-data/elementary.json> 200
13:16:58.353432 [info ] [MainThread]: Updating lock file in file path: /usr/app/package-lock.yml
13:16:58.356664 [debug] [MainThread]: Set downloads directory='/tmp/dbt-downloads-gyuwykyy'
13:16:58.367044 [info ] [MainThread]: Installing dbt-labs/codegen
13:16:58.588969 [info ] [MainThread]: Installed from version 0.10.0
13:16:58.589407 [info ] [MainThread]: Updated version available: 0.12.1
13:16:58.589915 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'package', 'label': '5d6da427-e474-4bdf-aec6-88ab8a80eeb8', 'property_': 'install', 'context': [<snowplow_tracker.sel
f_describing_json.SelfDescribingJson object at 0x7fb30bfa2210>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb30bc23c90>]}
13:16:58.590374 [info ] [MainThread]: Installing dbt-labs/dbt_utils
13:16:58.906988 [info ] [MainThread]: Installed from version 1.1.1
13:16:58.907440 [info ] [MainThread]: Up to date!
13:16:58.907863 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'package', 'label': '5d6da427-e474-4bdf-aec6-88ab8a80eeb8', 'property_': 'install', 'context': [<snowplow_tracker.sel
f_describing_json.SelfDescribingJson object at 0x7fb30b9cfdd0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb30b97eed0>]}
13:16:58.908268 [info ] [MainThread]: Installing elementary-data/elementary
13:16:59.256451 [info ] [MainThread]: Installed from version 0.13.0
13:16:59.256913 [info ] [MainThread]: Updated version available: 0.13.1
13:16:59.257292 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'package', 'label': '5d6da427-e474-4bdf-aec6-88ab8a80eeb8', 'property_': 'install', 'context': [<snowplow_tracker.sel
f_describing_json.SelfDescribingJson object at 0x7fb30b85e850>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb30bf10f10>]}
13:16:59.261072 [info ] [MainThread]:
13:16:59.261430 [info ] [MainThread]: Updates available for packages: ['dbt-labs/codegen', 'elementary-data/elementary']
Update your versions in packages.yml, then run dbt deps
13:16:59.262676 [debug] [MainThread]: Resource report: {"command_name": "deps", "command_success": true, "command_wall_clock_time": 1.1954536, "process_user_time": 2.285536, "process_kernel_time": 0.3
58124, "process_mem_max_rss": "107228", "process_in_blocks": "1120", "process_out_blocks": "8104"}
13:16:59.263206 [debug] [MainThread]: Command `dbt deps` succeeded at 13:16:59.263079 after 1.20 seconds
13:16:59.263545 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb30
b97f310>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb30b98aad0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fb30bc72310>]}
13:16:59.263922 [debug] [MainThread]: Flushing usage eventsElla Katz
01/02/2024, 3:49 PMdbt run --select elementary --vars '{"elementary_full_refresh": "true"} does it work until the docker is rebuilt or simply when a day goes by, without any change?
Also, based on another thread I found, can you try running without the days_back parameter?Christophe Oudar
01/02/2024, 4:02 PMdbt run --target=prod -s elementary to update the model.
⢠I've another docker dedicated to run edr which is just installing elementary CLI. Then I mount my dbt project too in that docker.
I don't rebuild the docker, every time, I'm just rebuilding them when I update my dbt project (and I just rebuild the downstream image, not the base image with dbt or elementary installation).
After you runIt's working for a day or more (see screenshot, I ran the full refresh on the 15th). There was no change on the docker between the time it failed (no update between 15th & 19th but failed on the 18). Sure, I can try without the day_back params šdoes it work until the docker is rebuilt or simply when a day goes by, without any change?dbt run --select elementary --vars '{"elementary_full_refresh": "true"}
Christophe Oudar
01/02/2024, 4:20 PMedr send-report --env prod --s3-bucket-name <my_bucket>Ofek Weiss
01/08/2024, 9:09 AM--executions-limit flag to 100?Christophe Oudar
01/08/2024, 9:10 AMChristophe Oudar
01/08/2024, 4:26 PM[job-launch] 14:30:34.246 INFO [io-compute-blocker-0] jobLogger - 2024-01-08T14:30:28.222Z 2024-01-08 14:30:28 ā INFO ā Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_models_runs", "macro_args": {"days_back": 7, "exclude_elementary": true}} --project-dir /usr/local/lib/python3.11/site-packages/elementary/monitor/dbt_project
[job-launch] 14:31:45.154 INFO [io-compute-blocker-0] jobLogger - 2024-01-08T14:31:34.346Z 2024-01-08 14:31:34 ā ERROR ā Could not generate the report - Error: Failed to run dbt command.
2024-01-08T14:31:34.346Z Please reach out to our community for help with this issue.
while some do:
[job-launch] 14:29:23.074 INFO [io-compute-blocker-0] jobLogger - 2024-01-08T14:29:11.308Z 2024-01-08 14:29:11 ā INFO ā Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_source_freshness_results", "macro_args": {"days_back": 7, "invocations_per_test": 100}} --project-dir /usr/local/lib/python3.11/site-packages/elementary/monitor/dbt_projectChristophe Oudar
01/17/2024, 3:41 PM--executions-limit set to 0 as well and it's also failing.
I guess the single solution I've in mind is to try to fork the project, put debug logs around the code I suspect to fail and see if I'm right to pinpoint to issue.Christophe Oudar
01/15/2025, 11:08 AM