# Twitter plugin : Twitter client error {:message=\>"", :exception=\>"Twitter::Error::BadRequest",

**URL:** <https://discuss.elastic.co/t/twitter-plugin-twitter-client-error-message-exception-twitter-badrequest/248129>\
**Category:** Logstash\
**Created:** [September 10, 2020, 8:14am UTC](https://discuss.elastic.co/t/twitter-plugin-twitter-client-error-message-exception-twitter-badrequest/248129 "2020-09-10T08:14:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HansPeterSloot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hanspetersloot/32/51132_2.png) [@HansPeterSloot](https://discuss.elastic.co/u/HansPeterSloot)\
**Post date:** [September 10, 2020, 8:14am UTC](https://discuss.elastic.co/t/twitter-plugin-twitter-client-error-message-exception-twitter-badrequest/248129/1 "2020-09-10T08:14:02Z")

</div>

Hi

My version of elasticsearch, logstash is 7.9.1  
I am trying to get the twitter input plugin working.

My input config is:  
input {  
twitter {  
consumer\_key =\> "aaaa"  
consumer\_secret =\> "bbb"  
oauth\_token =\> "ccc"  
oauth\_token\_secret =\> "ddd"  
keywords =\> ["elections"]  
full\_tweet =\> true  
ignore\_retweets =\> true  
proxy\_address =\> "161.89.61.209"  
proxy\_port =\> 8080  
use\_proxy =\> true  
}  
}

I get the following messages:

`[WARN] 2020-09-10 09:58:14.952 [[main]<twitter] twitter - Twitter client error {:message=>"", :exception=>"Twitter::Error::BadRequest", :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/twitter-6.2.0/lib/twitter/streaming/response.rb:24:in `on\_headers\_complete'", "org/ruby\_http\_parser/RubyHttpParser.java:370:in `<<'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/twitter-6.2.0/lib/twitter/streaming/response.rb:19:in `\<\<'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/twitter-6.2.0/lib/twitter/streaming/connection.rb:20:in `stream'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/twitter-6.2.0/lib/twitter/streaming/client.rb:119:in `request'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/twitter-6.2.0/lib/twitter/streaming/client.rb:38:in `filter'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-twitter-4.0.1/lib/logstash/inputs/twitter.rb:137:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/java\_pipeline.rb:378:in `inputworker'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:369:in `block in start\_input'"], :options=\>nil}`

And:  
[WARN] 2020-09-10 09:58:15.456 [[main]\<twitter] twitter - Twitter client error {:message=\>"undefined method `filter' for nil:NilClass", :exception=>"NoMethodError", :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-twitter-4.0.1/lib/logstash/inputs/twitter.rb:137:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/java\_pipeline.rb:378:in `inputworker'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:369:in `block in start\_input'"], :options=\>nil}

What am I doing wrong?

I verified my keys that they are working with a python script.

Regards Hans

---

<div class="post-metadata">

**Author:** ![kares](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kares/32/70705_2.png) [@kares](https://discuss.elastic.co/u/kares)\
**Post date:** [September 11, 2020, 5:28pm UTC](https://discuss.elastic.co/t/twitter-plugin-twitter-client-error-message-exception-twitter-badrequest/248129/2 "2020-09-11T17:28:32Z")

</div>

Hey Hans, did you by any chance try with the proxy disabled?

If the python script works with the same credentials, some proxy interference (changing/dropping a header) might be of an issue - would be worth a quick test to switch `use_proxy => false`.

---

<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:** [October 9, 2020, 5:28pm UTC](https://discuss.elastic.co/t/twitter-plugin-twitter-client-error-message-exception-twitter-badrequest/248129/3 "2020-10-09T17:28:42Z")

</div>

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