Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot install index template #144

Closed
PSjoe opened this issue May 31, 2022 · 0 comments · Fixed by #146
Closed

[BUG] Cannot install index template #144

PSjoe opened this issue May 31, 2022 · 0 comments · Fixed by #146
Labels
bug Something isn't working
Milestone

Comments

@PSjoe
Copy link

PSjoe commented May 31, 2022

Describe the bug
When trying to install an index template using Logstash 7.17 or 8.2 and the opensearch plugin to an AWS Opensearch cluster, we get the following error message:

[2022-05-31T14:30:41,259][INFO ][logstash.outputs.opensearch][main] Using mapping template from {:path=>"/etc/logstash/es-templates/finance-reporting-tool-v1.json"}
[2022-05-31T14:30:41,362][WARN ][logstash.outputs.opensearch][main] Restored connection to OpenSearch instance {:url=>"https://search-purestake-main-cluster-u42s23ct42suzqq4dzjd65biga.us-east-2.es.amazonaws.com:443/"}
[2022-05-31T14:30:41,417][INFO ][logstash.outputs.opensearch][main] Installing OpenSearch template {:name=>"finance-reporting-tool-v1"}
[2022-05-31T14:30:41,433][INFO ][logstash.outputs.opensearch][main] Cluster version determined (7.10.2) {:version=>7}
[2022-05-31T14:30:41,449][ERROR][logstash.outputs.opensearch][main] Failed to install template {:message=>"bad component(expected absolute path component): _template/finance-reporting-tool-v1",

To Reproduce
Steps to reproduce the behavior:

  1. Install logstash 8.2.2 or logstash 7.17.3
  2. Install plugin logstash-output-opensearch (1.2.0)
  3. Configure an output such as:
  opensearch {
      hosts => ["https://redacted.es.amazonaws.com:443"]
      auth_type => {
        type => 'aws_iam'
        aws_access_key_id => 'redacted'
        aws_secret_access_key => 'redacted'
        region => 'us-east-2'
      }
      index => "prod-logs-v1-%{+YYYY.MM}"
      template => "/etc/logstash/es-templates/prod-logs-v1.json"
      template_name => 'prod-logs-v1'
      template_overwrite => true
    }
  1. Error will show up when logstash starts.

Expected behavior
Index template should be installed

Plugins
logstash-output-opensearch (1.2.0)

Host/Environment (please complete the following information):

  • Logstash docker image
  • Version 8.2.2

Full Error Message

Failed to install template {:message=>"bad component(expected absolute path component): _template/prod-k8s-default-v1", :exception=>URI::InvalidComponentError, :backtrace=>["/usr/share/logstash/vendor/jruby/lib/ruby/stdlib/uri/generic.rb:771:in `check_path'", "/usr/share/logstash/vendor/jruby/lib/ruby/stdlib/uri/generic.rb:819:in `path='", "/usr/share/logstash/vendor/jruby/lib/ruby/stdlib/uri/generic.rb:193:in `initialize'", "/usr/share/logstash/vendor/jruby/lib/ruby/stdlib/uri/generic.rb:138:in `build'", "/usr/share/logstash/vendor/jruby/lib/ruby/stdlib/uri/http.rb:62:in `build'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/http_client/manticore_adapter.rb:176:in `sign_aws_request'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/http_client/manticore_adapter.rb:154:in `perform_request'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/http_client/pool.rb:270:in `perform_request_to_url'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/http_client/pool.rb:257:in `block in perform_request'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/http_client/pool.rb:346:in `with_connection'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/http_client/pool.rb:256:in `perform_request'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/http_client/pool.rb:264:in `block in Pool'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/http_client.rb:388:in `template_put'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/http_client.rb:82:in `template_install'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/template_manager.rb:37:in `install'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch/template_manager.rb:25:in `install_template'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch.rb:412:in `install_template'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch.rb:247:in `finish_register'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/outputs/opensearch.rb:224:in `block in register'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-opensearch-1.2.0-java/lib/logstash/plugin_mixins/opensearch/common.rb:83:in `block in after_successful_connection'"]}
@PSjoe PSjoe added bug Something isn't working untriaged labels May 31, 2022
@deepdatta deepdatta added this to the v1.3 milestone Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants