question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using @Version gives error - version_type parameter value must be lowercase

See original GitHub issue

Elasticsearch expects version_type parameter value to be lowercase (case-sensitive), i.e. it should be “external”, not EXTERNAL. Gives error with ES 2.3 (and 2.4). Tested with AWS ES service and standalone.

Given:

@Document(indexName = "version-test")
public class MyDoc {
  ...
  @Version
  private Long version = 0L;
}

When: saving to index (using an ElasticsearchRepository)

Then:

2016-09-16 03:45:18.451 ERROR 68586 --- [           main] c.g.v.s.jest.JestElasticsearchTemplate   : Cannot execute jest action , response code : 400 , error : {"root_cause":[{"type":"illegal_argument_exception","reason":"No version type match [EXTERNAL]"}],"type":"illegal_argument_exception","reason":"No version type match [EXTERNAL]"} , message : null
2016-09-16 03:45:18.485 ERROR 68586 --- [           main] o.s.d.r.w.RepositoryRestExceptionHandler : Query can not be null.

Suggestion: see JestElasticsearchTemplate.java Line 1165 - convert to lowercase string (or use ordinal).

            if (query.getVersion() != null) {
                indexBuilder.setParameter(Parameters.VERSION, query.getVersion());
                indexBuilder.setParameter(Parameters.VERSION_TYPE, EXTERNAL);
            }

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ausovcommented, Sep 16, 2016

Yes, the current master works on my env now with Spring Boot 1.4 + ES 2.4 (embedded). Thank you!

0reactions
ruchichhabra009commented, Oct 10, 2017

Thanks @VanRoy I think I missed your upgrade. I will test my system now. If it works.

Thanks Ruchi

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker error: invalid reference format: repository name must ...
The problem here is that it is lower case, I'm not using any upper case letters anywhere in the image name and it's...
Read more >
When building in version 3.2.1 "repository name must be ...
Hi, since Docker for Desktop on Mac Version 3.2.1 the build fails with: ... it means is that docker repository names must be...
Read more >
Bash Reference Manual - GNU.org
The expansion is a string that is the value of parameter with lowercase alphabetic characters converted to uppercase.
Read more >
Groovy Language Documentation
This extra lenience allows using method or variable names that were not keywords in earlier versions of Groovy or are not keywords in...
Read more >
XSL Transformations (XSLT) Version 2.0 (Second Edition)
Please report errors in and submit comments on this document using ... the processor must signal the error, and the transformation fails.].
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found