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
Zanie
Raúl Mansilla
05/25/2021, 4:41 PMZanie
from 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!"
Zanie
python flow.py
runs the flow using flow.run(...)
Zanie
prefect register -p ~/flow.py --project default
Zanie
Raúl Mansilla
05/25/2021, 4:49 PMRaúl Mansilla
05/25/2021, 4:49 PMZanie
Zanie
Flow
object; when we do this flow.run()
is called because you have it in the scriptZanie
Zanie
if __name__ == "__main__":
check should protect against thatZanie
True
when called directly with python script.py
)Raúl Mansilla
05/25/2021, 4:52 PMZanie
Raúl Mansilla
05/25/2021, 4:55 PMRaúl Mansilla
05/25/2021, 4:56 PMRaúl Mansilla
05/25/2021, 4:57 PMZanie
storage=Local()
you can define your CodeCommit storageRaúl Mansilla
05/25/2021, 4:59 PMRaúl Mansilla
05/25/2021, 5:00 PMRaúl Mansilla
05/25/2021, 5:00 PMZanie
flow.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
prefect register
• Commit your new flow to CodeCommit @ master
• Run your flow from the UIRaúl Mansilla
05/25/2021, 5:05 PMRaúl Mansilla
05/25/2021, 5:06 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!"
Raúl Mansilla
05/25/2021, 5:06 PMRaúl Mansilla
05/25/2021, 5:07 PMprefect register --project raulTesting -p codecommit_test.py -n "flow" -l "aws_test" --force
Raúl Mansilla
05/25/2021, 5:07 PMimport 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
prefect register
command? You'll want to just choose one of those methodsZanie
Flow("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 PMRaúl Mansilla
05/25/2021, 5:17 PMRaúl Mansilla
05/25/2021, 5:22 PMRaúl Mansilla
05/25/2021, 5:23 PMZanie
Zanie
Zanie
Raúl Mansilla
05/25/2021, 5:25 PMZanie
Zanie
Zanie
Raúl Mansilla
05/25/2021, 5:36 PMRaúl Mansilla
05/25/2021, 5:38 PMZanie
Zanie
Zanie
Raúl Mansilla
05/25/2021, 5:41 PMRaúl Mansilla
05/25/2021, 5:42 PMRaúl Mansilla
05/25/2021, 5:42 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!"
Raúl Mansilla
05/25/2021, 5:43 PMfrom 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
Raúl Mansilla
05/25/2021, 5:44 PMprefect register --project raulTesting -p codecommit_test.py -l "aws_test" --force
Raúl Mansilla
05/25/2021, 5:45 PMRaúl Mansilla
05/25/2021, 5:46 PMRaúl Mansilla
05/25/2021, 5:46 PMZanie
Zanie
Raúl Mansilla
05/25/2021, 6:06 PM