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

Getting Error "Unable to execute HTTP request" when trying to access public s3 Bucket. #2798

Closed
karunshivappa opened this issue Jun 30, 2022 · 3 comments
Labels
closed-for-staleness guidance Question that needs advice or information.

Comments

@karunshivappa
Copy link

Getting Error like com.amazonaws.SdkClientException: Unable to execute HTTP request:
.s3.ap-south-1.amazonaws.com

download the line in stacktrace it also says Caused by: java.net.UnknownHostException:
.s3.ap-south-1.amazonaws.com

we are using "aws-java-sdk-s3"

com.amazonaws aws-java-sdk-s3

Below is the java code to create s3 client builder:

AWSCredentials credentials = new BasicAWSCredentials(, );
AmazonS3ClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(credentials)).withRegion("ap-south-1").build();

Entire setup is running on unbuntu kubernetes cluster

S3_Error

@debora-ito debora-ito transferred this issue from aws/aws-sdk Jul 11, 2022
@chenja2000
Copy link

I'm wondering if we encountered the same issue on IBM Cloud Pak for Data:
at com.ibm.wdp.connect.connectors.ConnectorWrapper.createAndConnect(ConnectorWrapper.java:121)
at com.ibm.wdp.connect.connectors.ConnectorWrapper.discoverAssetsImpl(ConnectorWrapper.java:171)
at com.ibm.wdp.connect.connectors.ConnectorWrapper.discoverAssets(ConnectorWrapper.java:154)\n\t... 67 more\nCaused by: shadow.wdp.connect.library.file.amazons3.com.amazonaws.SdkClientException: Unable to execute HTTP request: com.ibm.jsse2.util.j: PKIX path building failed: com.ibm.security.cert.IBMCertPathBuilderException: unable to find valid certification path to requested target\n\t
at shadow.wdp.connect.library.file.amazons3.com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleRetryableException(AmazonHttpClient.java:1207)\n\t
at shadow.wdp.connect.library.file.amazons3.com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1153)\n\t
at shadow.wdp.connect.library.file.amazons3.com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:802)\n\t
at shadow.wdp.connect.library.file.amazons3.com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:770)\n\t
at shadow.wdp.connect.library.file.amazons3.com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:744)
at shadow.wdp.connect.library.file.amazons3.com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:704)
at shadow.wdp.connect.library.file.amazons3.com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:686)
shadow.wdp.connect.library.file.amazons3.com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:550)
shadow.wdp.connect.library.file.amazons3.com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:530)
at shadow.wdp.connect.library.file.amazons3.com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:5445)
at shadow.wdp.connect.library.file.amazons3.com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:5392)
at shadow.wdp.connect.library.file.amazons3.com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:5386)
at shadow.wdp.connect.library.file.amazons3.com.amazonaws.services.s3.AmazonS3Client.getS3AccountOwner(AmazonS3Client.java:1015)
at shadow.wdp.connect.library.file.amazons3.com.amazonaws.services.s3.AmazonS3Client.getS3AccountOwner(AmazonS3Client.java:1005)
at com.ibm.connect.file.amazons3.AmazonS3.connect(AmazonS3.java:132)
at com.ibm.connect.file.FileConnector.connect(FileConnector.java:79)\n\t... 73 more\nCaused by: javax.net.ssl.SSLHandshakeException: com.ibm.jsse2.util.j: PKIX path building failed: com.ibm.security.cert.IBMCertPathBuilderException: unable to find valid certification path to requested target
at com.ibm.jsse2.g.a(Unknown Source)
at com.ibm.jsse2.bb.a(Unknown Source)
at com.ibm.jsse2.bb.a(Unknown Source)
at com.ibm.jsse2.bb.a(Unknown Source)
at com.ibm.jsse2.z$c.a(Unknown Source)
at com.ibm.jsse2.z$c.a(Unknown Source)\n\tat com.ibm.jsse2.z$c.consume(Unknown Source)\n\tat com.ibm.jsse2.p.consume(Unknown Source)\n\tat com.ibm.jsse2.aa.a(Unknown Source)\n\tat com.ibm.jsse2.aa.a(Unknown Source)\n\tat com.ibm.jsse2.bb.a(Unknown Source)\n\tat com.ibm.jsse2.a0.a(Unknown Source)\n\tat com.ibm.jsse2.bj.b(Unknown Source)\n\tat com.ibm.jsse2.bj.f(Unknown Source)\n\tat com.ibm.jsse2.bj.a(Unknown Source)
at com.ibm.jsse2.bj.startHandshake(Unknown Source)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:436)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:384)
at shadow.wdp.connect.library.file.amazons3.com.amazonaws.http.conn.ssl.SdkTLSSocketFactory.connectSocket(SdkTLSSocketFactory.java:142)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

@debora-ito
Copy link
Member

@karunshivappa UnknownHostException indicates DNS resolution issues. Take a look at thread with a similar error: #1503.

@chenja2000 in your case it seems a certification issue, the Amazon Root certificates are missing from your trust store - check this comment with more info: #2087 (comment)

@debora-ito debora-ito added closing-soon This issue will close in 2 days unless further comments are made. guidance Question that needs advice or information. labels Jul 18, 2022
@chenja2000
Copy link

@debora-ito You are right! We checked further. It seems related to proxy settings. The traffic cannot reach Amazon S3. So it fails on authentication at the first place. Thank you very much!

@github-actions github-actions bot removed the closing-soon This issue will close in 2 days unless further comments are made. label Jul 19, 2022
@debora-ito debora-ito added the closing-soon This issue will close in 2 days unless further comments are made. label Jul 19, 2022
@github-actions github-actions bot added closed-for-staleness and removed closing-soon This issue will close in 2 days unless further comments are made. labels Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-for-staleness guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

3 participants