Skip to content

Commit a52f0a0

Browse files
committed
Update cloudformation errors
1 parent e4c7473 commit a52f0a0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

cli/cmd/cluster.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ var _upCmd = &cobra.Command{
128128
clusterState, err := clusterstate.GetClusterState(awsClient, &accessConfig)
129129
if err != nil {
130130
if errors.GetKind(err) == clusterstate.ErrUnexpectedCloudFormationStatus {
131-
fmt.Println(fmt.Sprintf("cluster named \"%s\" in %s is in an unexpected state; please run `cortex cluster down` to delete the cluster, or delete the cloudformation stacks manually in your AWS console (%s)", clusterConfig.ClusterName, *clusterConfig.Region, getCloudFormationURL(*clusterConfig.Region, clusterConfig.ClusterName)))
131+
fmt.Println(fmt.Sprintf("cluster named \"%s\" in %s is in an unexpected state; please run `cortex cluster down` to delete the cluster, or delete the CloudFormation stacks directly from your AWS console (%s)", clusterConfig.ClusterName, *clusterConfig.Region, getCloudFormationURL(*clusterConfig.Region, clusterConfig.ClusterName)))
132132
}
133133
exit.Error(err)
134134
}
@@ -168,7 +168,7 @@ var _upCmd = &cobra.Command{
168168
if exitCode == nil || *exitCode != 0 {
169169
helpStr := "\nDebugging tips (may or may not apply to this error):"
170170
helpStr += fmt.Sprintf("\n* if your cluster started spinning up but was unable to provision instances, additional error information may be found in the activity history of your cluster's autoscaling groups (select each autoscaling group and click the \"Activity History\" tab): https://console.aws.amazon.com/ec2/autoscaling/home?region=%s#AutoScalingGroups:", *clusterConfig.Region)
171-
helpStr += fmt.Sprintf("\n* if your cluster started spinning up, please ensure that your CloudFormation stacks for this cluster have been fully deleted before trying to spin up this cluster again: https://console.aws.amazon.com/cloudformation/home?region=%s#/stacks?filteringText=-%s-", *clusterConfig.Region, clusterConfig.ClusterName)
171+
helpStr += fmt.Sprintf("\n* if your cluster started spinning up, please ensure that your CloudFormation stacks for this cluster have been fully deleted before trying to spin up this cluster again (you can delete your CloudFormation stacks from the AWS console: %s)", getCloudFormationURL(clusterConfig.ClusterName, *clusterConfig.Region))
172172
fmt.Println(helpStr)
173173
exit.Error(ErrorClusterUp(out + helpStr))
174174
}
@@ -210,7 +210,7 @@ var _configureCmd = &cobra.Command{
210210
clusterState, err := clusterstate.GetClusterState(awsClient, accessConfig)
211211
if err != nil {
212212
if errors.GetKind(err) == clusterstate.ErrUnexpectedCloudFormationStatus {
213-
fmt.Println(fmt.Sprintf("cluster named \"%s\" in %s is in an unexpected state; please run `cortex cluster down` to delete the cluster, or delete the cloudformation stacks manually in your AWS console (%s)", *accessConfig.ClusterName, *accessConfig.Region, getCloudFormationURLWithAccessConfig(accessConfig)))
213+
fmt.Println(fmt.Sprintf("cluster named \"%s\" in %s is in an unexpected state; please run `cortex cluster down` to delete the cluster, or delete the CloudFormation stacks directly from your AWS console (%s)", *accessConfig.ClusterName, *accessConfig.Region, getCloudFormationURLWithAccessConfig(accessConfig)))
214214
}
215215
exit.Error(err)
216216
}
@@ -303,7 +303,7 @@ var _downCmd = &cobra.Command{
303303
clusterState, err := clusterstate.GetClusterState(awsClient, accessConfig)
304304
if err != nil {
305305
if errors.GetKind(err) == clusterstate.ErrUnexpectedCloudFormationStatus {
306-
fmt.Println(fmt.Sprintf("cluster named \"%s\" in %s is in an unexpected state; please delete the cloudformation stacks manually in your AWS console (%s)", *accessConfig.ClusterName, *accessConfig.Region, getCloudFormationURLWithAccessConfig(accessConfig)))
306+
fmt.Println(fmt.Sprintf("cluster named \"%s\" in %s is in an unexpected state; please delete the CloudFormation stacks directly from your AWS console: %s", *accessConfig.ClusterName, *accessConfig.Region, getCloudFormationURLWithAccessConfig(accessConfig)))
307307
}
308308
exit.Error(err)
309309
}
@@ -329,7 +329,7 @@ var _downCmd = &cobra.Command{
329329
exit.Error(err)
330330
}
331331
if exitCode == nil || *exitCode != 0 {
332-
helpStr := fmt.Sprintf("\nNote: if this error cannot be resolved, please ensure that all CloudFormation stacks for this cluster eventually become been fully deleted (%s). If the stack deletion process has failed, please manually delete the stack from the AWS console (this may require manually deleting particular AWS resources that are blocking the stack deletion)", getCloudFormationURLWithAccessConfig(accessConfig))
332+
helpStr := fmt.Sprintf("\nNote: if this error cannot be resolved, please ensure that all CloudFormation stacks for this cluster eventually become fully deleted (%s). If the stack deletion process has failed, please delete the stacks directly from the AWS console (this may require manually deleting particular AWS resources that are blocking the stack deletion)", getCloudFormationURLWithAccessConfig(accessConfig))
333333
fmt.Println(helpStr)
334334
exit.Error(ErrorClusterDown(out + helpStr))
335335
}
@@ -426,14 +426,14 @@ func printInfoClusterState(awsClient *aws.Client, accessConfig *clusterconfig.Ac
426426
clusterState, err := clusterstate.GetClusterState(awsClient, accessConfig)
427427
if err != nil {
428428
if errors.GetKind(err) == clusterstate.ErrUnexpectedCloudFormationStatus {
429-
fmt.Println(fmt.Sprintf("cluster named \"%s\" in %s is in an unexpected state; please run `cortex cluster down` to delete the cluster, or delete the cloudformation stacks manually in your AWS console (%s)", *accessConfig.ClusterName, *accessConfig.Region, getCloudFormationURLWithAccessConfig(accessConfig)))
429+
fmt.Println(fmt.Sprintf("cluster named \"%s\" in %s is in an unexpected state; please run `cortex cluster down` to delete the cluster, or delete the CloudFormation stacks directly from your AWS console (%s)", *accessConfig.ClusterName, *accessConfig.Region, getCloudFormationURLWithAccessConfig(accessConfig)))
430430
}
431431
return err
432432
}
433433

434434
fmt.Println(clusterState.TableString())
435435
if clusterState.Status == clusterstate.StatusCreateFailed || clusterState.Status == clusterstate.StatusDeleteFailed {
436-
fmt.Println(fmt.Sprintf("more information can be found in your AWS console %s", getCloudFormationURLWithAccessConfig(accessConfig)))
436+
fmt.Println(fmt.Sprintf("more information can be found in your AWS console: %s", getCloudFormationURLWithAccessConfig(accessConfig)))
437437
fmt.Println()
438438
}
439439

cli/cmd/errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ func ErrorClusterAlreadyDeleted(clusterName string, region string) error {
289289
func ErrorFailedClusterStatus(status clusterstate.Status, clusterName string, region string) error {
290290
return errors.WithStack(&errors.Error{
291291
Kind: ErrFailedClusterStatus,
292-
Message: fmt.Sprintf("cluster \"%s\" in %s encountered an unexpected status %s; please try to delete the cluster with `cortex cluster down`, or delete the cloudformation stacks manually in your AWS console (%s)", clusterName, region, string(status), getCloudFormationURL(clusterName, region)),
292+
Message: fmt.Sprintf("cluster \"%s\" in %s encountered an unexpected status %s; please try to delete the cluster with `cortex cluster down`, or delete the cloudformation stacks directly from your AWS console (%s)", clusterName, region, string(status), getCloudFormationURL(clusterName, region)),
293293
})
294294
}
295295

0 commit comments

Comments
 (0)