Miserlou / Zappa

Serverless Python
https://blog.zappa.io/
MIT License
11.89k stars 1.2k forks source link

botocore.errorfactory.ResourceNotFoundException: An error occurred (ResourceNotFoundException) when calling the GetFunction operation: Function not found #1656

Open starkdigitalmediaservices opened 5 years ago

starkdigitalmediaservices commented 5 years ago

While running the deploy Zappa we are facing issue for the resource not found.

Context

Traceback (most recent call last): File "/home/stark/machinetest/myenv/lib/python3.6/site-packages/zappa/cli.py", line 745, in deploy function_name=self.lambda_name) File "/home/stark/machinetest/myenv/lib/python3.6/site-packages/zappa/core.py", line 1237, in get_lambda_function FunctionName=function_name) File "/home/stark/machinetest/myenv/lib/python3.6/site-packages/botocore/client.py", line 320, in apicall return self.makeapi_call(operation_name, kwargs) File "/home/stark/machinetest/myenv/lib/python3.6/site-packages/botocore/client.py", line 623, in makeapi_call raise error_class(parsed_response, operation_name) botocore.errorfactory.ResourceNotFoundException: An error occurred (ResourceNotFoundException) when calling the GetFunction operation: Function not found: arn:aws:lambda:us-west-2:335794645470:function:myproject-dev During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/stark/machinetest/myenv/lib/python3.6/site-packages/zappa/cli.py", line 2710, in handle sys.exit(cli.handle()) File "/home/stark/machinetest/myenv/lib/python3.6/site-packages/zappa/cli.py", line 508, in handle self.dispatch_command(self.command, stage) File "/home/stark/machinetest/myenv/lib/python3.6/site-packages/zappa/cli.py", line 545, in dispatch_command self.deploy(self.vargs['zip']) File "/home/stark/machinetest/myenv/lib/python3.6/site-packages/zappa/cli.py", line 775, in deploy self.lambda_arn = self.zappa.create_lambda_function(kwargs) File "/home/stark/machinetest/myenv/lib/python3.6/site-packages/zappa/core.py", line 1045, in create_lambda_function self.get_credentials_arn() File "/home/stark/machinetest/myenv/lib/python3.6/site-packages/zappa/core.py", line 2251, in get_credentials_arn self.credentials_arn = role.arn File "/home/stark/machinetest/myenv/lib/python3.6/site-packages/boto3/resources/factory.py", line 339, in property_loader self.load() File "/home/stark/machinetest/myenv/lib/python3.6/site-packages/boto3/resources/factory.py", line 505, in do_action response = action(self, args, *kwargs) File "/home/stark/machinetest/myenv/lib/python3.6/site-packages/boto3/resources/action.py", line 83, in call response = getattr(parent.meta.client, operation_name)(params) File "/home/stark/machinetest/myenv/lib/python3.6/site-packages/botocore/client.py", line 320, in apicall return self.makeapi_call(operation_name, kwargs) File "/home/stark/machinetest/myenv/lib/python3.6/site-packages/botocore/client.py", line 623, in makeapi_call raise error_class(parsed_response, operation_name) botocore.errorfactory.NoSuchEntityException: An error occurred (NoSuchEntity) when calling the GetRole operation: The role with name MyLambdaRole cannot be found.

Expected Behavior

It should run properly

Actual Behavior

getting error

Possible Fix

No idea

Your Environment

micahasmith commented 5 years ago

https://stackoverflow.com/questions/53979180/getting-nosuchentity-error-on-zappa-deploy/53979181#53979181

nickbean01 commented 3 years ago

Is there a solution to this? @micahasmith 's solution doesn't solve my problem, because I need to use a predefined AWS role with more specific permissions than the general use case default permissions.

JacobDel commented 10 months ago

did you manage to fix this?

JacobDel commented 10 months ago

fixed this by deploying again. I guess it's a racing issue with the IAM roles?