Skip to content

InvokeSync stage failing on fresh deployment #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vostokbike opened this issue Dec 11, 2017 · 5 comments
Closed

InvokeSync stage failing on fresh deployment #9

vostokbike opened this issue Dec 11, 2017 · 5 comments

Comments

@vostokbike
Copy link

It looks like syncing files to the bucket fails with the following error:

Action execution failed
The AWS Lambda function aws-git-backed-static-website-SyncLambdaFunction-1FVC60HABK1WL failed to return a result. Check the function to verify that it has permission to call the PutJobSuccessResult action and that it made a call to PutJobSuccessResult.

Can you please advice on how to go from here?

@ehammond
Copy link
Member

What is the output in CloudWatch Logs?

Please check for sensitive information before posting here.

@vostokbike
Copy link
Author

I apologize, github notifications got the better of me. If this is helpful in any way, CloudWatch log for the failing function:

START RequestId: a1fb898c-dfc4-11e7-bae0-957d71922749 Version: $LATEST
'UserParameters'
Traceback (most recent call last):
File "/var/task/index.py", line 63, in handler
user_parameters) = setup(event)
File "/var/task/index.py", line 38, in setup
user_parameters = config['UserParameters']
KeyError: 'UserParameters'
local variable 'source_dir' referenced before assignment: UnboundLocalError
Traceback (most recent call last):
File "/var/task/index.py", line 86, in handler
shutil.rmtree(source_dir)
UnboundLocalError: local variable 'source_dir' referenced before assignment

END RequestId: a1fb898c-dfc4-11e7-bae0-957d71922749
REPORT RequestId: a1fb898c-dfc4-11e7-bae0-957d71922749	Duration: 0.91 ms	Billed Duration: 100 ms Memory Size: 1536 MB	Max Memory Used: 34 MB	
START RequestId: a1fb898c-dfc4-11e7-bae0-957d71922749 Version: $LATEST
'UserParameters'
Traceback (most recent call last):
File "/var/task/index.py", line 63, in handler
user_parameters) = setup(event)
File "/var/task/index.py", line 38, in setup
user_parameters = config['UserParameters']
KeyError: 'UserParameters'
local variable 'source_dir' referenced before assignment: UnboundLocalError
Traceback (most recent call last):
File "/var/task/index.py", line 86, in handler
shutil.rmtree(source_dir)
UnboundLocalError: local variable 'source_dir' referenced before assignment

END RequestId: a1fb898c-dfc4-11e7-bae0-957d71922749
REPORT RequestId: a1fb898c-dfc4-11e7-bae0-957d71922749	Duration: 0.76 ms	Billed Duration: 100 ms Memory Size: 1536 MB	Max Memory Used: 34 MB	
START RequestId: a1fb898c-dfc4-11e7-bae0-957d71922749 Version: $LATEST
'UserParameters'
Traceback (most recent call last):
File "/var/task/index.py", line 63, in handler
user_parameters) = setup(event)
File "/var/task/index.py", line 38, in setup
user_parameters = config['UserParameters']
KeyError: 'UserParameters'
local variable 'source_dir' referenced before assignment: UnboundLocalError
Traceback (most recent call last):
File "/var/task/index.py", line 86, in handler
shutil.rmtree(source_dir)
UnboundLocalError: local variable 'source_dir' referenced before assignment

END RequestId: a1fb898c-dfc4-11e7-bae0-957d71922749
REPORT RequestId: a1fb898c-dfc4-11e7-bae0-957d71922749	Duration: 0.79 ms	Billed Duration: 100 ms Memory Size: 1536 MB	Max Memory Used: 34 MB

@ehammond
Copy link
Member

Please try updating your "SyncLambdaFunction" AWS Lambda function with the latest version of the code in s3://run.alestic.com/lambda/aws-lambda-git-backed-static-website.zip

You can do this in that function's AWS Lambda console page with "Code entry type" of "Upload a file from AWS S3" and set "S3 link URL" to "https://s3.amazonaws.com/run.alestic.com/lambda/aws-lambda-git-backed-static-website.zip". Other attributes of the AWS Lambda function can remain the same.

You can then push a change in your Git repository, or go to the AWS CodePipeline console and click [Release change] on your pipeline page to run the pipeline again.

@gurumark
Copy link

gurumark commented Feb 6, 2018

I followed your instructions but get the following error:

22:29:22
local variable 'source_dir' referenced before assignment: UnboundLocalError Traceback (most recent call last): File "/var/task/index.py", line 86, in handler shutil.rmtree(source_dir) UnboundLocalError: local variable 'source_dir' referenced before assignment
local variable 'source_dir' referenced before assignment: UnboundLocalError
Traceback (most recent call last):
File "/var/task/index.py", line 86, in handler
shutil.rmtree(source_dir)
UnboundLocalError: local variable 'source_dir' referenced before assignment

Would you be able to update your stack so we do not need to do manual changes to the stack since the function is managed by cloudformation?

@ehammond
Copy link
Member

I think I have the CloudFormation stack and AWS Lambda deployment ZIP file in sync everywhere now.

You can either start a new stack, referencing existing resources, or upload the SyncLambdaFunction as described above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants