Skip to content

Conversation

infrahead
Copy link

Otherwise user must explicitly set when using client to avoid an error (InvalidIndexNameException[[_snapshot] Invalid index name [snapshot], must not start with '']) which seems like a bug.

rustyedges added 2 commits May 31, 2014 16:50
Default method should be PUT as using POST results in an error...InvalidIndexNameException[[_snapshot] Invalid index name [_snapshot], must not start with '_']
Default method should be PUT as using POST results in an error...InvalidIndexNameException[[_snapshot] Invalid index name [_snapshot], must not start with '_']
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 4f1b2c2 on rustyedges:2.2 into d63aa0c on elasticsearch:2.2.

@spalger
Copy link
Contributor

spalger commented Jul 9, 2014

@rustyedges two things here:

  1. Can you ensure that you have set the apiVersion config parameter correctly?
  2. API definitions are stored in the core elasticsearch repository. If the POST method does not work for the createSnapshot endpoint then it should be removed from the spec which will result in an update to all of the clients.

@spalger spalger closed this Jul 9, 2014
@cblanc
Copy link
Contributor

cblanc commented Nov 24, 2014

Any chance of opening this issue again?

I'm on Elasticsearch 1.4, using elasticsearch-js 3.0.0 and apiVersion is set to "master".

I'm experiencing the same error:

InvalidIndexNameException[[_snapshot] Invalid index name [_snapshot], must not start with '_']

Debug log:

Elasticsearch DEBUG: 2014-11-24T23:12:03Z
  starting request { method: 'POST',
    path: '/_snapshot/reponame/snapshotname',
    query: { wait_for_completion: true } }

Elasticsearch DEBUG: 2014-11-24T23:12:03Z
  Request complete

Which is caused by:

elasticClient.snapshot.create({
  repository: reponame,
  snapshot: snapshotname,
  waitForCompletion: true
  }, function (error, result) {
  // Handle result      
});

I tried the same method using curl and wound up with the same error:

$ curl -X POST localhost:9200/_snapshot/reponame/snapshotname

{"error":"InvalidIndexNameException[[_snapshot] Invalid index name [_snapshot], must not start with '_']","status":400}

But I got a successful response using PUT instead of POST

curl -X PUT localhost:9200/_snapshot/reponame/snapshotname

{"accepted":true}

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

Successfully merging this pull request may close these issues.

4 participants