Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

SFTP file download issue

HarishG
Regular Contributor
Regular Contributor

Hi,

We are getting the below error when trying to download the file from SFTP location. even if the file is present in the mentioned location, we are getting an error that file is not available in the location. Any suggestions?

FILES_TO_GET:

[
{
"eic_dest_dir":"DataFiles",
"src_dir":"/saphcm/data/saviyntuploadfiles",
"file_list":["sftpuserimport.csv","Users1.csv"]
}
]

Error:

DEBUG-Exception in downloading file : /saphcm/data/saviyntuploadfiles/Users1.csv|com.jcraft.jsch.SftpException: FileNotFound: The supplied file does not exist.| at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2873) ~[na:na]| at com.jcraft.jsch.ChannelSftp._lstat(ChannelSftp.java:2336) ~[na:na]| at com.jcraft.jsch.ChannelSftp.lstat(ChannelSftp.java:2312) ~[na:na]| at com.saviynt.ssm.sftpconnector.service.SFTPConnectorService.downloadFile(SFTPConnectorService.java:265) ~[na:na]| at com.saviynt.ssm.sftpconnector.service.SFTPConnectorService.getFilesFromDirectory(SFTPConnectorService.java:191) ~[na:na]| at com.saviynt.ssm.sftpconnector.service.SFTPConnectorService.getFilesFromTarget(SFTPConnectorService.java:137) ~[na:na]|
 
DEBUG-Files failed to download with detailed error message : {"/saphcm/data/saviyntuploadfiles/Users1.csv":"File not found","/saphcm/data/saviyntuploadfiles/sftpuserimport.csv":"File not found"}
 
connectorms--null-65hg9--javax.crypto.BadPaddingException: Error closing stream: at com.safelogic.cryptocomply.jcajce.provider.BaseCipher.engineDoFinal(BaseCipher.java:952) at java.base/javax.crypto.Cipher.doFinal(Cipher.java:2202) at com.saviynt.encrypt.EncryptionService.decode(EncryptionService.java:186) at com.saviynt.ssm.connectorms.service.CommonUtilityService.getDataForEncryptedAttr(CommonUtilityService.java:83) at com.saviynt.ssm.connectorms.controller.FileTransferController.getFiles(FileTransferController.java:69) at jdk.internal.reflect.GeneratedMethodAccessor97.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) at javax.servlet.http.HttpServlet.service(HttpServlet.java:555) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) at com.saviynt.multitenant.TenantFilter.doFilter(TenantFilter.java:36) at jdk.internal.reflect.GeneratedMethodAccessor61.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:282) at org.springframework.cloud.context.scope.GenericScope$LockedScopedProxyFactoryBean.invoke(GenericScope.java:485) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) at com.saviynt.multitenant.TenantFilter$$EnhancerBySpringCGLIB$$6148ad9c.doFilter(<generated>) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:337) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:115) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:81) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:91) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
 
 
Best regards
Harish
11 REPLIES 11

rushikeshvartak
All-Star
All-Star

Does file exists & have required privilege?


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

SumathiSomala
All-Star
All-Star

@HarishG Did you provide the correct path in src_dir?

Does files exist in specified path?

 

Regards,
Sumathi Somala

If this reply answered your question, please Accept As Solution and give Kudos.

HarishG
Regular Contributor
Regular Contributor

Hi @rushikeshvartak and @SumathiSomala,

Yes, the file exist in the location. 

HarishG_0-1706514427705.png

 

Best regards,

Harish

@HarishG 

Is SFTP connection is successful in Saviynt?

Is Service account used in the connection has required privileges to download the file?

 

Regards,
Sumathi Somala

If this reply answered your question, please Accept As Solution and give Kudos.

HarishG
Regular Contributor
Regular Contributor

Hi @SumathiSomala and @rushikeshvartak 

Thanks for the reply.

Yes the connection is successful. And also the service account has required privileges(read access) to download the file.

Any idea if something else is missing?

 

Best regards,

Harish

@HarishG Try below

[
{
"eic_dest_dir":"DataFiles",
"src_dir":"/home/saphcm/data/saviyntuploadfiles",
"file_list":["sftpuserimport.csv","Users1.csv"]
}
]

 

Regards,
Sumathi Somala

If this reply answered your question, please Accept As Solution and give Kudos.

HarishG
Regular Contributor
Regular Contributor

Hi @SumathiSomala 

Tried it just now. getting the same error.

Screenshot 2024-01-31 at 12.34.09.pngScreenshot 2024-01-31 at 12.32.18.png

 

The SFTP server is azure-based. Hope its not a problem right?

 

Share connection config Screenshot


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

krishna_sk
Regular Contributor
Regular Contributor

Hi @HarishG , Did you got this resolved. We are also facing similar kind of issue.

Any help would be appreciated.

Thank you.

HarishG
Regular Contributor
Regular Contributor

Hi @krishna_sk ,

Yes, the issue is resolved after correcting the SFTP folder path in the JSON.

krishna_sk
Regular Contributor
Regular Contributor

Hi @HarishG ,

Could you let us know What was changed in the SFTP Folder that worked comparing to the initial one you are using.

Is there any path structure we need to follow?

Thank you.