Logstash: NullpointerException when Environment-Variable http_proxy is set but empty

Created on 8 May 2017  Â·  5Comments  Â·  Source: elastic/logstash

Hi,

i get following error when i try to execute logstash-plugin:

./logstash-5.4.0$ bin/logstash-plugin 
java/util/Hashtable.java:459:in `put': java.lang.NullPointerException
        from java/util/Properties.java:166:in `setProperty'
        from java/lang/System.java:796:in `setProperty'
        from java/lang/reflect/Method.java:498:in `invoke'
        from /home/jupp/entwicklung/software/elastic/5.4.0/logstash-5.4.0/lib/pluginmanager/proxy_support.rb:40:in `apply_env_proxy_settings'
        from /home/jupp/entwicklung/software/elastic/5.4.0/logstash-5.4.0/lib/pluginmanager/proxy_support.rb:62:in `configure_proxy'
        from /home/jupp/entwicklung/software/elastic/5.4.0/logstash-5.4.0/lib/pluginmanager/main.rb:26:in `(root)'

My Java:

java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

My System:

Debian 9.0 4.9.0-2-amd64 #1 SMP Debian 4.9.18-1 (2017-03-30) x86_64 GNU/Linux

I am not using a proxy, but my env_vars are set and empty (Standard on debian??)

$: env | grep proxy
https_proxy=
http_proxy=
ftp_proxy=

When I unset die Environment-Variable the Exception is not thrown.
This issue affects only Logstash 5.4.0. Logstash 5.3.1 works fine in this situation.

plugin manager

Most helpful comment

If you have set your environment variable http_proxy or https_proxy as http.proxy.xyz.com:8080 then Logstash will throw error. If it is http://http.proxy.xyz.com:8080 then Logstash works fine

All 5 comments

I will work on a fix to include it in 5.4.1.

confirmed

 ph@sashimi  ~/es/logstash   master ± export https_proxy=""
 ph@sashimi  ~/es/logstash   master ± bin/logstash-plugin list
java/util/Hashtable.java:459:in `put': java.lang.NullPointerException
    from java/util/Properties.java:166:in `setProperty'
    from java/lang/System.java:796:in `setProperty'
    from java/lang/reflect/Method.java:498:in `invoke'
    from /Users/ph/es/logstash/lib/pluginmanager/proxy_support.rb:40:in `apply_env_proxy_settings'
    from /Users/ph/es/logstash/lib/pluginmanager/proxy_support.rb:69:in `configure_proxy'
    from /Users/ph/es/logstash/lib/pluginmanager/main.rb:26:in `(root)'

This issue still exists in Logstash 5.4.3

-bash-4.2$ ./logstash-plugin install --version 4.1.1 logstash-input-kafka
Validating logstash-input-kafka-4.1.1
Unable to download data from https://rubygems.org - SocketError: Network is unreachable (https://api.rubygems.org/specs.4.8.gz)
ERROR: Installation aborted, verification failed for logstash-input-kafka 4.1.1
-bash-4.2$ export https_proxy=myproxy:port
-bash-4.2$ ./logstash-plugin install --version 4.1.1 logstash-input-kafka
java/util/Hashtable.java:459:in `put': java.lang.NullPointerException
        from java/util/Properties.java:166:in `setProperty'
        from java/lang/System.java:796:in `setProperty'
        from java/lang/reflect/Method.java:497:in `invoke'
        from /apps/logstash-5.4.3/lib/pluginmanager/proxy_support.rb:40:in `apply_env_proxy_settings'
        from /apps/logstash-5.4.3/lib/pluginmanager/proxy_support.rb:79:in `configure_proxy'
        from /apps/logstash-5.4.3/lib/pluginmanager/main.rb:26:in `(root)'

If you have set your environment variable http_proxy or https_proxy as http.proxy.xyz.com:8080 then Logstash will throw error. If it is http://http.proxy.xyz.com:8080 then Logstash works fine

3q @alamzeeshan
I meet the same question as you. And I fix it as you say to add 'http://' in the front of my env variable.

Was this page helpful?
0 / 5 - 0 ratings