Sam Thomas
09/27/2021, 3:02 PMTask 'run_edit_connection_graph_flow[1]': Exception encountered during task execution!
Traceback (most recent call last):
File "ENV\lib\site-packages\prefect\engine\task_runner.py", line 859, in get_task_run_state
value = prefect.utilities.executors.run_task_with_timeout(
File "ENV\lib\site-packages\prefect\utilities\executors.py", line 454, in run_task_with_timeout
return task.run(*args, **kwargs) # type: ignore
File "MY_DRIVE\tasks.py", line 688, in run_X_flow
prefect.tasks.prefect.StartFlowRun(
File "ENV\lib\site-packages\prefect\utilities\tasks.py", line 445, in method
return run_method(self, *args, **kwargs)
File "ENV\lib\site-packages\prefect\tasks\prefect\flow_run.py", line 432, in run
create_link(urlparse(run_link).path)
File "ENV\lib\site-packages\prefect\artifacts.py", line 52, in create_link
return _create_task_run_artifact("link", {"link": link})
File "ENV\lib\site-packages\prefect\artifacts.py", line 28, in _create_task_run_artifact
return client.create_task_run_artifact(
File "ENV\lib\site-packages\prefect\client\client.py", line 2155, in create_task_run_artifact
result = self.graphql(
File "ENV\lib\site-packages\prefect\client\client.py", line 569, in graphql
raise ClientError(result["errors"])
prefect.exceptions.ClientError: [{'message': '[{\'extensions\': {\'path\': \'$.selectionSet.insert_task_run_artifact.args.objects\', \'code\': \'constraint-violation\'}, \'message\': \'Not-NULL violation. null value in column "tenant_id" violates not-null constraint\'}]', 'locations': [{'line': 2, 'column': 5}], 'path': ['create_task_run_artifact'], 'extensions': {'code': 'INTERNAL_SERVER_ERROR', 'exception': {'message': '[{\'extensions\': {\'path\': \'$.selectionSet.insert_task_run_artifact.args.objects\', \'code\': \'constraint-violation\'}, \'message\': \'Not-NULL violation. null value in column "tenant_id" violates not-null constraint\'}]'}}}]
Having issues after upgrading to 0.15.6 using StartFlowRun task.
Local executors pointing to a Prefect Server hosted on our infrastructure. The requested flow starts running however the flow that did the requesting fails when trying to create an artefact for the run it just started.
I'm surprised the issues is around tenants because my understanding was that they're Cloud things.
Any help gratefully recieved.Kevin Kho
Sam Thomas
09/27/2021, 3:08 PMKevin Kho
Kevin Kho
Sam Thomas
09/29/2021, 10:26 AMwith prefect.Flow("flow1") as flow:
# Code goes here with input parameters
flow.register(project_name="project")
@prefect.task
def format_inputs_and_run(par1, par2):
par1 = [str(i) for i in par1]
par2 = [str(i) for i in par2]
StartFlowRun(flow_name = "flow1",
project_name = "project",
wait = True,
parameters= {"par1": par1,
"par2": par2}).run()
with prefect.Flow("flow2") as flow:
# Code to get inputs
format_inputs_and_run(par1, par2)
I did this because I needed to format the inputs to the flow to be json serializable (in this case because I was using pathlib to find the paths I wanted but they need to be converted to strings to be passed to the server).
Interestingly this did actually work with prefect 0.14.22.
The better solution that now works is to properly use StartFlowRun as a task and have a separate task to format the data.