https://prefect.io logo
j

John Ramirez

03/23/2020, 4:17 PM
On version 0.9.8 and received this error during testing:
Copy code
Unexpected error: AttributeError("'S3ResultHandler' object has no attribute '_client'")
any thoughts?
j

josh

03/23/2020, 5:18 PM
What are you testing for this to occur? The
_client
attribute was updated in this recent PR https://github.com/PrefectHQ/prefect/pull/2136 and I wonder if there’s a chance it’s being referenced before assignment
j

John Ramirez

03/23/2020, 5:22 PM
Im running an end-to-end test of a workflow but further review of the code I realize that the handler is not referenced in any of the task
j

josh

03/23/2020, 5:23 PM
🤔 so the issue is happening without initializing the handler at all?
j

John Ramirez

03/23/2020, 5:26 PM
I do initialize the result handler but I dont place the object in the task definition
j

josh

03/23/2020, 5:27 PM
Are you initializing it similar to this?
Copy code
In [21]: S3ResultHandler(bucket='my-bucket')
Out[21]: <ResultHandler: S3ResultHandler>

In [22]: r = _

In [23]: r.client
Out[23]: <botocore.client.S3 at 0x10cc10908>

In [24]: r._client
Out[24]: <botocore.client.S3 at 0x10cc10908>
j

John Ramirez

03/23/2020, 5:32 PM
Copy code
RESULT_HANDLER = S3ResultHandler(
    bucket='workflow-output',
    aws_credentials_secret='AWS_CREDS',
)
but then the object is not used anywhere in the workflow code
j

josh

03/23/2020, 5:34 PM
Does the error happen there when you initialize or when you run your flow?
j

John Ramirez

03/23/2020, 7:15 PM
run the flow
j

josh

03/23/2020, 7:29 PM
Weird I’m really not sure how that error would be raised if your flow does not use the S3ResultHandler anywhere
j

John Ramirez

03/23/2020, 8:07 PM
any suggestions for
0.9.8
? I have already moved back to
0.9.7
j

josh

03/23/2020, 8:20 PM
Oh so this works fine on
0.9.7
?
Do you happen to have a reproduceable example that encounters this?
j

John Ramirez

03/24/2020, 2:00 PM
Hey josh, I now see what is going on with this result_handler
I have two workflows: one with retries and the other without. The workflow with retries requires a result_handler at the Flow level. Now on version
0.9.8
and
0.9.7
I am getting the
Unexpected error: AttributeError("'S3ResultHandler' object has no attribute '_client'")
error
also seems to occur the first time for a mapping task
j

Jie Lou

03/26/2020, 6:19 PM
Hi @John Ramirez . I met the same error on 0.9.8 and wondering if you have figured it out. Our S3ResultHandler is also set on the flow level.