Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

AutoDetectingStackNameProvider Fails For Auto-Scaling Groups/ELB #50

Closed
darylrobbins opened this issue Feb 5, 2015 · 9 comments
Closed
Assignees
Labels
type: bug A general bug
Milestone

Comments

@darylrobbins
Copy link

Trying to determine the stack name for an instance fails when the instance is connected to the stack via an auto-scaling group as opposed to directly, resulting in an exception that fails the application loading. This exception should likely be swallowed up, allowing the name detector to move on to its fallback logic.

Caused by: com.amazonaws.AmazonServiceException: Stack for i-9ae92175 does not exist (Service: AmazonCloudFormation; Status Code: 400; Error Code: ValidationError; Request ID: 4ccbd832-ad6f-11e4-8f95-617fd8834716)
    at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1071)
    at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:719)
    at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:454)
    at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:294)
    at com.amazonaws.services.cloudformation.AmazonCloudFormationClient.invoke(AmazonCloudFormationClient.java:1078)
    at com.amazonaws.services.cloudformation.AmazonCloudFormationClient.describeStackResources(AmazonCloudFormationClient.java:875)
    at org.springframework.cloud.aws.core.env.stack.config.AutoDetectingStackNameProvider.autoDetectStackName(AutoDetectingStackNameProvider.java:63)
    at org.springframework.cloud.aws.core.env.stack.config.AutoDetectingStackNameProvider.afterPropertiesSet(AutoDetectingStackNameProvider.java:53)
    at org.springframework.cloud.aws.core.env.stack.config.AutoDetectingStackNameProvider.<init>(AutoDetectingStackNameProvider.java:44)
    at org.springframework.cloud.aws.core.env.stack.config.AutoDetectingStackNameProvider.<init>(AutoDetectingStackNameProvider.java:48)
    at org.springframework.cloud.aws.core.env.stack.config.StackResourceRegistryFactoryBean.<init>(StackResourceRegistryFactoryBean.java:57)
    at org.springframework.cloud.aws.autoconfigure.context.ContextStackAutoConfiguration$StackAutoDetectConfiguration.stackResourceRegistryFactoryBean(ContextStackAutoConfiguration.java:63)
    at org.springframework.cloud.aws.autoconfigure.context.ContextStackAutoConfiguration$StackAutoDetectConfiguration$$EnhancerBySpringCGLIB$$98368e1.CGLIB$stackResourceRegistryFactoryBean$0(<generated>)
    at org.springframework.cloud.aws.autoconfigure.context.ContextStackAutoConfiguration$StackAutoDetectConfiguration$$EnhancerBySpringCGLIB$$98368e1$$FastClassBySpringCGLIB$$1351ccc2.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309)
    at org.springframework.cloud.aws.autoconfigure.context.ContextStackAutoConfiguration$StackAutoDetectConfiguration$$EnhancerBySpringCGLIB$$98368e1.stackResourceRegistryFactoryBean(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
    ... 89 more
@aemruli aemruli added the type: bug A general bug label Feb 11, 2015
@aemruli aemruli added this to the 1.0.0.RC3 milestone Feb 11, 2015
@aemruli aemruli self-assigned this Feb 11, 2015
@aemruli
Copy link
Contributor

aemruli commented Feb 13, 2015

@darylrobbins can you elaborate more "This exception should likely be swallowed up, allowing the name detector to move on to its fallback logic." what you mean with that ?

@aemruli aemruli modified the milestones: 1.0.0.GA, 1.0.0.RC3 Feb 13, 2015
@aemruli aemruli modified the milestones: 1.0.1, 1.0.0 Mar 2, 2015
@aemruli aemruli modified the milestones: 1.0.1, 1.0.2 Apr 23, 2015
@sodik82
Copy link

sodik82 commented Apr 27, 2015

is there at least any workaround for this problem?

@sodik82
Copy link

sodik82 commented Apr 28, 2015

for me (I am not using CloudFormation) worked spring-boot property:

cloud.aws.stack.auto = false

@aemruli
Copy link
Contributor

aemruli commented Apr 28, 2015

@sodik82 You can also specify the stack name if your are using CloudFormation. We will have a investigation into this bug.

@sodik82
Copy link

sodik82 commented Apr 28, 2015

I have tried that as well, but in such case I got exception saying that stack name was not found (that was quite acceptable since I don't use CloudFormation at all). But maybe we are talking about two different problems here:

  1. my case - spring boot autoconfiguration, not using CloudFormation, no ELB
  2. reporter's case - (if I understand it correctly): EC2 instance behind ELB, maybe using CloudFormation

however I got here since I get (at least very similar) exception with "default" spring boot autoconfiguration which was working as long I was on my local machine but not after deployment to AWS. can I help somehow with more details?

@darylrobbins
Copy link
Author

@sodik82 is correct. My configuration was EC2 instance in an autoscaling group behind an ELB, managed by Elastic Beanstalk, which uses CloudFormation under the hood.

@sodik82
Copy link

sodik82 commented May 1, 2015

@aemruli shall I create an extra ticket?

@aemruli aemruli modified the milestones: 1.0.2, 1.0.3 Jun 25, 2015
@aemruli aemruli modified the milestones: 1.0.3, 1.1.0 Aug 13, 2015
@unniksk
Copy link

unniksk commented Sep 29, 2015

Hi,

I am getting the same error when deploying the Spring boot jar using Elastic Beanstalk but the same jar is working on local.
Is there any way to resolver this issue.

@aemruli aemruli modified the milestones: 1.1.0, 1.1.0 m1 Oct 31, 2015
@aemruli
Copy link
Contributor

aemruli commented Oct 31, 2015

There was an error with the auto configuration for the region therefore the stacks were not found. The merged #115 should solve that issue.

Please reopen in case of any further error.

@aemruli aemruli closed this as completed Oct 31, 2015
maciejwalkowiak pushed a commit to maciejwalkowiak/spring-cloud-aws that referenced this issue Oct 15, 2020
… AnnotationDrivenQueueListenerBeanDefinitionParser for Amazon SQS creation. Added support for region and region-provider configuration in the amazon sqs client class.

Resolves spring-attic#50
juho9000 pushed a commit to juho9000/spring-cloud-aws that referenced this issue Apr 29, 2021
… AnnotationDrivenQueueListenerBeanDefinitionParser for Amazon SQS creation. Added support for region and region-provider configuration in the amazon sqs client class.

Resolves spring-attic/spring-cloud-aws#50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A general bug
Development

No branches or pull requests

4 participants