Support Questions
Find answers, ask questions, and share your expertise

UpdateAttribute to FetchFTP passing Attribute

Contributor

Hi,

Experiencing error in passing IP address from UpdateAttribute to FetchFTP (NIFI 1.2.0)

42539-updateattribute.jpg

42540-fetchftp.jpg

42539-updateattribute.jpg

Error :

2017-11-10 10:01:58,786 ERROR [Timer-Driven Process Thread-3] c.a.nifi.processors.standard.FetchFTP FetchFTP[id=a38702bb-015f-1000-9462-906fa83598d9] Fail
f5f3798f,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1510277182718-1, container=default, section=1], offset=57234, length=10240],offset
9233_125_hscq26_011617_044624.txt on remote host 192.116.161.66:21 due to java.net.ConnectException: Connection refused: connect; routing to comms.failure: jav
java.net.ConnectException: Connection refused: 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 com.analog.nifi.processors.standard.util.FTPTransferV2.getClient(FTPTransferV2.java:547)
        at com.analog.nifi.processors.standard.util.FTPTransferV2.getInputStream(FTPTransferV2.java:298)
        at com.analog.nifi.processors.standard.FetchFileTransferV2.onTrigger(FetchFileTransferV2.java:237)
        at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
        at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1118)
        at org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:144)
        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:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
4 REPLIES 4

Super Guru

@mel mendoza,

I think you are using

1.Update Attribute processor to set hostip attribute value to the flowfile as 192.116.161.66
2.Then using ${hostip} attribute in FetchFTP processor

Error:-

remote host 192.116.161.66:21 due to java.net.ConnectException:Connection refused: connect; routing to comms.failure: javjava.net.ConnectException:Connection refused: connect

as per the logs you have shared it is showing connection refused from the server

Can you check do you have permissions to access FTP server on 192.116.161.66:21 port with zooms username and password.

NiFi node needs to have access to the Ftp Server port, you can check the connectivity by using

telnet 192.116.161.66 21 

Contributor

@Shu

I was able to connect using normal ftp

[zooms@hdpclient ~]$ ftp 192.116.161.66
Connected to 192.116.161.66 (192.116.161.66).
220 hscp FTP server (SunOS 5.6) ready.
Name (192.116.161.66:zooms): zooms
331 Password required for zooms.
Password:
230 User zooms logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

Super Guru

@mel mendoza,

NiFi node needs to have access to the Ftp Server port, you can check the connectivity from HDF(NiFi) nodes by using

bash# ssh <NiFi-Node-Address> //ssh to nifi node
bash# telnet 192.116.161.66 21 //check are you able to connect to the address

Contributor

@Shu

I was able to connnect via telnet. upon test via unit test, same error occur, maybe this is a known bug in nifi.