5.0alpha logstash-output-email

Trying to install the logstash-output-email plugin, but not working.

Can I get a lil help with trying to figure out what's up?

[root@logstash logstash]# bin/logstash-plugin install logstash-output-email
Validating logstash-output-email
Installing logstash-output-email
Plugin version conflict, aborting
ERROR: Installation Aborted, message: Bundler could not find compatible versions for gem "mail":
  In snapshot (Gemfile.lock):
    mail (= 2.6.4)

  In Gemfile:
    logstash-input-imap (>= 0) java depends on
      mail (~> 2.6.3) java

    logstash-output-email (>= 0) java depends on
      mail (= 2.6.3) java

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
Bundler could not find compatible versions for gem "logstash-core":
  In snapshot (Gemfile.lock):
    logstash-core (= 5.0.0.pre.alpha4)

  In Gemfile:
    logstash-core-plugin-api (>= 0) java depends on
      logstash-core (= 5.0.0.pre.alpha4) java

    logstash-output-email (>= 0) java depends on
      logstash-core (< 2.0.0, >= 1.4.0) java

    logstash-core (>= 0) java

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
Bundler could not find compatible versions for gem "logstash":
  In Gemfile:
    logstash-output-email (>= 0) java depends on
      logstash (< 2.0.0, >= 1.4.0) java
Could not find gem 'logstash (< 2.0.0, >= 1.4.0) java', which is required by gem 'logstash-output-email (>= 0) java', in any of the sources.
[root@logstash logstash]# 

java version

[root@logstash logstash]# java -version 
openjdk version "1.8.0_101"
OpenJDK Runtime Environment (build 1.8.0_101-b13)
OpenJDK 64-Bit Server VM (build 25.101-b13, mixed mode)
[root@logstash logstash]# 

I've got elasticsearch, logstash and kibana installed, all the 5.0 alpha4 version.

This happens with the --no-verify flag as well.

[root@logstash bin]# ./logstash-plugin install --no-verify logstash-output-email
Installing logstash-output-email
Plugin version conflict, aborting
ERROR: Installation Aborted, message: Bundler could not find compatible versions for gem "mail":
  In snapshot (Gemfile.lock):
    mail (= 2.6.4)

  In Gemfile:
    logstash-input-imap (>= 0) java depends on
      mail (~> 2.6.3) java

    logstash-output-email (>= 0) java depends on
      mail (= 2.6.3) java

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
Bundler could not find compatible versions for gem "logstash-core":
  In snapshot (Gemfile.lock):
    logstash-core (= 5.0.0.pre.alpha4)

  In Gemfile:
    logstash-core-plugin-api (>= 0) java depends on
      logstash-core (= 5.0.0.pre.alpha4) java

    logstash-output-email (>= 0) java depends on
      logstash-core (< 2.0.0, >= 1.4.0) java

    logstash-core (>= 0) java

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
Bundler could not find compatible versions for gem "logstash":
  In Gemfile:
    logstash-output-email (>= 0) java depends on
      logstash (< 2.0.0, >= 1.4.0) java
Could not find gem 'logstash (< 2.0.0, >= 1.4.0) java', which is required by gem 'logstash-output-email (>= 0) java', in any of the sources.
[root@logstash bin]# 

The issue here is a bug with the logstash-output-email plugin which is not officially supported. There is also a bug with the documentation generator not mentioning that on the official documentation.

The issue is that the output-email plugin requires an older version of the mail gem. You can work around this by running:

bin/logstash-plugin uninstall logstash-input-imap
bin/logstash-plugin install logstash-input-imap logstash-output-mail

We would greatly appreciate it if you or someone else could take the time to figure out why the email output is pinned to a specific version.

Thanks so much for this report @DreadPirateRob!

glad to help. I'm assuming this needs to be done in order for the output email to work?

Well, you can use the hacky uninstall/install workaround for now, but yes, it'd be better to fix the problem at its source :slight_smile:

Is there an email plugin that IS officially supported? Kinda seems like that should be a thing.

I just pushed a fix for this in a newly released gem for logstash-output-email.

Thanks for letting us know about this :slight_smile:

glad to help @andrewvc

how can I get that on my test VM?

bin/logstash-plugin install logstash-output-email should do the right thing. Alternatively you can upgrade with bin/logstash-plugin update logstash-output-email.

The correct version is 4.0.3 https://rubygems.org/gems/logstash-output-email

I haven't yet been able to install logstash-output-email, will the update get the correct version & install it?

What is the specific error your getting? It works fine for me with a fresh install:

~/Downloads $ tar -xzf logstash-5.0.0-alpha4.tar.gz
cd logstash⏎                                                                                                                                                                                           ~/Downloads $ cd logstash-5.0.0-alpha4/
~/D/logstash-5.0.0-alpha4 $ bin/logstash-plugin install logstash-output-email
Validating logstash-output-email
Installing logstash-output-email
Installation successful
~/D/logstash-5.0.0-alpha4 $

Specific error is in the first post.

Unless I need to redownload logstash or do a yum update logstash