Raúl Mansilla
10/20/2021, 11:43 AMRaúl Mansilla
10/20/2021, 11:43 AM[{'message': 'Foreign key violation.', 'locations': [{'line': 2, 'column': 5}], 'path': ['set_flow_run_states'], 'extensions': {'code': 'INTERNAL_SERVER_ERROR', 'exception': {'message': 'Foreign key violation.'}}}]
Raúl Mansilla
10/20/2021, 11:45 AMRaúl Mansilla
10/20/2021, 11:48 AMAnna Geller
set_flow_run_states
mutation was used. Do you happen to use this mutation yourself in a flow?Anna Geller
Anna Geller
Raúl Mansilla
10/20/2021, 2:04 PMRaúl Mansilla
10/20/2021, 2:04 PMRaúl Mansilla
10/20/2021, 2:05 PMRaúl Mansilla
10/20/2021, 2:06 PMRaúl Mansilla
10/20/2021, 2:07 PMprefect server start --use-volume --volume-path ~/.prefect/pg_data
Raúl Mansilla
10/20/2021, 2:17 PMRaúl Mansilla
10/20/2021, 2:17 PMForeign key violation.
GraphQL request:2:3
1 | mutation ($input: set_flow_run_states_input!) {
2 | set_flow_run_states(input: $input) {
| ^
3 | states {
Traceback (most recent call last):
File "/prefect-server/src/prefect_server/database/hasura.py", line 85, in execute
as_box=as_box,
File "/prefect-server/src/prefect_server/utilities/graphql.py", line 80, in execute
raise ValueError(result["errors"])
ValueError: [{'extensions': {'path': '$', 'code': 'constraint-violation'}, 'message': 'Foreign key violation. insert or update on table "flow_run" violates foreign key constraint "flow_run_agent_id_fkey"'}]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/graphql/execution/execute.py", line 628, in await_result
return await result
File "/prefect-server/src/prefect_server/graphql/extensions.py", line 52, in resolve
result = await result
File "/prefect-server/src/prefect_server/graphql/states.py", line 45, in resolve_set_flow_run_states
*[check_size_and_set_state(state_input) for state_input in input["states"]]
File "/prefect-server/src/prefect_server/graphql/states.py", line 39, in check_size_and_set_state
agent_id=agent_id,
File "/prefect-server/src/prefect_server/api/states.py", line 108, in set_flow_run_state
await api.runs.update_flow_run_agent(flow_run_id=flow_run_id, agent_id=agent_id)
File "/prefect-server/src/prefect_server/api/runs.py", line 410, in update_flow_run_agent
set={"agent_id": agent_id}
File "/prefect-server/src/prefect_server/database/orm.py", line 406, in update
run_mutation=run_mutation,
File "/prefect-server/src/prefect_server/database/hasura.py", line 391, in update
result = await self.execute_mutations_in_transaction(mutations=[graphql])
File "/prefect-server/src/prefect_server/database/hasura.py", line 165, in execute_mutations_in_transaction
as_box=as_box,
File "/prefect-server/src/prefect_server/database/hasura.py", line 91, in execute
raise ValueError("Foreign key violation.")
ValueError: Foreign key violation.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/graphql/execution/execute.py", line 674, in await_completed
return await completed
File "/usr/local/lib/python3.7/site-packages/graphql/execution/execute.py", line 659, in await_result
return_type, field_nodes, info, path, await result
File "/usr/local/lib/python3.7/site-packages/graphql/execution/execute.py", line 733, in complete_value
raise result
File "/usr/local/lib/python3.7/site-packages/graphql/execution/execute.py", line 628, in await_result
return await result
File "/prefect-server/src/prefect_server/graphql/extensions.py", line 52, in resolve
result = await result
File "/prefect-server/src/prefect_server/graphql/states.py", line 45, in resolve_set_flow_run_states
*[check_size_and_set_state(state_input) for state_input in input["states"]]
File "/prefect-server/src/prefect_server/graphql/states.py", line 39, in check_size_and_set_state
agent_id=agent_id,
File "/prefect-server/src/prefect_server/api/states.py", line 108, in set_flow_run_state
await api.runs.update_flow_run_agent(flow_run_id=flow_run_id, agent_id=agent_id)
File "/prefect-server/src/prefect_server/api/runs.py", line 410, in update_flow_run_agent
set={"agent_id": agent_id}
File "/prefect-server/src/prefect_server/database/orm.py", line 406, in update
run_mutation=run_mutation,
File "/prefect-server/src/prefect_server/database/hasura.py", line 391, in update
result = await self.execute_mutations_in_transaction(mutations=[graphql])
File "/prefect-server/src/prefect_server/database/hasura.py", line 165, in execute_mutations_in_transaction
as_box=as_box,
File "/prefect-server/src/prefect_server/database/hasura.py", line 91, in execute
raise ValueError("Foreign key violation.")
graphql.error.graphql_error.GraphQLError: Foreign key violation.
GraphQL request:2:3
1 | mutation ($input: set_flow_run_states_input!) {
2 | set_flow_run_states(input: $input) {
| ^
3 | states {
Raúl Mansilla
10/20/2021, 2:18 PMRaúl Mansilla
10/20/2021, 2:21 PMKevin Kho
Raúl Mansilla
10/20/2021, 2:32 PMKevin Kho
prefect server start
. Are they all healthy? I guess you can also try going to the interactive tab in the UI and query the hello route:
query {
hello
}
Raúl Mansilla
10/20/2021, 2:37 PMRaúl Mansilla
10/20/2021, 2:38 PMKevin Kho
Kevin Kho
flow_run_agent_id_fkey
is your constraint. Maybe a new agent will help?Raúl Mansilla
10/20/2021, 7:20 PMRaúl Mansilla
10/20/2021, 7:20 PMRaúl Mansilla
10/20/2021, 7:22 PMKevin Kho
Raúl Mansilla
10/20/2021, 8:28 PM