-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined method 'peeraddr' for #<Fluent::PluginHelper::HttpServer::Request #10
Comments
What's most confusing to me is I'm struggling to find an update that would have caused this to stop working. I'm not a Ruby developer so it might be obvious, but it looks like the HTTP Server plugin helper request object hasn't changed since 2019 so I feel like I must be missing something given the update to the plugin in 2021. |
While testing, I also tried adding |
@dentonk Is this how your Dockerfile looks like? FROM fluent/fluentd:v1.16-debian-1
RUN apt-get update && apt-get install -y protobuf-compiler
RUN gem install fluent-plugin-protobuf-http If there's anything else, please do include that. Thanks! |
@iamazeem Thanks for the quick reply! I was starting from this guide, specifically the section "How to build your own image > 3.1 For current images > Debian version" so I have a few more steps in my Dockerfile, but I think those are primarily for cleanup:
Then I'm running the container with: |
Also, I just tested with the Alpine image following the same guide as above and I'm seeing the same error.
|
Tested locally on an Ubuntu 21.04 machine and
and, it works fine with both Ruby versions. This is the Dockerfile I used for this testing (using FROM fluent/fluentd:v1.16-debian-1
USER root
RUN \
apt-get update \
&& apt-get install -y protobuf-compiler \
&& gem install fluent-plugin-protobuf-http \
&& gem sources --clear-all \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem However, testing in the docker container did reproduce the issue that you're facing. After further inspection of the installed gems in the container I found out that there were both Uninstalling gem uninstall async-http IIRC, when I wrote this plugin, it was based on Anyways, you may proceed and verify this on your side. Here's the Dockerfile that worked for me for Debian: FROM fluent/fluentd:v1.16-debian-1
USER root
RUN \
apt-get update \
&& apt-get install -y protobuf-compiler \
&& gem install fluent-plugin-protobuf-http \
&& gem uninstall async-http \
&& gem sources --clear-all \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem Let me know if this works. |
Thank you so much for digging into this so quickly and your detailed explanation!! That seems to have done it! I missed that one little detail around I tested with both debian and alpine and was able to get it to work by uninstalling |
Awesome! You're welcome! 😄 I looked at the implementation of this plugin and indeed it's using the |
Updated README with #11. |
Description:
I get the error
undefined method 'peeraddr' for #<Fluent::PluginHelper::HttpServer::Request...
when trying to use the protobuf-http input plugin. If I hardcode apeeraddr
then it progresses to a similar messageundefined method 'header'...
. If I hardcode both thecontent_type
and thepeeraddr
, thus removing both of those method calls, the plugin seems to work as intended, minus actually performing the checks against the actual request peeraddr and headers.Reviewing both the documentation for the Fluentd HTTP Server plugin helper, as well as the code, I would agree with the error message, it does not look like those methods are available in the request object.
To Reproduce
Steps to reproduce the behavior:
fluent/fluentd:v1.16-debian-1
Docker imageapt-get install -y protobuf-compiler
andRUN gem install fluent-plugin-protobuf-http
to the DockerFilefluentd.conf
The text was updated successfully, but these errors were encountered: