https://prefect.io logo
Title
g

Gopinath Jaganmohan

03/30/2021, 2:28 AM
Hi Team, I'm evaluating Prefect as data flow pipeline and started learning and trying out. My setup is Prefect Server, LocalAgent running inside a docker and creating task from jupyter Notebook and registering flow using S3 storage. I could all but when I run getting error "Failed to load and execute Flow's environment: AttributeError("'NoneType' object has no attribute 'setup'")"I know making some simple mistake, any help would be appreciated. Flow is simple hello world.
@task def say_hello(): logger = prefect.context.get("logger") logger.info("Hello, Cloud!") with Flow("hello-flow",storage=storage) as flow: say_hello() # Register the flow under the "tutorial" project clientP.register(flow,"learning")
n

nicholas

03/30/2021, 3:15 AM
Hi @Gopinath Jaganmohan - where is
clientP
coming from? From your code, it looks like you should be running
flow.register(project_name="learning")
g

Gopinath Jaganmohan

03/30/2021, 10:38 AM
Hi Nichola, Since my prefect server running remote, I couldn't find option to pass API url to flow, hence created client and used to register, registration works. here is my code for that.
clientP = client.Client(api_server="API URL") storage = S3(bucket="bucket",client_options={"aws_access_key_id" : "awsaccesskeyidXXX", "aws_secret_access_key" : "awssecretaccesskey"})