aws-samples / service-catalog-engine-for-terraform-os

Apache License 2.0
134 stars 41 forks source link

Deployment fails #44

Open vigneshwar221B opened 1 year ago

vigneshwar221B commented 1 year ago

When i run the sh file ./bin/bash/deploy-tre.sh -r us-east-1 it throws the following error:

Checking to see if this is a new installation or an update to an existingg installation. First-time installation. Deploying the Terraform reference engine stack with name: SAM-TRE Sending output of the sam deploy command to /tmp/tre-sam-deploy-command.out. This is done to check the results after the command has completed. This may take a while. Please be patient. Deployment failed. Check /tmp/tre-sam-deploy-command.out for details. Deactivating python virtual environment

This is what the output file has:

File with same data already exists at 322fa92a379103148b131c2cac7ae5c0, skipping upload File with same data already exists at 322fa92a379103148b131c2cac7ae5c0, skipping upload Uploading to 64d756f67a11719d2e7ef5a276ef3904 9171137 / 9171137 (100.00%) File with same data already exists at 662947db92e95e94024e76272345e84d, skipping upload File with same data already exists at 77e20ed5e5e3b51b6b1ff542eab4ce16, skipping upload Uploading to a2feb171d726f14c7731e597bd568457 11437128 / 11437128 (100.00%) File with same data already exists at a2feb171d726f14c7731e597bd568457, skipping upload File with same data already exists at a2feb171d726f14c7731e597bd568457, skipping upload File with same data already exists at a2feb171d726f14c7731e597bd568457, skipping upload File with same data already exists at a2feb171d726f14c7731e597bd568457, skipping upload File with same data already exists at a2feb171d726f14c7731e597bd568457, skipping upload File with same data already exists at a2feb171d726f14c7731e597bd568457, skipping upload File with same data already exists at a2feb171d726f14c7731e597bd568457, skipping upload

    Deploying with following values
    ===============================
    Stack name                   : SAM-TRE
    Region                       : us-east-1
    Confirm changeset            : False
    Disable rollback             : False
    Deployment s3 bucket         : terraform-engine-bootstrap-447646619765-us-east-1
    Capabilities                 : ["CAPABILITY_NAMED_IAM"]
    Parameter overrides          : {}
    Signing Profiles             : {}

Initiating deployment

    Uploading to 2edef6c6b4e6e588b17ff3d6237b05d0.template  59924 / 59924  (100.00%)

Error: Failed to create changeset for the stack: SAM-TRE, An error occurred (InternalFailure) when calling the CreateChangeSet operation (reached max retries: 4): Unknown

smaly-amazon commented 1 year ago

Hi,

Unfortunately getting InternalFailure from CloudFormation can be hard to diagnose.

It can be caused by a syntax error in the template. This would not be the case for your issue unless you modified the template or code that feeds parameters to CloudFormation. See here.

https://repost.aws/questions/QUdcKlxxGVSbSGNLn4PSCeyA/questions/QUdcKlxxGVSbSGNLn4PSCeyA/aws-sam-cloudformation-internal-failure-when-creating-a-changeset?

To help investigate, you might find a failed API call in cloudTrail. This article describes this for creating and updating stacks, but it is also useful for creating change sets.

https://repost.aws/knowledge-center/cloudformation-internal-failure-error

vigneshwar221B commented 1 year ago

Hi, I tried looking at the cloudtrail events but couldn't find anything useful

{ "eventVersion": "1.08", "userIdentity": { "type": "IAMUser", "principalId": "AIDAWQOORLB2W6WZLZXQO", "arn": "arn:aws:iam::447646619765:user/full-access", "accountId": "447646619765", "accessKeyId": "AKIAWQOORLB25FBFR3NZ", "userName": "full-access" }, "eventTime": "2023-05-23T06:55:33Z", "eventSource": "cloudformation.amazonaws.com", "eventName": "CreateChangeSet", "awsRegion": "us-east-1", "sourceIPAddress": "122.187.88.146", "userAgent": "Boto3/1.26.99 Python/3.8.13 Darwin/22.1.0 Botocore/1.29.109 aws-sam-cli/1.83.0/cf898c46-b743-4698-a04a-3d7dfb33d9a8", "errorCode": "InternalFailure", "errorMessage": "An unknown error occurred", "requestParameters": null, "responseElements": null, "requestID": "602705ef-1fed-4c76-ac92-a694377efddc", "eventID": "5347bc02-b306-49d2-8817-08540b60a7a3", "readOnly": false, "eventType": "AwsApiCall", "managementEvent": true, "recipientAccountId": "447646619765", "eventCategory": "Management", "tlsDetails": { "tlsVersion": "TLSv1.3", "cipherSuite": "TLS_AES_128_GCM_SHA256", "clientProvidedHostHeader": "cloudformation.us-east-1.amazonaws.com" } }

Same goes for looking at the outputs of CF stack. But anyhow when I deleted the stack manually and run the sh script again, it worked! I'm yet to find the cause for the initial failure but this issue is closed for me.