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

NiFi unable to connect Twitter

Re: NiFi unable to connect Twitter

Contributor

I am able to curl to the Twitter API . But not connecting from NiFi

curl --get 'https://stream.twitter.com/1.1/statuses/filter.json?delimited=length&stall_warnings=true ' --data 'count=2&screen_name=twitterapi' --header 'Authorization: OAuth oauth_consumer_key="ccccccccc", oauth_nonce="BBBBBBBBBBBBBBBBBBBBBBB", oauth_signature="CCCCCCCCCCCCCCCCCCCCCCCCCCC", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1471672391", oauth_token="9009090909", oauth_version="1.0"' --verbose * About to connect() to proxy proxy.houston.hpecorp.net port 8080 (#0) * Trying 16.85.88.10... connected * Connected to proxy.houston.hpecorp.net (16.85.88.10) port 8080 (#0) * Establish HTTP proxy tunnel to stream.twitter.com:443 > CONNECT stream.twitter.com:443 HTTP/1.1 > Host: stream.twitter.com:443 > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2 > Proxy-Connection: Keep-Alive > Authorization: OAuth oauth_consumer_key="ZCY8L9UGJ4GO1c3fV4vw3jPCJ", oauth_nonce="BBBBBBBBBBBBBBBBBBBBBBB", oauth_signature="CCCCCCCCCCCCCCCCCCCCCCCCCCC", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1471672391", oauth_token="75463767-XhrwuoEAmHaeFD6RHWyvJXLphcsU8PA0oaCeCNVQD", oauth_version="1.0" >

< HTTP/1.1 200 Connection established

Re: NiFi unable to connect Twitter

Contributor

Hi Team

Any update or help on my issue ?

Re: NiFi unable to connect Twitter

Mentor

@Kishore Kumar

Can you paste the output of th below command

# traceroute -T www.google.com 

Test if the ICMP port is blocked. Create a file called ping.pl with contents

#!/usr/bin/env perl    
use strict;
use warnings;
use Net::Ping;
my @hosts = @ARGV;
die "usage: sudo perl ping.pl host\n" unless @ARGV;
my $timeout = 5;
my @proto = ("tcp", "udp", "icmp","syn");
foreach my $pro ( @proto ) {
    my $p = Net::Ping->new($pro);
    # default port    
    my $port = 7;
    $p->port_number($port);
    # tcp on https port
    if ( $pro eq "tcp"){
      $port = 443;
      $p->port_number($port);
    }
    print "\nProtocol $pro port $port\n";
    foreach my $host( @hosts ) {    
      if ($p->ping($host, $timeout)){
        print "$host is reachable\n";
      }
      else{
        print "$host is NOT reachable\n";
      }
    }
    $p->close();
    sleep(2);
}
exit; 

The run it

 # perl ping.pl google.com

Tell me what happens

Re: NiFi unable to connect Twitter

Contributor

@Geoffrey Shelton Okot

traceroute -T www.google.com
traceroute to www.google.com (74.125.21.99), 30 hops max, 60 byte packets
1 16.250.16.3 (16.250.16.3) 0.476 ms 0.409 ms 0.395 ms
2 * * *
3 * * *

perl ping.pl google.com

Protocol tcp port 443
google.com is NOT reachable

Protocol udp port 7
google.com is NOT reachable

Protocol icmp port 7
google.com is NOT reachable

Protocol syn port 7
google.com is reachable

Re: NiFi unable to connect Twitter

Mentor

@Kishore Kumar

Now we can confirm you have a network problem. Your outputs should be like below,Your ICMP port is blocked

# perl ping.pl google.com 
Protocol tcp port 443 
google.com is reachable 
Protocol udp port 7 
google.com is NOT reachable 
Protocol icmp port 7 
google.com is reachable 
Protocol syn port 7 
google.com is reachable

Traceroute

Below show my laptop reached google in 10 hops how

# traceroute -T -p 80 google.com
traceroute to google.com (216.58.205.238), 30 hops max, 60 byte packets
 1  gateway (192.168.0.1)  1.415 ms  2.234 ms  4.194 ms
 2  * * *
 3  217-168-52-245.static.cablecom.ch (217.168.52.245)  21.261 ms  22.343 ms  24.403 ms
 4  carbsm101-bundle-ether2.aorta.net (84.116.211.21)  26.244 ms  26.500 ms  26.684 ms
 5  ch-otf01b-rc1-ae54-0.aorta.net (84.116.202.225)  25.189 ms  30.657 ms  31.493 ms
 6  ch-zrh01b-ra1-ae9-0.aorta.net (84.116.134.22)  31.919 ms  19.569 ms  24.740 ms
 7  72.14.221.112 (72.14.221.112)  25.871 ms  25.598 ms  31.376 ms
 8  108.170.251.129 (108.170.251.129)  32.496 ms  32.791 ms  32.994 ms
 9  216.239.48.45 (216.239.48.45)  33.619 ms 216.239.48.43 (216.239.48.43)  33.269 ms  36.317 ms
10  fra15s24-in-f14.1e100.net (216.58.205.238)  37.734 ms  36.704 ms  26.625 ms

Please resolve that problem and your processors will succeed

Re: NiFi unable to connect Twitter

Contributor

@Geoffrey Shelton Okot

Can you please hint how to fix ?

Re: NiFi unable to connect Twitter

Mentor

@Kishore Kumar

Can you send me the output of the below commands

# ifconfig 
# cat /etc/resolv.conf

Then also do the following

Centos6/RHEL6

# service iptables stop 

Centos7/RHEL7

 # systemctl stop firewalld 

Revert

Re: NiFi unable to connect Twitter

Contributor

@Geoffrey Shelton Okot

ifconfig eth1 Link encap:Ethernet HWaddr 00:50:56:A3:35:62 inet addr:16.250.21.229 Bcast:16.250.23.255 Mask:255.255.248.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:225204 errors:0 dropped:0 overruns:0 frame:0 TX packets:54663 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:83297332 (79.4 MiB) TX bytes:20422522 (19.4 MiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:1170 errors:0 dropped:0 overruns:0 frame:0 TX packets:1170 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:301861 (294.7 KiB) TX bytes:301861 (294.7 KiB)

cat /etc/resolv.conf

search internal_host.com

nameserver 16.110.135.51

nameserver 16.110.135.52

Note : internal_host.com --List of internal hosts OF HP .

service iptables status iptables: Firewall is not running.