Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for setting proxy on aws client #1632

Open
srikanth550 opened this issue Jun 1, 2020 · 9 comments
Open

Add support for setting proxy on aws client #1632

srikanth550 opened this issue Jun 1, 2020 · 9 comments

Comments

@srikanth550
Copy link

srikanth550 commented Jun 1, 2020

Describe the bug
Trying to use spring cloud config server with s3 as backend and using proxy credentials to connect to AWS s3. And got this exception when I have .credentials file in /.aws/ directory. I have embedded config server in one application.

bootstrap.yml

spring:
  profiles:
      active: awss3
  cloud:
    config:
      server:
        awss3:
          region: us-east-1
          bucket: sample-bucket
        default-label: sample-config
        default-profile: test
        default-application-name: awss3-demo
        bootstrap: true

application.yml

server:
  port: 8080

Sample
Got below exception in AwsS3EnvironmentRepository.java class when finding the config file in s3 with the default credentials
eYaml = {SdkClientException@5620)com.amazonaws.SdkClientException: Unable to execute HTTP request: Connection reset

Any Help will be great. Thank you.

@spencergibb
Copy link
Member

please only put one issue per github issue

@spencergibb
Copy link
Member

is there a full stack trace anywhere?

@srikanth550
Copy link
Author

srikanth550 commented Jun 1, 2020

I have this stack trace for now...will find some more info soon

org.springframework.cloud.config.server.environment.NoSuchRepositoryException: No such repository: (bucket: Sample-bucket, key: sample-config/application-awss3(.properties | .yml | .json), versionId: null)
	at org.springframework.cloud.config.server.environment.AwsS3EnvironmentRepository.findOne(AwsS3EnvironmentRepository.java:92) ~[spring-cloud-config-server-2.2.0.RELEASE.jar:2.2.0.RELEASE]
	at org.springframework.cloud.config.server.environment.EnvironmentRepository.findOne(EnvironmentRepository.java:31) ~[spring-cloud-config-server-2.2.0.RELEASE.jar:2.2.0.RELEASE]
	at org.springframework.cloud.config.server.environment.EnvironmentRepositoryPropertySourceLocator.locate(EnvironmentRepositoryPropertySourceLocator.java:55) ~[spring-cloud-config-server-2.2.0.RELEASE.jar:2.2.0.RELEASE]
	at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:98) ~[spring-cloud-context-2.2.0.RELEASE.jar:2.2.0.RELEASE]
	at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:626) [spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
	at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:370) [spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
	at com.example.demo.DemoClientApplication.main(DemoClientApplication.java:11) [classes/:na]

@spencergibb
Copy link
Member

Please learn how to properly format code and logs.

That looks like the exception for #1633 not "Connection reset"

@srikanth550
Copy link
Author

Thanks for the Info.

But before looking for that file, application is not able to access Aws s3 bucket. Getting this exception when I debug
eYaml = {SdkClientException@5620)com.amazonaws.SdkClientException: Unable to execute HTTP request: Connection reset

@spencergibb
Copy link
Member

I see you commented on aws/aws-sdk-java#2064 I don't see how I can help when it sounds like a networking issue.

@srikanth550
Copy link
Author

How to set specific amazon profile in bootstrap.yml when using s3Client?

@srikanth550
Copy link
Author

@spencergibb
This is the stacktrace when connecting to aws s3 bucket to get application config

Here is the stack trace

stackTrace = {StackTraceElement[25]@5621} 
 0 = {StackTraceElement@5624} "com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleRetryableException(AmazonHttpClient.java:1136)"
 1 = {StackTraceElement@5625} "com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1082)"
 2 = {StackTraceElement@5626} "com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:745)"
 3 = {StackTraceElement@5627} "com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:719)"
 4 = {StackTraceElement@5628} "com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:701)"
 5 = {StackTraceElement@5629} "com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:669)"
 6 = {StackTraceElement@5630} "com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:651)"
 7 = {StackTraceElement@5631} "com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:515)"
 8 = {StackTraceElement@5632} "com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4443)"
 9 = {StackTraceElement@5633} "com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4390)"
 10 = {StackTraceElement@5634} "com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1427)"
 11 = {StackTraceElement@5635} "org.springframework.cloud.config.server.environment.AwsS3EnvironmentRepository.getS3ConfigFile(AwsS3EnvironmentRepository.java:139)"
 12 = {StackTraceElement@5636} "org.springframework.cloud.config.server.environment.AwsS3EnvironmentRepository.getS3ConfigFile(AwsS3EnvironmentRepository.java:120)"
 13 = {StackTraceElement@5637} "org.springframework.cloud.config.server.environment.AwsS3EnvironmentRepository.findOne(AwsS3EnvironmentRepository.java:87)"
 14 = {StackTraceElement@5638} "org.springframework.cloud.config.server.environment.EnvironmentRepository.findOne(EnvironmentRepository.java:31)"
 15 = {StackTraceElement@5639} "org.springframework.cloud.config.server.environment.EnvironmentRepositoryPropertySourceLocator.locate(EnvironmentRepositoryPropertySourceLocator.java:55)"
 16 = {StackTraceElement@5640} "org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:52)"
 17 = {StackTraceElement@5641} "org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:47)"
 18 = {StackTraceElement@5642} "org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:98)"
 19 = {StackTraceElement@5643} "org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:626)"
 20 = {StackTraceElement@5644} "org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:370)"
 21 = {StackTraceElement@5645} "org.springframework.boot.SpringApplication.run(SpringApplication.java:314)"
 22 = {StackTraceElement@5646} "org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)"
 23 = {StackTraceElement@5647} "org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)"
 24 = {StackTraceElement@5648} "com.example.demo.DemoClientApplication.main(DemoClientApplication.java:11)"

do you know how to set proxy config for aws type in composite config?

@spencergibb
Copy link
Member

I doesn't look like you can set proxy config directly for the client.

@spencergibb spencergibb changed the title com.amazonaws.SdkClientException: Unable to execute HTTP request: Connection reset Add support for setting proxy on aws client Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants