Skip to content

Wrong exception thrown when snapshot doesn't exist #86

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
msonnabaum opened this issue May 22, 2014 · 1 comment
Closed

Wrong exception thrown when snapshot doesn't exist #86

msonnabaum opened this issue May 22, 2014 · 1 comment
Assignees
Milestone

Comments

@msonnabaum
Copy link

My test code uses the "fs" snapshot repository type, and I rescue Elasticsearch::Transport::Transport::Errors::NotFound when a snapshot doesn't exist. I ran the same code with the s3 backend, and got a Elasticsearch::Transport::Transport::Errors::InternalServerError instead:

{
  "error":"SnapshotException[[repository_name:index_prefix-2014.05.18] failed to get snapshots]; nested: IOException[Failed to get [snapshot-index_prefix-2014.05.18]]; nested: AmazonS3Exception[Status Code: 404, AWS Service: Amazon S3, AWS Request ID: 7B94A86E8FDBCE53, AWS Error Code: NoSuchKey, AWS Error Message: The specified key does not exist.];",
  {
    "error":"SnapshotException[[repository_name:index_prefix-2014.05.18] failed to get snapshots]; nested: IOException[Failed to get [snapshot-index_prefix-2014.05.18]]; nested: AmazonS3Exception[Status Code: 404, AWS Service: Amazon S3, AWS Request ID: 7B94A86E8FDBCE53, AWS Error Code: NoSuchKey, AWS Error Message: The specified key does not exist.];",
    "status":500
  }
  "status":500
} (Elasticsearch::Transport::Transport::Errors::InternalServerError)InternalServerError

Since the code amazon is returning is 404, I'm assuming this is a bug?

@dadoonet
Copy link
Member

@msonnabaum I agree. We need to fix that and have consistent answers whatever the repository is. PR #108 fix that.

@dadoonet dadoonet changed the title Wrong exception thrown when snapshot doesn't exist? Wrong exception thrown when snapshot doesn't exist Jul 30, 2014
dadoonet added a commit to elastic/elasticsearch-cloud-azure that referenced this issue Jul 30, 2014
As for elastic/elasticsearch-cloud-aws#86, we should raise a `SnapshotMissingException`.

Closes #23.
dadoonet added a commit to elastic/elasticsearch-cloud-azure that referenced this issue Jul 30, 2014
As for elastic/elasticsearch-cloud-aws#86, we should raise a `SnapshotMissingException`.

Closes #23.

(cherry picked from commit 61ddb60)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants