Comments (4)
It is wierd. out_slack.rb
does require
slack_client.rb
and, it does require
net/http
at
Net::OpenTimeout
must be defined.
In my environment, irb tells like follows:
irb> Net::OpenTimeout
NameError: uninitialized constant Net
irb> require 'net/http'
irb> Net::OpenTimeout
Net::OpenTimeout
The ruby version was 2.1.2.
Could you tell me your td-agent version and its ruby version?
from fluent-plugin-slack.
I use system ruby 2.1.2 and td-agent 2.1.0(fluentd 0.10.53)
But fluentd use ruby 1.9.1.
fluentd's irb says
irb(main):001:0> Net::OpenTimeout
NameError: uninitialized constant Net
from (irb):1
from /usr/lib64/fluent/ruby/bin/irb:12:in `<main>'
irb(main):002:0> require 'net/http'
=> true
irb(main):003:0> Net::OpenTimeout
NameError: uninitialized constant Net::OpenTimeout
from (irb):3
from /usr/lib64/fluent/ruby/bin/irb:12:in `<main>'
And another try, I insert some debug logs in slack_client.rb
def post(endpoint, params)
log.info "@endpoint: ", endpoint
http = proxy_class.new(endpoint.host, endpoint.port)
http.use_ssl = (endpoint.scheme == 'https')
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http.set_debug_output(debug_dev) if debug_dev
log.info "@http: ", http
req = Net::HTTP::Post.new(endpoint)
log.info "@req: ", req
req['Host'] = endpoint.host
req['Accept'] = 'application/json; charset=utf-8'
req['User-Agent'] = 'fluent-plugin-slack'
req.body = encode_body(params)
res = http.request(req)
response_check(res, params)
end
and got a new log
2015-05-15 10:02:35 +0900 [info]: out_slack: post_message {:channel=>"#logs", :text=>"oooooooooooooo\n", :mrkdwn=>true, :link_names=>true}
2015-05-15 10:02:35 +0900 [info]: @endpoint: https://hooks.slack.com/services/xxxxx/xxxxx/xxxxxxxxxx
2015-05-15 10:02:35 +0900 [info]: @http: #<Net::HTTP:0x007f726ffbb268>
2015-05-15 10:02:35 +0900 [warn]: temporarily failed to flush the buffer. next_retry=2015-05-15 10:07:19 +0900 error_class="NameError" error="uninitialized constant Net::OpenTimeout" instance=70064779390100
2015-05-15 10:02:35 +0900 [warn]: /usr/lib64/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluent-plugin-slack-0.6.0/lib/fluent/plugin/out_slack.rb:131:in `rescue in write'
2015-05-15 10:02:35 +0900 [warn]: /usr/lib64/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluent-plugin-slack-0.6.0/lib/fluent/plugin/out_slack.rb:128:in `write'
2015-05-15 10:02:35 +0900 [warn]: /usr/lib64/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.53/lib/fluent/buffer.rb:296:in `write_chunk'
2015-05-15 10:02:35 +0900 [warn]: /usr/lib64/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.53/lib/fluent/buffer.rb:276:in `pop'
2015-05-15 10:02:35 +0900 [warn]: /usr/lib64/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.53/lib/fluent/output.rb:311:in `try_flush'
2015-05-15 10:02:35 +0900 [warn]: /usr/lib64/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.53/lib/fluent/output.rb:132:in `run'
no req output so Net::HTTP::Post.new(endpoint)
failed.
from fluent-plugin-slack.
@airtoxin I fixed fluent-plugin-slack to work with ruby 1.9.3. Could you try the latest version? It could work with 1.9.1 possibly although I won't support ruby 1.9.1 officially. 1.9.1, even 1.9.3 are end of life already.
from fluent-plugin-slack.
@sonots It works!
And I try to update td-agent newer one. Very thank you!
from fluent-plugin-slack.
Related Issues (20)
- Travis HOT 2
- Channel should not be mandatory when using a webhook HOT 2
- The specified key 'message' not found HOT 2
- Escaping < and > breaks formatted links
- Ability to use more than one slack plugin with custom icons/username options
- `encode' / "\xE3" from ASCII-8BIT to UTF-8 HOT 7
- Question: Use mulitple fields HOT 3
- [feature request] Nested attributes HOT 1
- can not find slack plugin HOT 1
- Can not find slack plugin
- Toward v2 HOT 2
- multi worker start failed HOT 2
- Line breaks in posted value are ignored HOT 1
- [feature request] support for color_key
- Truncating of messages
- Usage of /dev/null HOT 1
- `out_buffered_slack.rb` symlink is broken.
- multiple fluentd events are getting aggregated to single event; how to split it individual events ?
- multiple fluentd events are getting aggregated to single event
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluent-plugin-slack.