简体   繁体   English

在 minio 支持的 awsS3Client 上调用 getRegionName() 会引发 IllegalStateException

[英]Calling getRegionName() on a awsS3Client backed by minio throws IllegalStateException

Calling getRegionName() on a awsS3Client backed by minio throws IllegalStateException.在 minio 支持的 awsS3Client 上调用 getRegionName() 会引发 IllegalStateException。

The Minio configuration does include a region name. Minio 配置确实包含区域名称。 So, it is wierd that getRegionName() fails.因此,getRegionName() 失败是很奇怪的。 That too, it throws IllegalStateException.同样,它也会抛出 IllegalStateException。

"java.lang.IllegalStateException: No valid region has been specified. Unable to return region name" “java.lang.IllegalStateException:未指定有效区域。无法返回区域名称”

What's going wrong?怎么了?

It doesn't matter whether a region is configured in minio configuration.区域是否在 minio 配置中配置无关紧要。

The problem is because the awsS3Client.getRegionName() checks to make sure that the host name conforms to a AWS domain name regex.问题是因为 awsS3Client.getRegionName() 检查以确保主机名符合 AWS 域名正则表达式。 If the host name doesn't conform to that pattern, it throws an IllegalStateException.如果主机名不符合该模式,则会引发 IllegalStateException。

So, if there is a s3Client.getRegionName() call which you want to work even in Local / Development environments, replace it with just getting the region from your config like appS3Config.getRegion()因此,如果有一个 s3Client.getRegionName() 调用,即使在本地/开发环境中您也想工作,请将其替换为仅从您的配置中获取区域,例如 appS3Config.getRegion()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将 AwsS3Client 添加到 spring 引导项目 - How to add AwsS3Client to spring boot project 如果尝试连接到本地服务 (MinIO),AmazonsS3Client 会抛出 UnknownHostException - AmazonsS3Client throws UnknownHostException if attempting to connect to a local service (MinIO) 创建elasticsearch客户端抛出一个Netty IllegalStateException - create elasticsearch client throws a netty IllegalStateException JAX-RS(Reasteasy)Response.readEntity抛出:IllegalStateException:RESTEASY003290:实体不受输入流支持 - JAX-RS (Reasteasy) Response.readEntity throws: IllegalStateException: RESTEASY003290: Entity is not backed by an input stream AutoCompleteTextView随机抛出IllegalStateException - AutoCompleteTextView randomly throws IllegalStateException 对象化事务抛出IllegalStateException - Objectify transaction throws IllegalStateException Android 按钮抛出 IllegalStateException - Android Button throws IllegalStateException ClientBootstrap releaseExternalResources()引发IllegalStateException - ClientBootstrap releaseExternalResources() throws an IllegalStateException 在servlet请求上调用startAsync()会在Jetty 9的ProxyServlet终止的过滤器链中引发IllegalStateException - Calling startAsync() on a servlet request throws IllegalStateException in a filter chain terminated by Jetty 9's ProxyServlet Android:调用DialogFragment的IllegalStateException - Android: IllegalStateException calling DialogFragment
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM