voxpupuli / puppet-elasticsearch

Elasticsearch Puppet module
Apache License 2.0
404 stars 477 forks source link

plugins not installing when using a squid proxy #1030

Open worwoods opened 5 years ago

worwoods commented 5 years ago

Bug description

When attempting to install plugins through a proxy the proxy does not appear to be utilised.

elasticsearch::plugin { ['ingest-geoip','ingest-user-agent','analysis-icu', 'discovery-ec2' ]: 
    proxy_host => "proxy.${facts['networking']['domain']}",
    proxy_port => 8080,
}
tylerjl commented 5 years ago

Hmm, as far as I'm aware, the module should be passing through the requisite environment variables to make this work. Out of curiousity, which version of Elasticsearch is this for? In addition, performing a puppet run in which one of these plugins needs to be installed (by first, for example, uninstalling the plugin) and running the manifest application with --debug should also expose the command that Puppet executes, which should be defining -Dhttp.proxyHost and similar arguments.

worwoods commented 5 years ago

I'm seeing the following:

Debug: Elasticsearch_plugin[ingest-geoip](provider=elasticsearch_plugin): Commands: ["install", "--batch", "ingest-geoip"]
Debug: Executing: '/usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-geoip'
Debug: Elasticsearch_plugin[ingest-geoip](provider=elasticsearch_plugin): Failed to install plugin. Retrying... 1 of 3
Debug: Executing: '/usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-geoip'
Debug: Elasticsearch_plugin[ingest-geoip](provider=elasticsearch_plugin): Failed to install plugin. Retrying... 2 of 3
Debug: Executing: '/usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-geoip'
Debug: Elasticsearch_plugin[ingest-geoip](provider=elasticsearch_plugin): Failed to install plugin. Retrying... 3 of 3
Error: Could not set 'present' on ensure: Failed to install plugin. Received error: #<Puppet::ExecutionFailure: Execution of '/usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-geoip' returned 64: A tool for managing installed elasticsearch plugins

Commands
--------
list - Lists installed elasticsearch plugins
install - Install a plugin
remove - removes a plugin from Elasticsearch

Non-option arguments:
command              

Option         Description        
------         -----------        
-h, --help     show help          
-s, --silent   show minimal output
-v, --verbose  show verbose output
ERROR: Unknown plugin ingest-geoip> (file: /home/ec2-user/.puppetlabs/etc/code/modules/elasticsearch/manifests/plugin.pp, line: 134)
Error: Could not set 'present' on ensure: Failed to install plugin. Received error: #<Puppet::ExecutionFailure: Execution of '/usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-geoip' returned 64: A tool for managing installed elasticsearch plugins

Commands
--------
list - Lists installed elasticsearch plugins
install - Install a plugin
remove - removes a plugin from Elasticsearch

Non-option arguments:
command              

Option         Description        
------         -----------        
-h, --help     show help          
-s, --silent   show minimal output
-v, --verbose  show verbose output
ERROR: Unknown plugin ingest-geoip> (file: /home/ec2-user/.puppetlabs/etc/code/modules/elasticsearch/manifests/plugin.pp, line: 134)
Wrapped exception:
Failed to install plugin. Received error: #<Puppet::ExecutionFailure: Execution of '/usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-geoip' returned 64: A tool for managing installed elasticsearch plugins

Commands
--------
list - Lists installed elasticsearch plugins
install - Install a plugin
remove - removes a plugin from Elasticsearch

Non-option arguments:
command              

Option         Description        
------         -----------        
-h, --help     show help          
-s, --silent   show minimal output
-v, --verbose  show verbose output
ERROR: Unknown plugin ingest-geoip>
Error: /Stage[main]/Main/Elasticsearch::Plugin[ingest-geoip]/Elasticsearch_plugin[ingest-geoip]/ensure: change from 'absent' to 'present' failed: Could not set 'present' on ensure: Failed to install plugin. Received error: #<Puppet::ExecutionFailure: Execution of '/usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-geoip' returned 64: A tool for managing installed elasticsearch plugins

Commands
--------
list - Lists installed elasticsearch plugins
install - Install a plugin
remove - removes a plugin from Elasticsearch

Non-option arguments:
command              

Option         Description        
------         -----------        
-h, --help     show help          
-s, --silent   show minimal output
-v, --verbose  show verbose output
ERROR: Unknown plugin ingest-geoip> (file: /home/ec2-user/.puppetlabs/etc/code/modules/elasticsearch/manifests/plugin.pp, line: 134)
Notice: /Stage[main]/Main/Elasticsearch::Plugin[ingest-geoip]/File[/usr/share/elasticsearch/plugins/ingest-geoip]: Dependency Elasticsearch_plugin[ingest-geoip] has failures: true
Warning: /Stage[main]/Main/Elasticsearch::Plugin[ingest-geoip]/File[/usr/share/elasticsearch/plugins/ingest-geoip]: Skipping because of failed dependencies
Debug: /Stage[main]/Main/Elasticsearch
tylerjl commented 5 years ago

Thanks @RichardWorwood, that's helpful. Could you next: