Zappa icon indicating copy to clipboard operation
Zappa copied to clipboard

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

Open jneves opened this issue 4 years ago • 4 comments

Originally from: https://github.com/Miserlou/Zappa/issues/1656 by starkdigitalmediaservices

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

jneves avatar Feb 20 '21 12:02 jneves

facing the same issue did you find any fix?

sridhar562345 avatar Feb 28 '22 11:02 sridhar562345

Hi @sridhar562345 You can give your deployment user Lambda Create and Execute permission and see if it works. Also, this SO answer might help you Here

souravjamwal77 avatar Jun 10 '22 09:06 souravjamwal77

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

Hi there! Unfortunately, this Issue has not seen any activity for at least 90 days. If the Issue is still relevant to the latest version of Zappa, please comment within the next 10 days if you wish to keep it open. Otherwise, it will be automatically closed.

github-actions[bot] avatar Apr 03 '24 15:04 github-actions[bot]

Hi there! Unfortunately, this Issue was automatically closed as it had not seen any activity in at least 100 days. If the Issue is still relevant to the latest version of Zappa, please open a new Issue.

github-actions[bot] avatar Apr 13 '24 17:04 github-actions[bot]