aws-cloudformation / cloudformation-cli

The CloudFormation Provider Development Toolkit allows you to author your own resource providers and modules that can be used by CloudFormation.
Apache License 2.0
318 stars 161 forks source link

Custom resource registration failing #1013

Open justin-masse opened 1 year ago

justin-masse commented 1 year ago

It is successfully submitting the type but upon registration it appears to be failing in our new AWS accounts. This is using a node14 runtime. It is getting some weird error on registration with no information. Just goes into deploy_status of failed. Have tried this multiple times with no luck but have had other types that are using this same pattern succeed.

`2023-07-17 09:01:34,111 | Build inside container returned response {"jsonrpc": "2.0", "id": 1, "result": {"artifacts_dir": "/tmp/samcli/artifacts"}} 2023-07-17 09:01:34,113 | Build inside container was successful. Copying artifacts from container to host 2023-07-17 09:01:34,428 | Copying from container: /tmp/samcli/artifacts/. -> /Users 2023-07-17 09:01:37,717 | Build inside container succeeded 2023-07-17 09:01:37,719 | There is no customer defined id or cdk path defined for resource TestEntrypoint, so we will use the resource logical id as the resource id 2023-07-17 09:01:37,719 | There is no customer defined id or cdk path defined for resource TypeFunction, so we will use the resource logical id as the resource id 2023-07-17 09:01:37,720 | 2 resources found in the stack 2023-07-17 09:01:37,720 | Found Serverless function with name='TestEntrypoint' and CodeUri='./' 2023-07-17 09:01:37,720 | Found Serverless function with name='TypeFunction' and CodeUri='./' 2023-07-17 09:01:37,726 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics 2023-07-17 09:01:37,891 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics 2023-07-17 09:01:37,891 | Unable to find Click Context for getting session_id. 2023-07-17 09:01:38,215 | Telemetry response: 200 2023-07-17 09:01:38,220 | Telemetry response: 200

[2023-07-17T14:01:38Z] DEBUG - Dependencies build finished [2023-07-17T14:01:40Z] DEBUG - Package complete [2023-07-17T14:01:40Z] DEBUG - Version info is not available for plugins, not writing to metadata file [2023-07-17T14:01:40Z] DEBUG - overrides.json not found. Not writing to package. [2023-07-17T14:01:40Z] DEBUG - Packaging complete, uploading... [2023-07-17T14:01:40Z] DEBUG - Uploading to region 'us-east-1' [2023-07-17T14:01:40Z] DEBUG - Creating execution role for provider to use [2023-07-17T14:01:40Z] INFO - Creating extend-confluent-acl-role-stack [2023-07-17T14:01:41Z] INFO - extend-confluent-acl-role-stack already exists. Attempting to update [2023-07-17T14:01:41Z] INFO - extend-confluent-acl-role-stack stack is up to date [2023-07-17T14:01:41Z] INFO - Creating CloudFormationManagedUploadInfrastructure [2023-07-17T14:01:41Z] INFO - CloudFormationManagedUploadInfrastructure already exists. Attempting to update [2023-07-17T14:01:42Z] INFO - CloudFormationManagedUploadInfrastructure stack is up to date [2023-07-17T14:01:42Z] DEBUG - Uploading to 'cloudformationmanageduploadinfrast-artifactbucket'... [2023-07-17T14:02:24Z] DEBUG - Upload complete [2023-07-17T14:02:24Z] DEBUG - Got S3 URL: s3://cloudformationmanageduploadinfrast-artifactbucket [2023-07-17T14:02:24Z] WARNING - Successfully submitted type. Waiting for registration with token '2b...' to complete. [2023-07-17T14:03:25Z] WARNING - Failed to register the type with registration token '2b....' [2023-07-17T14:03:25Z] WARNING - Please see response for additional information: '{'ProgressStatus': 'FAILED', 'Description': 'Deployment is currently in DEPLOY_STAGE of status FAILED\nDeployment failed with error. Error message: [2b...] Internal Failure', 'TypeArn': 'arn:aws:cloudformation:us-east-1::type/resource/MY-ACL', 'TypeVersionArn': 'arn:aws:cloudformation:us-east-1::type/resource/MY-ACL/00000001', 'ResponseMetadata': {'RequestId': '3ab...', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '3ab..., 'date': 'Mon, 17 Jul 2023 14:03:25 GMT', 'content-type': 'text/xml', 'content-length': '773', 'connection': 'keep-alive'}, 'RetryAttempts': 0}}' [2023-07-17T14:03:25Z] DEBUG - Caught downstream error Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/rpdk/core/project.py", line 1130, in _wait_for_registration registration_waiter.wait(RegistrationToken=registration_token) File "/usr/local/lib/python3.11/site-packages/botocore/waiter.py", line 55, in wait Waiter.wait(self, **kwargs) File "/usr/local/lib/python3.11/site-packages/botocore/waiter.py", line 375, in wait raise WaiterError( botocore.exceptions.WaiterError: Waiter TypeRegistrationComplete failed: Waiter encountered a terminal failure state: For expression "ProgressStatus" we matched expected path: "FAILED"

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/rpdk/core/cli.py", line 100, in main args.command(args) File "/usr/local/lib/python3.11/site-packages/rpdk/core/submit.py", line 19, in submit project.submit( File "/usr/local/lib/python3.11/site-packages/rpdk/core/project.py", line 659, in submit self._upload( File "/usr/local/lib/python3.11/site-packages/rpdk/core/project.py", line 1117, in _upload self._wait_for_registration( File "/usr/local/lib/python3.11/site-packages/rpdk/core/project.py", line 1151, in _wait_for_registration raise DownstreamError("Type registration error") from e rpdk.core.exceptions.DownstreamError: Type registration error `

simi-obs commented 1 year ago

I am having the same issue with some resource types, that previously worked, but do not work anymore.

With some other resource types there is no such problem.

I have no idea what the issue is. Did you figure out what the problem was @justin-masse ?