JAVA/SPRING/JAVA

[SFTP] jsch Pipe closed 익셉션 관련

junhokim 2017. 12. 1. 09:45
반응형

com.jcraft.jsch.JSchException: java.io.IOException: Pipe closed

        at com.jcraft.jsch.ChannelSftp.start(ChannelSftp.java:242)

        at com.jcraft.jsch.Channel.connect(Channel.java:200)

        at com.jcraft.jsch.Channel.connect(Channel.java:144)

        at net.ib.paperless.common.SFTPHandler.init(SFTPHandler.java:61)

        at net.ib.paperless.service.AttachService.putFileUpload(AttachService.java:275)

        at net.ib.paperless.service.AttachService.eFormAttachFileSave(AttachService.java:72)

        at net.ib.paperless.controller.AttachFileController.attachFile(AttachFileController.java:68)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:498)

        at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)

        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)

        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)

        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)

        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)

        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)

        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)

        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)

        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)

        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)

        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

        at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)

        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

        at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105)

        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

        at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)

        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)

        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

        at org.springframework.boot.web.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:117)

        at org.springframework.boot.web.support.ErrorPageFilter.access$000(ErrorPageFilter.java:61)

        at org.springframework.boot.web.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:92)

        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

        at org.springframework.boot.web.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:110)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)

Caused by: java.io.IOException: Pipe closed

        at java.io.PipedInputStream.read(PipedInputStream.java:307)

        at java.io.PipedInputStream.read(PipedInputStream.java:377)

        at com.jcraft.jsch.ChannelSftp.fill(ChannelSftp.java:2325)

        at com.jcraft.jsch.ChannelSftp.header(ChannelSftp.java:2351)

        at com.jcraft.jsch.ChannelSftp.start(ChannelSftp.java:211)







확인해야 할것.

1. jsch 라이브러리 버전을 최신버전인 0.1.54를 사용했었는데.. 0.1.42 버전으로 낮춰서 사용

2. sftp 접속 정보를 정확히 확인해봐야함

etc. 필자는 spring-boot를 사용하는데, properties가 개발용하고 상용이 있어 톰캣에서 올릴때 뭔가 꼬여서 올라가 났던 에러로 추정

3. /etc/ssh/sshd_config 에서 경로 확인 및 틀리다면 수정
# override default of no subsystems 
Subsystem sftp /usr/libexec/openssh/sftp-server


반응형