- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to access file present in network shared drive with credentials in nifi?
- Labels:
-
Apache NiFi
Created ‎09-05-2017 01:37 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have NiFi instance 1.3.0 running on my local Windows. I want to copy a file from a one network drive to FTP.
I think getFile processor reads files inside share directory
//server/shared/path/to/file.
Normally my shared drive prompts for credentials before access folder.
I tried getFile processor for access shared drive without credentials it worked.
But it not worked if credentials asked for network drive.
Can anyone suggest way to access network drive folder with credentials and move it into FTP using NiFi processors?
@wayne
I tried with GetFTP but it shows below error
ERROR [Timer-Driven Process Thread-9] o.apache.nifi.processors.standard.GetFTP GetFTP[id=5080b2bd-015e-1000-1f94-1e8811e88742] Unable to fetch listing from remote server due to java.net.ConnectException: Connection timed out: connect: {} java.net.ConnectException: Connection timed out: connect at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at org.apache.commons.net.SocketClient.connect(SocketClient.java:182) at org.apache.nifi.processors.standard.util.FTPTransfer.getClient(FTPTransfer.java:532) at org.apache.nifi.processors.standard.util.FTPTransfer.getListing(FTPTransfer.java:191) at org.apache.nifi.processors.standard.util.FTPTransfer.getListing(FTPTransfer.java:155) at org.apache.nifi.processors.standard.GetFileTransfer.fetchListing(GetFileTransfer.java:284) at org.apache.nifi.processors.standard.GetFileTransfer.onTrigger(GetFileTransfer.java:127) at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27) at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1120) 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:132) 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:748)
Created on ‎09-06-2017 05:35 PM - edited ‎08-18-2019 02:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The GetFile processor doesn't have properties that allow entering user credentials.
Have you tried using GetFTP to access the files and then use PutFTP processor to move the file?
Configure the GetFTP like this
Created ‎09-07-2017 04:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
21 is FTP port.It couldn't work for network shared drive ports(139,445)
Created ‎09-07-2017 05:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I haved added error faced while using getFTP for access sharedDrive
Created ‎09-07-2017 05:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you able to manually ftp to the server with the user credentials?
Also, you can change the port the processor uses for the ftp connection.
Created ‎09-08-2017 03:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not mean that accessing data from FTP Server.
i mean that to get file from UNC Path(//servername/folder) and move that into FTP Server.
i don't know in this case how getFTP works?
Created ‎09-08-2017 04:08 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If the shared drive requires user credentials to access it, then the GetFile processor will not work in this case.
What do you mean by "It couldn't work for network shared drive ports(139,445)"?
Created ‎09-11-2017 03:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Wynner.
I mean that network shared drive access in GetFTP not worked.For FTP server port is 21 that is configured GetFTP processor.But network shared drive ports are 139,445.In your answer you have specified 21 port in GetFTP. That's why i said FTP processor not work for multiple ports used by UNC Path.
Created ‎09-11-2017 08:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the GetFTP processor, you can change that property to use a different port. Try using 139 or 445 to see if it works?
Created ‎09-08-2017 09:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is a very well written post, my compliments. I’m glad to find your post. Keep sharing this type of stuff. foil containers suppliers
