# 5.1.1: Plugin installation behind Proxy

**URL:** <https://discuss.elastic.co/t/5-1-1-plugin-installation-behind-proxy/70454>\
**Category:** Logstash\
**Created:** [January 3, 2017, 3:38pm UTC](https://discuss.elastic.co/t/5-1-1-plugin-installation-behind-proxy/70454 "2017-01-03T15:38:20Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)\
**Post date:** [January 3, 2017, 3:38pm UTC](https://discuss.elastic.co/t/5-1-1-plugin-installation-behind-proxy/70454/1 "2017-01-03T15:38:20Z")

</div>

Hi,  
I'm finding that plugin installation is failing from behind proxy. This has me wondering how proxying should be configured in the current version. Neither of these approaches are working for me:

```
# export HTTP_PROXY=http://<proxy_host>:<proxy_port>
# export HTTPS_PROXY=https://<proxy_host>:<proxy_port>
# /usr/share/logstash/bin/logstash-plugin install logstash-filter-zeromq

```

...or add jvm args to jam.options:

```
-DproxyHost=<proxy_host>
-DproxyPort=<proxy_port>

```

Neither works, generating this output instead:

`ERROR: Something went wrong when installing logstash-input-zeromq, message: Connection refused - Connection refused`

However, if I test internet connectivity from the command-line it works:

```
# wget --spider http://example.com
Spider mode enabled. Check if remote file exists.
--2017-01-03 15:05:18-- http://example.com/
Resolving proxy.ocado.com (proxy.ocado.com)... 192.168.253.50
Connecting to proxy.ocado.com (proxy.ocado.com)|192.168.253.50|:80... connected.
Proxy request sent, awaiting response... 200 OK
Length: 606 [text/html]
Remote file exists and could contain further links,
but recursion is disabled -- not retrieving

```

Would appreciate feedback/help here...

Regards,  
David

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 4, 2017, 7:44am UTC](https://discuss.elastic.co/t/5-1-1-plugin-installation-behind-proxy/70454/2 "2017-01-04T07:44:59Z")

</div>

Please format your code with the `</>` button, it’s very hard to read otherwise.

---

<div class="post-metadata">

**Author:** ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)\
**Post date:** [January 4, 2017, 8:05am UTC](https://discuss.elastic.co/t/5-1-1-plugin-installation-behind-proxy/70454/3 "2017-01-04T08:05:35Z")

</div>

Ok, done that...

---

<div class="post-metadata">

**Author:** ![jott](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@jott](https://discuss.elastic.co/u/jott)\
**Post date:** [January 4, 2017, 10:46am UTC](https://discuss.elastic.co/t/5-1-1-plugin-installation-behind-proxy/70454/4 "2017-01-04T10:46:05Z")

</div>

I am encountering the same issue here in a docker container where the entrypoint script ensures that certain plugins are installed prior to starting elasticsearch. This used to work end of November and now fails. As I am using the same version of Elasticsearch, I assume that it is not a change in the logstash-plugin code but something in the plugin repository changed which breaks our proxy connection.

---

<div class="post-metadata">

**Author:** ![Sandro\_Scanu](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@Sandro\_Scanu](https://discuss.elastic.co/u/Sandro_Scanu)\
**Post date:** [January 4, 2017, 12:21pm UTC](https://discuss.elastic.co/t/5-1-1-plugin-installation-behind-proxy/70454/5 "2017-01-04T12:21:55Z")

</div>

Same issue here, just looking for the plugins to download an install it with bin/logstash-plugin install --local {plugin} but cannot find the plugins.  
I'm also behind a proxy. bin/logstash-plugin list works...

---

<div class="post-metadata">

**Author:** ![Roland\_L](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@Roland\_L](https://discuss.elastic.co/u/Roland_L)\
**Post date:** [January 5, 2017, 12:22pm UTC](https://discuss.elastic.co/t/5-1-1-plugin-installation-behind-proxy/70454/6 "2017-01-05T12:22:15Z")

</div>

Same problem here. I'm using Logstash 5.1.1 and have set the proxy according to: [https://www.elastic.co/guide/en/logstash/current/working-with-plugins.html#proxy-plugins:](https://www.elastic.co/guide/en/logstash/current/working-with-plugins.html#proxy-plugins:)

```
root@server:/usr/share/logstash/bin# echo $http_proxy
http://proxy.host:3128
root@server:/usr/share/logstash/bin# echo $https_proxy
http://proxy.host:3128
root@server:/usr/share/logstash/bin# echo $HTTP_PROXY
http://proxy.host:3128
root@server:/usr/share/logstash/bin# echo $HTTPS_PROXY
http://proxy.host:3128

```

Trying to install the "multiline" plugin and I get a _Connection refused_:

```
root@server:/usr/share/logstash/bin# DEBUG=1 ./logstash-plugin install logstash-filter-multiline
DEBUG: exec /usr/share/logstash/vendor/jruby/bin/jruby --1.9 /usr/share/logstash/lib/pluginmanager/main.rb install logstash-filter-multiline
Looking if package named: logstash-filter-multiline exists at https://artifacts.elastic.co/downloads/logstash-plugins/logstash-filter-multiline/logstash-filter-multiline-5.1.1.zip
Errno::ECONNREFUSED: Connection refused - Connection refused
          initialize at org/jruby/ext/socket/RubyTCPSocket.java:126
                open at org/jruby/RubyIO.java:1197
             connect at /usr/share/logstash/vendor/jruby/lib/ruby/1.9/net/http.rb:763
             timeout at org/jruby/ext/timeout/Timeout.java:98
             connect at /usr/share/logstash/vendor/jruby/lib/ruby/1.9/net/http.rb:763
            do_start at /usr/share/logstash/vendor/jruby/lib/ruby/1.9/net/http.rb:756
               start at /usr/share/logstash/vendor/jruby/lib/ruby/1.9/net/http.rb:745
               start at /usr/share/logstash/vendor/jruby/lib/ruby/1.9/net/http.rb:557
               start at /usr/share/logstash/lib/pluginmanager/utils/http_client.rb:13
  remote_file_exist? at /usr/share/logstash/lib/pluginmanager/utils/http_client.rb:23
   get_installer_for at /usr/share/logstash/lib/pluginmanager/pack_fetch_strategy/repository.rb:27
              create at /usr/share/logstash/lib/pluginmanager/install_strategy_factory.rb:15
                each at org/jruby/RubyArray.java:1613
              create at /usr/share/logstash/lib/pluginmanager/install_strategy_factory.rb:14
             execute at /usr/share/logstash/lib/pluginmanager/install.rb:27
                 run at /usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67
             execute at /usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/subcommand/execution.rb:11
                 run at /usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67
                 run at /usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132
              (root) at /usr/share/logstash/lib/pluginmanager/main.rb:46
root@server:/usr/share/logstash/bin#

```

It seems that logstash-plugin is simply ignoring the proxy.

---

<div class="post-metadata">

**Author:** ![jott](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@jott](https://discuss.elastic.co/u/jott)\
**Post date:** [January 6, 2017, 3:01pm UTC](https://discuss.elastic.co/t/5-1-1-plugin-installation-behind-proxy/70454/7 "2017-01-06T15:01:44Z")

</div>

I accidentally installed the latest logstash version instead of the intended version. When I fixed that (thus reverting to 5.0.1), the plugin installation works again. I also had to set not only HTTP\_PROXY but also HTTPS\_PROXY for all plugins to succeed.

This looks like a regression to me (as it worked in 5.1.1) but I am not deep enough into logstash to determine whether this is due to plugin-install or the bundled jruby version.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 6, 2017, 11:10pm UTC](https://discuss.elastic.co/t/5-1-1-plugin-installation-behind-proxy/70454/8 "2017-01-06T23:10:47Z")

</div>

See [https://github.com/elastic/logstash/issues/6044](https://github.com/elastic/logstash/issues/6044) for the problem and some suggested workarounds.

This will be fixed in 5.2 though! 🙂

---

<div class="post-metadata">

**Author:** ![Roland\_L](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@Roland\_L](https://discuss.elastic.co/u/Roland_L)\
**Post date:** [January 9, 2017, 8:17am UTC](https://discuss.elastic.co/t/5-1-1-plugin-installation-behind-proxy/70454/9 "2017-01-09T08:17:21Z")

</div>

Thanks @warkolm! At least the download seems to work now, using:

```
export JRUBY_OPTS="-J-Dhttp.proxyHost=proxy.host -J-Dhttp.proxyPort=3128

```

Unfortunately I get a different error this time:

```
root@server:/usr/share/logstash/bin# ./logstash-plugin install logstash-filter-multiline
Validating logstash-filter-multiline
Installing logstash-filter-multiline
Error Bundler::InstallError, retrying 1/10
An error occurred while installing logstash-core-event-java (5.1.1), and Bundler cannot continue.
Make sure that `gem install logstash-core-event-java -v '5.1.1'` succeeds before bundling.
WARNING: SSLSocket#session= is not supported
^Croot@server:/usr/share/logstash/bin#

```

And if I try to use the suggested command, I get:

```
root@server:/usr/share/logstash/bin# gem install logstash-core-event-java -v '5.1.1'
ERROR: Could not find a valid gem 'logstash-core-event-java' (= 5.1.1) in any repository
```

---

<div class="post-metadata">

**Author:** ![ariel.s](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@ariel.s](https://discuss.elastic.co/u/ariel.s)\
**Post date:** [January 11, 2017, 8:09am UTC](https://discuss.elastic.co/t/5-1-1-plugin-installation-behind-proxy/70454/10 "2017-01-11T08:09:09Z")

</div>

Hi,  
I finally solved this issue!! i hope it helps you 😃

1. remove and re-install logstash-5.1.1 (start with pure package)
2. use follow script

> <https://gist.github.com/devlatte/fda1c57ed7a33daea73c8b00799d74a1>

---

<div class="post-metadata">

**Author:** ![Roland\_L](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@Roland\_L](https://discuss.elastic.co/u/Roland_L)\
**Post date:** [January 11, 2017, 10:25am UTC](https://discuss.elastic.co/t/5-1-1-plugin-installation-behind-proxy/70454/11 "2017-01-11T10:25:26Z")

</div>

Thanks! That works!

So it seems the only thing I was missing was **JARS\_SKIP='true'** - whatever that means...

Conclusion for 5.1.1:

1. you have to set the JRUBY\_OPTS for logstah-plugin to use the proxy
2. you have to set http\_proxy and https\_proxy for Ruby Gem (which is apparently called by logstash-plugin)
3. and you have to set JARS\_SKIP='true' also (for Ruby Gem?) for the installation to work

What a mess...

---

<div class="post-metadata">

**Author:** ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)\
**Post date:** [February 7, 2017, 12:13pm UTC](https://discuss.elastic.co/t/5-1-1-plugin-installation-behind-proxy/70454/12 "2017-02-07T12:13:18Z")

</div>

Can I have a definitive statement on the fix for this please? I've upgraded to 5.2.0 and i still cannot install plugins. And, the above workaround fails too:

```
# bin/logstash-plugin install logstash-filter-de_dot
Validating logstash-filter-de_dot
Installing logstash-filter-de_dot
Error Bundler::InstallError, retrying 1/10
An error occurred while installing logstash-core-event-java (5.2.0), and Bundler cannot continue.
Make sure that `gem install logstash-core-event-java -v '5.2.0'` succeeds before bundling.
WARNING: SSLSocket#session= is not supported

```

Regards,  
David

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 7, 2017, 12:13pm UTC](https://discuss.elastic.co/t/5-1-1-plugin-installation-behind-proxy/70454/13 "2017-03-07T12:13:27Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
