Skip to content

CF stack creation runs for 30 minutes then ends with "Internal Failure"

0

Creating a stack results in a CREATE_IN_PROGRESS status for ~35 minutes then failure with the message:

This resource is in a CREATE_FAILED state. Internal Failure.

I don't see any other relevant logs or output in the various tabs to help provide more information about the issue (see screenshots). I'm using this project-cluster.json template file, with the values on lines 7, 11, 15, and 20 modified to match my project (see full template file at bottom).

Enter image description here

Enter image description here

{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Description": "This template creates a cluster on the MongoDB Atlas API, this will be billed to your Atlas account.",
  "Parameters": {
    "ProjectName": {
      "Type": "String",
      "Description": "project0"
    },
    "ClusterName": {
      "Type": "String",
      "Description": "cluster0"
    },
    "Profile": {
      "Type": "String",
      "Description": "bottrigger_cf_deploy_secret"
    },
    "OrgId": {
      "Type": "String",
      "Default": "",
      "Description": "Unique 24-hexadecimal digit string that identifies your organization"
    },
    "PitEnabled": {
      "Type": "String",
      "Default": "true"
    }
  },
  "Resources": {
    "Project": {
      "Type": "MongoDB::Atlas::Project",
      "Properties": {
        "Name": {
          "Ref": "ProjectName"
        },
        "OrgId": {
          "Ref": "OrgId"
        },
        "Profile": {
          "Ref": "Profile"
        }
      }
    },
    "AtlasCluster": {
      "Type": "MongoDB::Atlas::Cluster",
      "Properties": {
        "ProjectId": {
          "Fn::GetAtt": [
            "Project",
            "Id"
          ]
        },
        "Name": {
          "Ref": "ClusterName"
        },
        "Profile": {
          "Ref": "Profile"
        },
        "AdvancedSettings": {
          "DefaultReadConcern": "available",
          "DefaultWriteConcern": "1",
          "JavascriptEnabled": "true",
          "MinimumEnabledTLSProtocol": "TLS1_2",
          "NoTableScan": "false",
          "OplogSizeMB": "2000",
          "SampleSizeBIConnector": "110",
          "SampleRefreshIntervalBIConnector": "310"
        },
        "BackupEnabled": "true",
        "ClusterType": "REPLICASET",
        "Paused": "false",
        "PitEnabled": {
          "Ref": "PitEnabled"
        },
        "Tags": [
          {
            "Key": "env",
            "Value": "development"
          }
        ],
        "BiConnector": {
          "ReadPreference": "secondary",
          "Enabled": "false"
        },
        "ReplicationSpecs": [
          {
            "NumShards": "1",
            "AdvancedRegionConfigs": [
              {
                "AutoScaling": {
                  "DiskGB": {
                    "Enabled": "true"
                  },
                  "Compute": {
                    "Enabled": "false",
                    "ScaleDownEnabled": "false"
                  }
                },
                "AnalyticsSpecs": {
                  "EbsVolumeType": "STANDARD",
                  "InstanceSize": "M10",
                  "NodeCount": "3"
                },
                "ElectableSpecs": {
                  "EbsVolumeType": "STANDARD",
                  "InstanceSize": "M10",
                  "NodeCount": "3"
                },
                "ReadOnlySpecs": {
                  "EbsVolumeType": "STANDARD",
                  "InstanceSize": "M10",
                  "NodeCount": "3"
                },
                "Priority": "7",
                "RegionName": "US_EAST_1",
                "ProviderName": "AWS"
              }
            ]
          }
        ]
      }
    }
  },
  "Outputs": {
    "MongoDBAtlasConnectionStrings": {
      "Description": "Cluster connection strings",
      "Export": {
        "Name": {
          "Fn::Sub": "${AWS::StackName}-ConnectionStrings"
        }
      },
      "Value": {
        "Fn::GetAtt": [
          "AtlasCluster",
          "ConnectionStrings.Standard"
        ]
      }
    },
    "MongoDBAtlasClusterID": {
      "Description": "Cluster Id",
      "Export": {
        "Name": {
          "Fn::Sub": "${AWS::StackName}-ID"
        }
      },
      "Value": {
        "Fn::GetAtt": [
          "AtlasCluster",
          "Id"
        ]
      }
    }
  }
}
asked 8 months ago69 views
2 Answers
0

There could be few reasons for the issue.

  • Make sure the IAM role or user that is deploying the stack has the correct permissions to deploy MongoDB.
  • Make sure the Org ID has correct value
  • Check CloudTrail for the IAM role that is deploying the stack in case it has failures.
  • Make sure Atlas API keys are correct

Reference : https://www.mongodb.com/developer/products/atlas/deploy-mongodb-atlas-aws-cloudformation/

EXPERT
answered 8 months ago
-1

When encountering a CloudFormation stack creation failure with an "Internal Failure" message after running for about 30 minutes, there are several steps you can take to troubleshoot the issue:

  1. Check the CloudFormation Events tab: Look for more detailed error messages or status updates that might provide insight into what's causing the failure.

  2. Examine CloudTrail logs: These logs might contain more detailed information about the API calls made during the stack creation process, which could reveal the root cause of the failure.

  3. Verify your template: Use the AWS CloudFormation Linter (cfn-lint) to validate your template before deployment. This can help catch syntax errors or other issues that might not be immediately apparent.

  4. Check resource limits: Ensure you haven't reached any account or regional limits for the resources you're trying to create.

  5. Verify permissions: Make sure the IAM role or user executing the CloudFormation template has sufficient permissions to create all the specified resources.

  6. Investigate regional issues: Since you're using MongoDB Atlas resources, check if there are any known issues or limitations in the region you're deploying to.

  7. Review MongoDB Atlas specific settings: Ensure that the ProjectId, OrgId, and other MongoDB Atlas specific parameters are correct and that your Atlas account has the necessary permissions and capacity to create the specified resources.

  8. Use the CloudFormation console's "Detect root cause" feature: This can help identify the specific resource causing the failure.

  9. Consider breaking down the template: If possible, try deploying smaller parts of your template separately to isolate the problematic resource.

  10. Check for resource dependencies: Ensure that all necessary dependencies are properly defined in your template, especially for custom resources like MongoDB Atlas resources.

If these steps don't reveal the cause of the failure, you may need to contact AWS Support for further assistance, especially given the involvement of third-party resources (MongoDB Atlas) in your template.
Sources
Cloud Formation deployment failing due to "Internal Error" | AWS re:Post
Troubleshoot failure to create nested stack | AWS re:Post

answered 8 months ago
EXPERT
reviewed 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.