Raúl Mansilla
05/25/2021, 4:38 PMFailed to retrieve task state with error: ClientError([{'message': 'Expected type UUID!, found ""; Could not parse UUID: ', 'locations': [{'line': 2, 'column': 5}], 'path': ['get_or_create_task_run_info'], 'extensions': {'code': 'INTERNAL_SERVER_ERROR', 'exception': {'message': 'Expected type UUID!, found ""; Could not parse UUID: '}}}])
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.8/site-packages/prefect/engine/cloud/task_runner.py", line 154, in initialize_run
task_run_info = self.client.get_task_run_info(
File "/home/ubuntu/.local/lib/python3.8/site-packages/prefect/client/client.py", line 1399, in get_task_run_info
result = self.graphql(mutation) # type: Any
File "/home/ubuntu/.local/lib/python3.8/site-packages/prefect/client/client.py", line 319, in graphql
raise ClientError(result["errors"])
prefect.utilities.exceptions.ClientError: [{'message': 'Expected type UUID!, found ""; Could not parse UUID: ', 'locations': [{'line': 2, 'column': 5}], 'path': ['get_or_create_task_run_info'], 'extensions': {'code': 'INTERNAL_SERVER_ERROR', 'exception': {'message': 'Expected type UUID!, found ""; Could not parse UUID: '}}}
This only happen when I try to run the flow: from prefect import task, Flow, Parameter
from prefect.executors import LocalExecutor
from prefect.run_configs import LocalRun
from prefect.storage import CodeCommit
@task()
def say_hello(name):
print("Hello, {}!".format(name))
with Flow("flow",run_config=LocalRun(),storage=CodeCommit(repo="prefect_flows", path="flows/hello_world.py", commit = "master"),executor=LocalExecutor()) as flow:
name = Parameter('name')
say_hello(name)
flow.run(name='world') # "Hello, world!"
flow.run(name='Marvin') # "Hello, Marvin!"
Does anyone has any clue?Kevin Kho
05/25/2021, 4:39 PMZanie
05/25/2021, 4:40 PMRaúl Mansilla
05/25/2021, 4:41 PMZanie
05/25/2021, 4:47 PMfrom prefect import task, Flow, Parameter
from prefect.executors import LocalExecutor
from prefect.run_configs import LocalRun
from prefect.storage import Local
@task()
def say_hello(name):
print("Hello, {}!".format(name))
with Flow(
"flow",
run_config=LocalRun(),
storage=Local(),
executor=LocalExecutor(),
) as flow:
name = Parameter("name")
say_hello(name)
if __name__ == "__main__":
flow.run(name="world") # "Hello, world!"
flow.run(name="Marvin") # "Hello, Marvin!"
python flow.py
runs the flow using flow.run(...)
prefect register -p ~/flow.py --project default
Raúl Mansilla
05/25/2021, 4:49 PMZanie
05/25/2021, 4:49 PMFlow
object; when we do this flow.run()
is called because you have it in the scriptif __name__ == "__main__":
check should protect against thatTrue
when called directly with python script.py
)Raúl Mansilla
05/25/2021, 4:52 PMZanie
05/25/2021, 4:52 PMRaúl Mansilla
05/25/2021, 4:55 PMZanie
05/25/2021, 4:59 PMstorage=Local()
you can define your CodeCommit storageRaúl Mansilla
05/25/2021, 4:59 PMZanie
05/25/2021, 5:01 PMflow.run()
out of your script entirely once you're using the backend to orchestrate your flow instead of running it locally; but if you leave it in you need that if ...
blockRaúl Mansilla
05/25/2021, 5:03 PMZanie
05/25/2021, 5:04 PMprefect register
• Commit your new flow to CodeCommit @ master
• Run your flow from the UIRaúl Mansilla
05/25/2021, 5:05 PMfrom prefect import task, Flow, Parameter
from prefect.executors import LocalExecutor
from prefect.run_configs import LocalRun
from prefect.storage import CodeCommit
@task()
def say_hello(_name_):
print("Hello, {}!".format(_name_))
with Flow("flow",_run_config_=LocalRun(),_storage_=CodeCommit(_repo_="prefect_flows", _path_="flows/hello_world.py", _commit_ = "master"),_executor_=LocalExecutor()) as flow:
name = Parameter('name')
say_hello(name)
if __name__ == "__main__":
flow.run(_name_='world') # "Hello, world!"
flow.run(_name_='Marvin') # "Hello, Marvin!"
prefect register --project raulTesting -p codecommit_test.py -n "flow" -l "aws_test" --force
import prefect
from prefect import Flow
from prefect.storage import CodeCommit
flow = Flow("flow")
flow.storage = CodeCommit(repo="prefect_flows", path="flows/hello_world.py", commit = "master")
flow.register(project_name='raulTesting', labels=["aws_test"])
Zanie
05/25/2021, 5:16 PMprefect register
command? You'll want to just choose one of those methodsFlow("flow")
object with no tasks; you'd want to import it from your flow file so from flows.hello_world import flow
Raúl Mansilla
05/25/2021, 5:17 PMZanie
05/25/2021, 5:24 PMRaúl Mansilla
05/25/2021, 5:25 PMZanie
05/25/2021, 5:25 PMRaúl Mansilla
05/25/2021, 5:36 PMZanie
05/25/2021, 5:38 PMRaúl Mansilla
05/25/2021, 5:41 PMfrom prefect import task, Flow, Parameter
from prefect.executors import LocalExecutor
from prefect.run_configs import LocalRun
from prefect.storage import CodeCommit
@task()
def say_hello(name):
print("Hello, {}!".format(name))
with Flow("flow",run_config=LocalRun(),storage=CodeCommit(repo="prefect_flows", path="flows/hello_world.py", commit = "master"),executor=LocalExecutor()) as flow:
name = Parameter('name')
say_hello(name)
if __name__ == "__main__":
flow.run(name='world') # "Hello, world!"
flow.run(name='Marvin') # "Hello, Marvin!"
from prefect import task, Flow, Parameter
from prefect.executors import LocalExecutor
from prefect.run_configs import LocalRun
from prefect.storage import CodeCommit
@task(log_stdout=True)
def say_hello(name):
print("Hello, {}!".format(name))
with Flow("flow",run_config=LocalRun(),storage=CodeCommit(repo="prefect_flows", path="flows/hello_world.py", commit = "master"),executor=LocalExecutor()) as flow:
name = Parameter('name')
say_hello(name)
if __name__ == "__main__":
flow.run(name='world') # "Hello, world!"
flow.run(name='Marvin') # "Hello, Marvin!"
Zanie
05/25/2021, 5:44 PMRaúl Mansilla
05/25/2021, 5:44 PMprefect register --project raulTesting -p codecommit_test.py -l "aws_test" --force
Zanie
05/25/2021, 5:47 PMRaúl Mansilla
05/25/2021, 6:06 PM