Logstash: env http_proxy setting ignored on logstash-plugin

Created on 1 Feb 2017  路  6Comments  路  Source: elastic/logstash

Hi,

While installing logstash-filter-elasticsearch behind a proxy I found that when I set http_proxy= it is being ignored during install and returns an error "connection refused"

After looking around @google I found that when I extend JRUBY_OPTS with -J-Dhttp.proxyHost=proxy.server -J-Dhttp.proxyPort=1234 I can install plugins from behind a proxy server.

Topic on the forum is here:
https://discuss.elastic.co/t/plugin-not-found/73472/3

  • logstash 5.2.0
  • Ubuntu 16.04.1 LTS
  • openjdk version "1.8.0_121"

If you require any more information please let me know.

Regard,
Paul Janzen.

bug plugin manager

Most helpful comment

I am having the same problem, reference to #6044 where this is supposed to be fixed

  • Centos 6
  • logstash 5.2
  • openjdk version "1.8.0_121"

HTTPS_PROXY environement variable is completely ignored
JRUBY_OPTS="-J-Dhttp.proxyHost=proxy -J-Dhttp.proxyPort=3128" manage to get the plugin installation started but as soon as the dependecy part start i can see it tried to connect directly to the internet on https and fail

tcp 0 0 10.0.1.97:57734 10.0.1.254:3128 ESTABLISHED 19410/java
tcp 0 0 10.0.1.97:57736 10.0.1.254:3128 ESTABLISHED 19410/java
tcp 0 1 10.0.1.97:45970 151.101.16.215:443 SYN_SENT 20207/java

Using a combination of "JRUBY_OPTS" and .m2/settings seems to do the trick ... exactly as in 5.1.2 in #6044

For reference this is what i need to do to make it work:

/usr/bin/sudo -u logstash -H /bin/env https_proxy=http://proxy:3128 HTTPS_PROXY=http://proxy:3128 JRUBY_OPTS="-J-Dhttp.proxyHost=proxy -J-Dhttp.proxyPort=3128" DEBUG=1 /usr/share/logstash/bin/logstash-plugin install logstash-filter-de_dot

and

$ cat .m2/settings.xml
<settings>
  <proxies>
   <proxy>
      <id>proxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy</host>
      <port>3128</port>
    </proxy>
  </proxies>
</settings>

to succesfully install aplugin

All 6 comments

We need an integration test for that, I am pretty sure it was fixed in a jar-dependencies releases that 5.2.0 includes.

I am having the same problem, reference to #6044 where this is supposed to be fixed

  • Centos 6
  • logstash 5.2
  • openjdk version "1.8.0_121"

HTTPS_PROXY environement variable is completely ignored
JRUBY_OPTS="-J-Dhttp.proxyHost=proxy -J-Dhttp.proxyPort=3128" manage to get the plugin installation started but as soon as the dependecy part start i can see it tried to connect directly to the internet on https and fail

tcp 0 0 10.0.1.97:57734 10.0.1.254:3128 ESTABLISHED 19410/java
tcp 0 0 10.0.1.97:57736 10.0.1.254:3128 ESTABLISHED 19410/java
tcp 0 1 10.0.1.97:45970 151.101.16.215:443 SYN_SENT 20207/java

Using a combination of "JRUBY_OPTS" and .m2/settings seems to do the trick ... exactly as in 5.1.2 in #6044

For reference this is what i need to do to make it work:

/usr/bin/sudo -u logstash -H /bin/env https_proxy=http://proxy:3128 HTTPS_PROXY=http://proxy:3128 JRUBY_OPTS="-J-Dhttp.proxyHost=proxy -J-Dhttp.proxyPort=3128" DEBUG=1 /usr/share/logstash/bin/logstash-plugin install logstash-filter-de_dot

and

$ cat .m2/settings.xml
<settings>
  <proxies>
   <proxy>
      <id>proxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy</host>
      <port>3128</port>
    </proxy>
  </proxies>
</settings>

to succesfully install aplugin

It's not working for me with a auth http proxy. I have added and on settings.xml and I have added -J-Dhttp.proxyUser= and -J-Dhttp.proxyPassword=

Any idea ?

primeroz, thx, it really helped me

Just to confirm this workaround does not work on RHEL 6.7 -- set .m2 file set env variables -- set JRUBY_OPTS still same errors as #6727. I'll have to go back to an earlier installation of logstash 2.4 with all plugins included in the tar file. Any chance we could get a similar all plugins included newer version of logstash. Possibly in RPM form so we can start as a service

The workaround above does not work for me either. The installation is starting with those parameters, but I get stuck with:
[ERROR] [ERROR] Some problems were encountered while processing the POMs: [FATAL] Non-parseable POM /usr/share/logstash/vendor/bundle/jruby/1.9/gems/jar-dependencies-0.3.10/lib/jars/gemspec_pom.rb: only whitespace content allowed before start tag and not e (position: START_DOCUMENT seen e... @1:1) @ line 1, column 1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ashangit picture ashangit  路  4Comments

dedemorton picture dedemorton  路  3Comments

cschotke picture cschotke  路  3Comments

packetrevolt picture packetrevolt  路  3Comments

simmel picture simmel  路  4Comments