Upgraded aws.java.sdk.version from 1.11.510 to 1.11.825 , now getting error – com.amazonaws.SdkClientException: Failed to connect to service endpoint

huangapple go评论78阅读模式
英文:

Upgraded aws.java.sdk.version from 1.11.510 to 1.11.825 , now getting error - com.amazonaws.SdkClientException: Failed to connect to service endpoint

问题

在我的 Spring Boot 应用中,我将 aws.java.sdk.version 从 1.11.510 升级到 1.11.825,现在遇到错误:

com.amazonaws.SdkClientException: 无法连接到服务端点 -

2020-08-18 16:58:22 [main] INFO  o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - 正在刷新 org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@247bddad:启动日期 [Tue Aug 18 16:58:22 CDT 2020];上下文层次结构的根
2020-08-18 16:58:23 [main] WARN  c.a.i.InstanceMetadataServiceResourceFetcher - 无法检索令牌
com.amazonaws.SdkClientException: 无法连接到服务端点:
	在 com.amazonaws.internal.EC2ResourceFetcher.doReadResource(EC2ResourceFetcher.java:100) 处
	在 com.amazonaws.internal.InstanceMetadataServiceResourceFetcher.getToken(InstanceMetadataServiceResourceFetcher.java:91) 处

Pom 使用:

<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>com.amazonaws</groupId>
			<artifactId>aws-java-sdk-bom</artifactId>
			<version>${aws.java.sdk.version}</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-aws</artifactId>
			<version>${spring.cloud.aws.version}</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
	</dependencies>
</dependencyManagement>

<dependency>
	<groupId>com.amazonaws</groupId>
	<artifactId>aws-java-sdk-secretsmanager</artifactId>
</dependency>
英文:

In my Spring Boot App, I upgraded aws.java.sdk.version from 1.11.510 to 1.11.825 ,now getting error:

com.amazonaws.SdkClientException: Failed to connect to service endpoint -

2020-08-18 16:58:22 [main] INFO  o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@247bddad: startup date [Tue Aug 18 16:58:22 CDT 2020]; root of context hierarchy
2020-08-18 16:58:23 [main] WARN  c.a.i.InstanceMetadataServiceResourceFetcher - Fail to retrieve token 
com.amazonaws.SdkClientException: Failed to connect to service endpoint: 
	at com.amazonaws.internal.EC2ResourceFetcher.doReadResource(EC2ResourceFetcher.java:100)
	at com.amazonaws.internal.InstanceMetadataServiceResourceFetcher.getToken(InstanceMetadataServiceResourceFetcher.java:91)

Pom uses:

<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>com.amazonaws</groupId>
			<artifactId>aws-java-sdk-bom</artifactId>
			<version>${aws.java.sdk.version}</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-aws</artifactId>
			<version>${spring.cloud.aws.version}</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
	</dependencies>
</dependencyManagement>

<dependency>
	<groupId>com.amazonaws</groupId>
	<artifactId>aws-java-sdk-secretsmanager</artifactId>
</dependency>

答案1

得分: 3

This issue has already been discussed at GitHub.
But in my case, I changed the log level as follows. In the file application.yml, I added

logging:
level:
com.amazonaws.util.EC2MetadataUtils: error
com.amazonaws.internal.InstanceMetadataServiceResourceFetcher: error

英文:

This issue has already been discussed at GitHub.
But in my case, I changed the log level as follows. In the file application.yml, I added

logging:
  level:
    com.amazonaws.util.EC2MetadataUtils: error
    com.amazonaws.internal.InstanceMetadataServiceResourceFetcher: error

huangapple
  • 本文由 发表于 2020年8月19日 06:09:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/63477307.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定