# Twitter client error - connection refused

**URL:** <https://discuss.elastic.co/t/twitter-client-error-connection-refused/84454>\
**Category:** Logstash\
**Created:** [May 3, 2017, 7:48pm UTC](https://discuss.elastic.co/t/twitter-client-error-connection-refused/84454 "2017-05-03T19:48:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_Lao](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@Rahul\_Lao](https://discuss.elastic.co/u/Rahul_Lao)\
**Post date:** [May 3, 2017, 7:48pm UTC](https://discuss.elastic.co/t/twitter-client-error-connection-refused/84454/1 "2017-05-03T19:48:17Z")

</div>

This is some what same as

> [@Twitter Client Error "Connection Refused"](https://discuss.elastic.co/t/twitter-client-error-connection-refused/66205):
>
> Twitter client error {:message=\>"Connection refused - Connection refused", :exception=\>"Errno::ECONNREFUSED", :backtrace=\>["org/jruby/ext/socket/RubyTCPSocket.java:126:in initialize'", "org/jruby/RubyIO.java:871:innew'", "/root/logstash-5.0.0/vendor/bundle/jruby/1.9/gems/logstash-input-twitter-3.0.3/lib/logstash/inputs/twitter/patches.rb:26:in stream'", "/root/logstash-5.0.0/vendor/bundle/jruby/1.9/gems/logstash-input-twitter-3.0.3/lib/logstash/inputs/twitter/patches.rb:58:inrequest'", "/root/lo…

my logstash.conf is

```
input {
twitter {
# add your data
consumer_key => "x"
consumer_secret => "x"
oauth_token => "x"
oauth_token_secret => "x"
keywords => ["GameSpot"]
full_tweet => true
# below lines are commented
#use_proxy => true
#proxy_address => "http://ip"
#proxy_port => port
}
}
output {
elasticsearch {
hosts => ["127.0.0.1:9200"]
index => "idx_ls"
}
}

```

And the error that i get is

```
10:28:39.716 [[main]-pipeline-manager] INFO logstash.pipeline - Pipeline main started
10:28:39.718 [[main]"GameSpot"}
10:28:39.775 [Api Webserver] INFO logstash.agent - Successfully started Logstash API endpoint {:port=>9600}
10:30:46.969 [[main]"Connection refused - Connection refused", :exception=>"Errno::ECONNREFUSED", :backtrace=>["org/jruby/ext/socket/RubyTCPSocket.java:126:in initialize'", "org/jruby/RubyIO.java:871:innew'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-twitter-3.0.3/lib/logstash/inputs/twitter/patches.rb:26:in stream'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-twitter-3.0.3/lib/logstash/inputs/twitter/patches.rb:58:inrequest'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/twitter-5.15.0/lib/twitter/streaming/client.rb:37:in filter'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-twitter-3.0.3/lib/logstash/inputs/twitter.rb:138:inrun'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:425:in inputworker'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:419:instart_input'"], :options=>nil}

```

Where do i have to specify proxy settings?

in my linux terminal when i execute the export command i can see  
declare -x http\_proxy="[http://ip](http://ip):port"  
declare -x https\_proxy="[https://ip](https://ip):port"

Please can someone suggest how can i fetch data from twitter?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 3, 2017, 8:36pm UTC](https://discuss.elastic.co/t/twitter-client-error-connection-refused/84454/2 "2017-05-03T20:36:09Z")

</div>

Do you have a proxy in place? Most of the time I have seen this error, it's been caused by bad auth details.

---

<div class="post-metadata">

**Author:** ![Rahul\_Lao](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@Rahul\_Lao](https://discuss.elastic.co/u/Rahul_Lao)\
**Post date:** [May 3, 2017, 8:50pm UTC](https://discuss.elastic.co/t/twitter-client-error-connection-refused/84454/3 "2017-05-03T20:50:03Z")

</div>

Yes i do have a proxy behind.

I have also mentioned the same in the post.

I know the proxy ip and port but the problem is that i don't know where and how to make changes (environment variables, jvm and what all).

Just for information i have installed elk stack using vagrant on ubuntu.

Looking forward to your reply.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 31, 2017, 9:00pm UTC](https://discuss.elastic.co/t/twitter-client-error-connection-refused/84454/4 "2017-05-31T21:00:19Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
