Support Questions

Find answers, ask questions, and share your expertise

PutS3Object processor in Nifi failed to persist file with 'Socket is Closed' exception

avatar

Hi All,

I am trying to persist data into an S3 bucket through Nifi PutS3Object processor, and sometimes I'm getting the below error

Please help me with the possibilities to fix this issue.

ERROR [Timer-Driven Process Thread-3967] o.a.nifi.processors.aws.s3.PutS3Object PutS3Object[id=e1ed3d31-f12a-1572-b913-4595cd91cf49] Failed to put StandardFlowFileRecord[uuid=2724806e-3b0d-48d5-a806-eb02e97d40c7,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1536017934845-69432, container=default, section=824], offset=1001138, length=827387],offset=366284,name=5410310069030717,size=411944] to Amazon S3 due to com.amazonaws.SdkClientException: Unable to execute HTTP request: Socket is closed: {} com.amazonaws.SdkClientException: Unable to execute HTTP request: Socket is closed at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:972) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:676) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:650) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:633) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$300(AmazonHttpClient.java:601) at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:583) at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:447) at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4137) at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1685) at org.apache.nifi.processors.aws.s3.PutS3Object$1.process(PutS3Object.java:474) at org.apache.nifi.controller.repository.StandardProcessSession.read(StandardProcessSession.java:2175) at org.apache.nifi.controller.repository.StandardProcessSession.read(StandardProcessSession.java:2145) at org.apache.nifi.controller.repository.BatchingSessionFactory$HighThroughputSession.read(BatchingSessionFactory.java:192) at org.apache.nifi.processors.aws.s3.PutS3Object.onTrigger(PutS3Object.java:417) at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27) at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1122) at org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:147) at org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:47) at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:128) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.net.SocketException: Socket is closed

1 REPLY 1

avatar
New Contributor

I am seeing the same issue sporadically with 1.7.1, but I also saw it with 1.4.0. I'm working around it by writing failed FlowFiles from PutS3Object to disk and then periodically reading them with GetFile and routing them back to PutS3Object. Any ideas what could be causing this issue?