Open DVD-99 opened 1 year ago
Hey @DVD-99 👋 Would you mind adding the stack trace using a code block? It's a bit hard to read the log from the screenshot 😅
@AlessandroLollo here is the block
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/prefect/engine.py", line 1552, in orchestrate_task_run
result = await call.aresult()
File "/usr/local/lib/python3.8/site-packages/prefect/_internal/concurrency/calls.py", line 181, in aresult
return await asyncio.wrap_future(self.future)
File "/usr/local/lib/python3.8/site-packages/prefect/_internal/concurrency/calls.py", line 218, in _run_async
result = await coro
File "/usr/local/lib/python3.8/site-packages/prefect_soda_core/tasks.py", line 104, in soda_scan_execute
soda_logs = await shell_run_command.fn(command-command, return_all=True)
File "/usr/local/lib/python3.8/site-packages/prefect_shell/commands.py", line 114, in shell_run_command
raise RuntimeError(msg)
RuntimeError: Command failed with exit code 2:
Lock 140243394888224 released on /root/.cache/snowflake/ocsp_response_validation_cache.lock
20:54:08.536 | ERROR Task run 'soda_scan_execute-0' - Finished in state Failed('Task run encountered an exception: RuntimeError: Command failed with exit code 2:\nLock 140243394888224 released on /root/.cache/snowflake/ocsp_response_ validation_cache.lock\n\n')
20:54:08.538 | INFO Flow run 'steadfast-centipede' - Failed('Task run encountered an exception: RuntimeError: Command failed with exit code 2: \nLock 140243394888224 released on /root/.cache/snowflake/ocsp_response_validation_cache.1 ock\n\n')
20:54:08.594 | ERROR Flow run 'steadfast-centipede' - Finished in state Failed('1/1 states failed.')
Traceback (most recent call last):
File "/app/main.py", line 122, in <module>
run_soda_scan()
File "/usr/local/lib/python3.8/site-packages/prefect/flows.py", line 468, in ___call___
return enter_flow_run_engine_from_flow_call(
File "/usr/local/lib/python3.8/site-packages/prefect/engine.py", line 184, in enter_flow_run_engine_from_flow_call
retval = from_sync.wait_for_call_in_loop_thread(
File "/usr/local/lib/python3.8/site-packages/prefect/_internal/concurrency/api.py", line 137, in wait_for_call_in_loop_thread
return call.result()
File "/usr/local/lib/python3.8/site-packages/prefect/_internal/concurrency/calls.py", line 173, in result
return self.future.result(timeout=timeout)
File "/usr/local/lib/python3.8/concurrent/futures/_base.py", line 437, in result
return self.__get_result()
File "/usr/local/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
raise self._exception
File "/usr/local/lib/python3.8/site-packages/prefect/_internal/concurrency/calls.py", line 218, in _run_async
result = await coro
File "/usr/local/lib/python3.8/site-packages/prefect/client/utilities.py", line 40, in with_injected_client
return await fn(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/prefect/engine.py", line 258, in create_then_begin_flow_run
return await state.result(fetch=True)
File "/usr/local/lib/python3.8/site-packages/prefect/states.py", line 91, in _get_state_result
raise await get_state_exception (state)
File "/usr/local/lib/python3.8/site-packages/prefect/engine.py", line 1552, in orchestrate_task_run
result = await call.aresult()
File "/usr/local/lib/python3.8/site-packages/prefect/_internal/concurrency/calls.py", line 181, in aresult
return await asyncio.wrap_future(self.future)
File "/usr/local/lib/python3.8/site-packages/prefect/_internal/concurrency/calls.py", line 218, in _run_async
result = await coro
File "/usr/local/lib/python3.8/site-packages/prefect_soda_core/tasks.py", line 104, in soda_scan_execute soda_logs = await shell_run_command.fn(command=command, return_all=True)
File "/usr/local/lib/python3.8/site-packages/prefect_shell/commands.py", line 114, in shell_run_command
raise RuntimeError(msg)
RuntimeError: Command failed with exit code 2:
Lock 140243394888224 released on /root/.cache/snowflake/ocsp_response_validation_cache.lock
Hey @DVD-99 👋 Where you able to solve the issue? Otherwise, can you provide a reproducible example? Thanks!
@AlessandroLollo The above issue has been fixed with this PR https://github.com/sodadata/prefect-soda-core/pull/21 But there is this new error
Encountered exception during execution:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/prefect/engine.py", line 1730, in orchestrate_task_run
result = await call.aresult()
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 292, in aresult
return await asyncio.wrap_future(self.future)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 346, in _run_async
result = await coro
^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/prefect_soda_core/tasks.py", line 148, in soda_scan_execute
return soda_logs
^^^^^^^^^
UnboundLocalError: cannot access local variable 'soda_logs' where it is not associated with a value
Finished in state Failed("Task run encountered an exception UnboundLocalError: cannot access local variable 'soda_logs' where it is not associated with a value")
Hey @DVD-99 👋 Glad to know the lock error was resolved! Will take a look at this new one, should be quite simple to fix.
Hey @DVD-99 can you share a snippet to reproduce the error? Thanks!
I suspect the error happens because the soda scan
command fails but the raised exception does not start with Command failed with exit code 2:
and return_scan_file_content
is set to False
.
If any of the checks fail in the soda I'm getting the following error