Zappa icon indicating copy to clipboard operation
Zappa copied to clipboard

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

Open starkdigitalmediaservices opened this issue 7 years ago • 4 comments

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

  • Zappa version used: 0.47.0
  • Operating System and Python version: Ubuntu - 3.6

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

micahasmith avatar Dec 30 '18 16:12 micahasmith

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.

nickbean01 avatar Jan 25 '21 18:01 nickbean01

did you manage to fix this?

JacobDel avatar Nov 18 '23 23:11 JacobDel

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

JacobDel avatar Nov 18 '23 23:11 JacobDel