Skip to content

Specifying script source with [inline] is deprecated #147

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

Closed
brostad opened this issue Feb 2, 2018 · 7 comments
Closed

Specifying script source with [inline] is deprecated #147

brostad opened this issue Feb 2, 2018 · 7 comments

Comments

@brostad
Copy link

brostad commented Feb 2, 2018

I have recently downloaded and installed Search-Elasticsearch-6.00.tar.gz in order to be ready for a server upgrade from Elasticsearch 5.6 to 6.1 but when I run my unit tests, which includes creating and using an ingest pipeline for document indexing, I get lots of deprecated messages of this type:

[DEPRECATION] 299 Elasticsearch-5.6.4-8bbedf5 "Specifying script source with [inline] is deprecated, use [source] instead." "Fri, 02 Feb 2018 15:30:52 GMT". In request: {body => {description => "A pipeline for single document indexing",processors => [{set => {field => "processingtime_SINGLE",value => "{{_ingest.timestamp}}"}}]},ignore => [],method => "PUT",mime_type => "application/json",path => "/_ingest/pipeline/test_pipeline_single",qs => {},serialize => "std"}

When grep-ing through the source tree I see that Client/6_0/Direct.pm uses 'inline' which I suppose should have been 'source'. Is it possible to ask for a new version of Search-Elasticsearch-6 with this deprecated feature corrected?

@brostad
Copy link
Author

brostad commented Feb 2, 2018

The deprecation messages come when I add a new pipeline, fetch or delete an existing one. Here are all the inline occurences:

$ grep -ir inline share/perl/5.24.1/Search/
share/perl/5.24.1/Search/Elasticsearch/Client/6_0/Direct.pm:=item * with an inline script:
share/perl/5.24.1/Search/Elasticsearch/Client/6_0/Direct.pm:                inline => "ctx._source.counter += incr",
share/perl/5.24.1/Search/Elasticsearch/Client/6_0/Direct.pm:            inline => {
share/perl/5.24.1/Search/Elasticsearch/Client/6_0/Direct.pm:            inline => {
share/perl/5.24.1/Search/Elasticsearch/Client/6_0/Direct.pm:            { inline => { query => { match => { user => "{{user}}" }}} params => { user => 'joe' }},
share/perl/5.24.1/Search/Elasticsearch/Client/6_0/Direct.pm:            { inline => { query => { match => { user => "{{user}}" }}} params => { user => 'joe' }},
share/perl/5.24.1/Search/Elasticsearch/Client/6_0/Direct/Ingest.pm:The C<simulate()> method executes the pipeline specified by ID or inline in the body
share/perl/5.24.1/Search/Elasticsearch/Client/6_0/Direct/Ingest.pm:The C<simulate()> method executes the pipeline specified by ID or inline in the body

@clintongormley
Copy link
Contributor

Thanks for reporting. This is a docs change only.

@brostad
Copy link
Author

brostad commented Feb 5, 2018

I get the [DEPRECATION] Specifying script source with [inline] is deprecated, use [source] instead messages when I call the $e->ingest->put_pipeline(), fetch_pipeline() and delete_pipeline() methods, so it's not just the docs.

@clintongormley
Copy link
Contributor

@brostad Please could you show me some code to replicate this? The ES client doesn't do anything with request bodies, so I can only assume you're using a script somewhere that is specified with inline.

@clintongormley clintongormley reopened this Feb 5, 2018
@brostad
Copy link
Author

brostad commented Feb 6, 2018

I'm starting to believe this is an issue with Elasticsearch (5.6.4) rather than your Perl package as I've now been able to reproduce the same deprecation message directly in Kibana. Take for instance:

PUT _ingest/pipeline/my_test_pipeline
  {
   "processors" : [
      {
         "set" : {
            "field" : "processingtime", "value" : "{{_ingest.timestamp}}"
         }
      }
   ],
   "description" : "A pipeline for testing document processing"
}

There is no 'inline' parameter here but when I execute it in Kibana I get:

#! Deprecation: Specifying script source with [inline] is deprecated, use [source] instead.
{
  "acknowledged": true
}

So, even if I'm successful in adding the pipeline I get the deprecation message about the use of 'inline'.

I get the same error when I later delete the pipeline, so it seems as if there is an invisible 'inline' field somewhere in that pipeline block. The pipeline still works though, but this is very confusing and has led me on a wild goose chase for a couple of days.

After these recent results my conclusion must be that the Search::Elasticsearch package is fine and that my problem resides with the version of Elasticsearch that we currently use. I'm sorry for troubling you with this issue.

@brostad
Copy link
Author

brostad commented Feb 6, 2018

I finally solved the conundrum.

It was an old pipeline, defined with the 'inline' parameter, lingering in the test cluster but no longer used. It caused Elasticsearch to emit a deprecation warning every time I added, used or deleted a pipeline. As soon as I deleted the old pipeline all the other pipelines started working without deprecation warnings.

Thank you for your patience! Case closed :)

@clintongormley
Copy link
Contributor

@brostad thanks for reporting back. Please open an issue with a recreation at https://github.com/elastic/elasticsearch/issues because this behaviour is confusing, and should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants