Skip to content
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

Email plugin crashed by "EOFError: End of file reached". #33

Closed
abcfy2 opened this issue Oct 24, 2015 · 5 comments
Closed

Email plugin crashed by "EOFError: End of file reached". #33

abcfy2 opened this issue Oct 24, 2015 · 5 comments

Comments

@abcfy2
Copy link

abcfy2 commented Oct 24, 2015

Here is logstash verbose output.

{:timestamp=>"2015-10-24T06:49:41.527000+0000", :message=>"Starting tcp input listener", :address=>"0.0.0.0:8888", :level=>:info}
{:timestamp=>"2015-10-24T06:49:41.552000+0000", :message=>"Create client to elasticsearch server on elasticsearch:", :level=>:info}
{:timestamp=>"2015-10-24T06:49:42.202000+0000", :message=>"Automatic template management enabled", :manage_template=>"true", :level=>:info}
{:timestamp=>"2015-10-24T06:49:42.481000+0000", :message=>"Using mapping template", :template=>{"template"=>"logstash-*", "settings"=>{"index.refresh_interval"=>"5s"}, "mappings"=>{"_default_"=>{"_all"=>{"enabled"=>true, "omit_norms"=>true}, "dynamic_templates"=><Java::JavaUtil::ArrayList:-1064940777 [{"message_field"=>{"match"=>"message", "match_mapping_type"=>"string", "mapping"=>{"type"=>"string", "index"=>"analyzed", "omit_norms"=>true}}}, {"string_fields"=>{"match"=>"*", "match_mapping_type"=>"string", "mapping"=>{"type"=>"string", "index"=>"analyzed", "omit_norms"=>true, "fields"=>{"raw"=>{"type"=>"string", "index"=>"not_analyzed", "ignore_above"=>256}}}}}]>, "properties"=>{"@version"=>{"type"=>"string", "index"=>"not_analyzed"}, "geoip"=>{"type"=>"object", "dynamic"=>true, "properties"=>{"location"=>{"type"=>"geo_point"}}}}}}}, :level=>:info}
{:timestamp=>"2015-10-24T06:49:42.649000+0000", :message=>"New Elasticsearch output", :cluster=>nil, :host=>["elasticsearch"], :port=>"9200", :embedded=>false, :protocol=>"http", :level=>:info}
{:timestamp=>"2015-10-24T06:49:43.542000+0000", :message=>"Pipeline started", :level=>:info}
Non US-ASCII detected and no charset defined.
Defaulting to UTF-8, set your own if this is incorrect.
EOFError: End of file reached
  read_nonblock at org/jruby/RubyIO.java:2860
      rbuf_fill at /opt/logstash/vendor/jruby/lib/ruby/1.9/net/protocol.rb:141
      readuntil at /opt/logstash/vendor/jruby/lib/ruby/1.9/net/protocol.rb:122
       readline at /opt/logstash/vendor/jruby/lib/ruby/1.9/net/protocol.rb:132
  recv_response at /opt/logstash/vendor/jruby/lib/ruby/1.9/net/smtp.rb:930
          getok at /opt/logstash/vendor/jruby/lib/ruby/1.9/net/smtp.rb:916
       critical at /opt/logstash/vendor/jruby/lib/ruby/1.9/net/smtp.rb:940
          getok at /opt/logstash/vendor/jruby/lib/ruby/1.9/net/smtp.rb:914
           quit at /opt/logstash/vendor/jruby/lib/ruby/1.9/net/smtp.rb:908
      do_finish at /opt/logstash/vendor/jruby/lib/ruby/1.9/net/smtp.rb:614
          start at /opt/logstash/vendor/jruby/lib/ruby/1.9/net/smtp.rb:523
       deliver! at /opt/logstash/vendor/bundle/jruby/1.9/gems/mail-2.6.3/lib/mail/network/delivery_methods/smtp.rb:112
       deliver! at /opt/logstash/vendor/bundle/jruby/1.9/gems/mail-2.6.3/lib/mail/message.rb:252
        receive at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-email-1.0.0/lib/logstash/outputs/email.rb:250
         handle at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.4-java/lib/logstash/outputs/base.rb:88
    output_func at (eval):104
   outputworker at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.4-java/lib/logstash/pipeline.rb:244
  start_outputs at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.4-java/lib/logstash/pipeline.rb:166

Logstash version: 1.5.4, and run in docker.

docker run command:

docker run \
    -d \
    --restart always \
    --name logstash \
    --link elasticsearch \
    -p 8888:8888 \
    -v /home/docker_data/logstash/conf/:/etc/logstash \
    logstash \
        logstash -f /etc/logstash/logstash.conf -v

And some content of logstash.conf:

output {
    elasticsearch {
        host => "elasticsearch"
            protocol => "http"
    }

    if "alert" in [tags] {
        email {
        to => "%{email_to}"
            from => "Logstash<hide@domain>"
            contenttype => "text/plain; charset=UTF-8"
            body => "%{message}"
            subject => "%{subject}"
            options => {
               smtpIporHost => "smtp.exmail.qq.com"
               userName => "hide@domain"
               password => "hide"
               authenticationType => "login"
            }
        }
    }
}

After delete the email config, logstash works very well.

@abcfy2
Copy link
Author

abcfy2 commented Oct 24, 2015

By the way. I've already set contenttype to UTF-8 charset, why logstash still output like this?

Non US-ASCII detected and no charset defined.
Defaulting to UTF-8, set your own if this is incorrect.

@abcfy2
Copy link
Author

abcfy2 commented Oct 24, 2015

I find the to in email could not use %{field_name}.

I change this attribute to a certain email address like FY<abcfy2@163.com>, it works.

@simmel
Copy link

simmel commented Oct 27, 2015

Run logstash with --debug and paste that log here.

Also, please use the stdout filter to print out your event just before the email filter so we can see how the event looks like.

@abcfy2
Copy link
Author

abcfy2 commented Oct 27, 2015

Strange. This issue doesn't appear again. But I will keep eye on my log.

But how to hide this message:

Non US-ASCII detected and no charset defined.
Defaulting to UTF-8, set your own if this is incorrect.

@jstoja
Copy link
Contributor

jstoja commented Jan 11, 2018

@jsvd I think this can be closed since @abcfy2 seem to have it fixed and it's mentioning Logstash 1.5.2.
It can probably be re-opened if the issue arise again.

@jsvd jsvd closed this as completed Jan 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants