Exception when attempting to connect to S3

0

Hi, I am attempting to connect to and upload a file to S3 using the AWS SDK for Java within my AWS Lambda function, but am getting this exception:

{ "errorMessage": "Received an UnknownHostException when attempting to interact with a service. See cause for the exact endpoint that is failing to resolve. If this is happening on an endpoint that previously worked, there may be a network connectivity issue or your DNS cache could be storing endpoints for too long.", "errorType": "software.amazon.awssdk.core.exception.SdkClientException", "stackTrace": [ "software.amazon.awssdk.core.exception.SdkClientException$BuilderImpl.build(SdkClientException.java:98)", "software.amazon.awssdk.awscore.interceptor.HelpfulUnknownHostExceptionInterceptor.modifyException(HelpfulUnknownHostExceptionInterceptor.java:59)", "software.amazon.awssdk.core.interceptor.ExecutionInterceptorChain.modifyException(ExecutionInterceptorChain.java:199)", "software.amazon.awssdk.core.internal.http.pipeline.stages.utils.ExceptionReportingUtils.runModifyException(ExceptionReportingUtils.java:54)", "software.amazon.awssdk.core.internal.http.pipeline.stages.utils.ExceptionReportingUtils.reportFailureToInterceptors(ExceptionReportingUtils.java:38)", "software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:39)", "software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:26)", "software.amazon.awssdk.core.internal.http.AmazonSyncHttpClient$RequestExecutionBuilderImpl.execute(AmazonSyncHttpClient.java:193)", "software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.invoke(BaseSyncClientHandler.java:133)", "software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.doExecute(BaseSyncClientHandler.java:159)", "software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.lambda$execute$1(BaseSyncClientHandler.java:112)", "software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.measureApiCallSuccess(BaseSyncClientHandler.java:167)", "software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:94)", "software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)", "software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:55)", "software.amazon.awssdk.services.s3.DefaultS3Client.putObject(DefaultS3Client.java:8655)", "vikram.S3UploadHandler.handleRequest(S3UploadHandler.java:26)", "java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)", "java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)", "java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)", "java.base/java.lang.reflect.Method.invoke(Unknown Source)" ], "cause": { "errorMessage": "Unable to execute HTTP request: vikrambucket2.s3.us-iso-east-1.c2s.ic.gov",

asked 4 months ago384 views
1 Answer
1
Accepted Answer

Hi,

It's not clear what exact configuration of Lambda you have, it could be run in VPC, so please start troubleshooting from here https://repost.aws/knowledge-center/connect-s3-vpc-endpoint

profile picture
EXPERT
answered 4 months ago
profile picture
EXPERT
reviewed a month ago
  • Thanks a lot, will go through the troubleshooting.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions