Sora Miyazawa
02/20/2025, 8:04 AMelementary/run-elementary-action@v1.12 has not worked. The error logs are the same as those in this Slack message.
According to these discussion:
β’ https://elementary-community.slack.com/archives/C02CTC89LAX/p1739871985619689?thread_ts=1739809646.764679&cid=C02CTC89LAX
β’ https://elementary-community.slack.com/archives/C02CTC89LAX/p1739887066039249?thread_ts=1739809646.764679&cid=C02CTC89LAX
I have identified the cause of this problem; we should use Elementary's dbt package v0.16.4 when we use edr v0.16.2 ( or use edr v0.16.1 when we use dbt package v0.16.0 )
However, in our Github Actions, edr v0.16.2 is automatically installed (because, as shown the image v0.16.2 is the latest version and run-elementary-action doesn't seem to have any option about edr version). Since we cannot change the edr version from v0.16.2, we are trying to change the version of the Elementary dbt package to v0.16.4 used during the execution of run-elementary-action, but we don't know how to do it. Changing packages.yml in our repository has not workedπ’
Could anyone support us with this?Sora Miyazawa
02/20/2025, 8:30 AMElementary dbt package to v0.16.4, the error has still occurred
2025-02-20 08:24:36 β INFO β Running dbt command --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_snapshots", "macro_args": {}} --project-dir /usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_project
{"data": **deleted as confident **}
{"data": {"exc": "Database Error\n Unrecognized name: unique_key; Did you mean unique_id? at [24:19]"}, "info": {"category": "", "code": "Q001", "extra": {}, "invocation_id": "5e6a96b9-b6ff-4613-bf5a-a7af8356e30d", "level": "error", "msg": "Encountered an error while running operation: Database Error\n Unrecognized name: unique_key; Did you mean unique_id? at [24:19]", "name": "RunningOperationCaughtError", "pid": 115, "thread": "MainThread", "ts": "2025-02-20T08:24:37.892908Z"}}
2025-02-20 08:24:38 β ERROR β Could not generate the report - Error: Failed to run dbt command.
{"info": {"name": "RunningOperationCaughtError", "code": "Q001", "msg": "Encountered an error while running operation: Database Error\n Unrecognized name: unique_key; Did you mean unique_id? at [24:19]", "level": "error", "invocationId": "5e6a96b9-b6ff-4613-bf5a-a7af8356e30d", "pid": 115, "thread": "MainThread", "ts": "2025-02-20T08:24:37.892908Z"}, "data": {"exc": "Database Error\n Unrecognized name: unique_key; Did you mean unique_id? at [24:19]"}}
Please reach out to our community for help with this issue.
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/elementary/monitor/api/report/report.py", line 103, in get_report_data
snapshots = models_api.get_snapshots()
File "/usr/local/lib/python3.9/site-packages/elementary/monitor/api/models/models.py", line 140, in get_snapshots
snapshot_results = self.models_fetcher.get_snapshots()
File "/usr/local/lib/python3.9/site-packages/elementary/monitor/fetchers/models/models.py", line 48, in get_snapshots
run_operation_response = self.dbt_runner.run_operation(
File "/usr/local/lib/python3.9/site-packages/elementary/clients/dbt/command_line_dbt_runner.py", line 177, in run_operation
result = self._run_command(
File "/usr/local/lib/python3.9/site-packages/elementary/clients/dbt/command_line_dbt_runner.py", line 114, in _run_command
result = self._inner_run_command(
File "/usr/local/lib/python3.9/site-packages/elementary/clients/dbt/api_dbt_runner.py", line 54, in _inner_run_command
raise DbtCommandError(
elementary.exceptions.exceptions.DbtCommandError: Failed to run dbt command.
{"info": {"name": "RunningOperationCaughtError", "code": "Q001", "msg": "Encountered an error while running operation: Database Error\n Unrecognized name: unique_key; Did you mean unique_id? at [24:19]", "level": "error", "invocationId": "5e6a96b9-b6ff-4613-bf5a-a7af8356e30d", "pid": 115, "thread": "MainThread", "ts": "2025-02-20T08:24:37.892908Z"}, "data": {"exc": "Database Error\n Unrecognized name: unique_key; Did you mean unique_id? at [24:19]"}}
2025-02-20 08:24:39,041 Failed to run the edr command.
Traceback (most recent call last):
File "/entrypoint.py", line 151, in main
run_edr(args.edr_command, args.project_dir)
File "/entrypoint.py", line 115, in run_edr
subprocess.run(edr_command, shell=True, check=True, cwd=project_dir)
File "/usr/local/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'edr monitor --slack-token "***" --slack-channel-name "***" && edr report --file-path "report.html" && edr send-report --slack-token "***" --slack-channel-name "***"' returned non-zero exit status 1.
Traceback (most recent call last):
File "/entrypoint.py", line 158, in <module>
main()
File "/entrypoint.py", line 151, in main
run_edr(args.edr_command, args.project_dir)
File "/entrypoint.py", line 115, in run_edr
subprocess.run(edr_command, shell=True, check=True, cwd=project_dir)
File "/usr/local/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'edr monitor --slack-token "***" --slack-channel-name "***" && edr report --file-path "report.html" && edr send-report --slack-token "***" --slack-channel-name "***"' returned non-zero exit status 1.Guilherme Petris
02/20/2025, 10:07 AMNoya Offer
02/20/2025, 2:15 PMpackages.yml and running dbt deps?Guilherme Petris
02/21/2025, 11:01 AM0.16.4
2025-02-21 11:00:03 β ERROR β Could not generate the report - Error: Failed to run dbt command.
{"info": {"name": "RunningOperationCaughtError", "code": "Q001", "msg": "Encountered an error while running operation: Database Error\n 000904 (42000): SQL compilation error: error line 21 at position 18\n invalid identifier 'UNIQUE_KEY'", "level": "error", "invocationId": "8a5bb49f-8ea5-4756-aa5f-7817141fad92", "pid": 87, "thread": "MainThread", "ts": "2025-02-21T11:00:02.869192Z"}, "data": {"exc": "Database Error\n 000904 (42000): SQL compilation error: error line 21 at position 18\n invalid identifier 'UNIQUE_KEY'"}}
Please reach out to our community for help with this issue.
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/elementary/monitor/api/report/report.py", line 103, in get_report_data
snapshots = models_api.get_snapshots()
File "/usr/local/lib/python3.9/site-packages/elementary/monitor/api/models/models.py", line 140, in get_snapshots
snapshot_results = self.models_fetcher.get_snapshots()
File "/usr/local/lib/python3.9/site-packages/elementary/monitor/fetchers/models/models.py", line 48, in get_snapshots
run_operation_response = self.dbt_runner.run_operation(
File "/usr/local/lib/python3.9/site-packages/elementary/clients/dbt/command_line_dbt_runner.py", line 177, in run_operation
result = self._run_command(
File "/usr/local/lib/python3.9/site-packages/elementary/clients/dbt/command_line_dbt_runner.py", line 114, in _run_command
result = self._inner_run_command(
File "/usr/local/lib/python3.9/site-packages/elementary/clients/dbt/api_dbt_runner.py", line 54, in _inner_run_command
raise DbtCommandError(
elementary.exceptions.exceptions.DbtCommandError: Failed to run dbt command.
{"info": {"name": "RunningOperationCaughtError", "code": "Q001", "msg": "Encountered an error while running operation: Database Error\n 000904 (42000): SQL compilation error: error line 21 at position 18\n invalid identifier 'UNIQUE_KEY'", "level": "error", "invocationId": "8a5bb49f-8ea5-4756-aa5f-7817141fad92", "pid": 87, "thread": "MainThread", "ts": "2025-02-21T11:00:02.869192Z"}, "data": {"exc": "Database Error\n 000904 (42000): SQL compilation error: error line 21 at position 18\n invalid identifier 'UNIQUE_KEY'"}}
ERROR:elementary.monitor.data_monitoring.report.data_monitoring_report:Could not generate the report - Error: Failed to run dbt command.
{"info": {"name": "RunningOperationCaughtError", "code": "Q001", "msg": "Encountered an error while running operation: Database Error\n 000904 (42000): SQL compilation error: error line 21 at position 18\n invalid identifier 'UNIQUE_KEY'", "level": "error", "invocationId": "8a5bb49f-8ea5-4756-aa5f-7817141fad92", "pid": 87, "thread": "MainThread", "ts": "2025-02-21T11:00:02.869192Z"}, "data": {"exc": "Database Error\n 000904 (42000): SQL compilation error: error line 21 at position 18\n invalid identifier 'UNIQUE_KEY'"}}
Please reach out to our community for help with this issue.
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/elementary/monitor/api/report/report.py", line 103, in get_report_data
snapshots = models_api.get_snapshots()
File "/usr/local/lib/python3.9/site-packages/elementary/monitor/api/models/models.py", line 140, in get_snapshots
snapshot_results = self.models_fetcher.get_snapshots()
File "/usr/local/lib/python3.9/site-packages/elementary/monitor/fetchers/models/models.py", line 48, in get_snapshots
run_operation_response = self.dbt_runner.run_operation(
File "/usr/local/lib/python3.9/site-packages/elementary/clients/dbt/command_line_dbt_runner.py", line 177, in run_operation
result = self._run_command(
File "/usr/local/lib/python3.9/site-packages/elementary/clients/dbt/command_line_dbt_runner.py", line 114, in _run_command
result = self._inner_run_command(
File "/usr/local/lib/python3.9/site-packages/elementary/clients/dbt/api_dbt_runner.py", line 54, in _inner_run_command
raise DbtCommandError(
elementary.exceptions.exceptions.DbtCommandError: Failed to run dbt command.
{"info": {"name": "RunningOperationCaughtError", "code": "Q001", "msg": "Encountered an error while running operation: Database Error\n 000904 (42000): SQL compilation error: error line 21 at position 18\n invalid identifier 'UNIQUE_KEY'", "level": "error", "invocationId": "8a5bb49f-8ea5-4756-aa5f-7817141fad92", "pid": 87, "thread": "MainThread", "ts": "2025-02-21T11:00:02.869192Z"}, "data": {"exc": "Database Error\n 000904 (42000): SQL compilation error: error line 21 at position 18\n invalid identifier 'UNIQUE_KEY'"}}
2025-02-21 11:00:04,020 Failed to run the edr command.
Traceback (most recent call last):
File "/entrypoint.py", line 151, in main
run_edr(args.edr_command, args.project_dir)
File "/entrypoint.py", line 115, in run_edr
subprocess.run(edr_command, shell=True, check=True, cwd=project_dir)
File "/usr/local/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'edr monitor send-report --slack-token *** --slack-channel-name ***
' returned non-zero exit status 1.
Traceback (most recent call last):
File "/entrypoint.py", line 158, in <module>
main()
File "/entrypoint.py", line 151, in main
run_edr(args.edr_command, args.project_dir)
File "/entrypoint.py", line 115, in run_edr
subprocess.run(edr_command, shell=True, check=True, cwd=project_dir)
File "/usr/local/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'edr monitor send-report --slack-token *** --slack-channel-name ***
' returned non-zero exit status 1.Noya Offer
02/23/2025, 9:37 AMdbt run --select elementary to rebuild Elementary models after the version update πSora Miyazawa
02/26/2025, 2:23 AMdbt run without --select elementary option.
Is it possible that if I don't specify it with -select elementary it won't build properly?Noya Offer
02/26/2025, 8:31 AMdbt run --select elementary to rebuild the tables π