Skip to content

[BUG] Improper status codes for snapshot executions #4687

@Bukhtawar

Description

@Bukhtawar

Describe the bug
A missing S3 bucket for the snapshot results on a 500 its possible that the bucket has been deleted after association.

{
    "error": {
        "root_cause": [
            {
                "type": "repository_exception",
                "reason": "[snapshot-name] could not read repository data from index blob"
            }
        ],
        "type": "repository_exception",
        "reason": "[snapshot-name] could not read repository data from index blob",
        "caused_by": {
            "type": "i_o_exception",
            "reason": "Exception when listing blobs by prefix [index-name]",
            "caused_by": {
                "type": "amazon_s3_exception",
                "reason": "amazon_s3_exception: The specified bucket does not exist (Service: Amazon S3; Status Code: 404; Error Code: NoSuchBucket; Request ID: V3DXMMJXXXXXX; S3 Extended Request ID: D7W3ThAkomdyqtKj0msy1g1Q/qpU0h9XXXXXXXX)"
            }
        }
    },
    "status": 500
}

Then a concurrent snapshot exception is a 503

public class ConcurrentSnapshotExecutionException extends SnapshotException {
public ConcurrentSnapshotExecutionException(final String repositoryName, final String snapshotName, final String msg) {
super(repositoryName, snapshotName, msg);
}
public ConcurrentSnapshotExecutionException(final Snapshot snapshot, final String msg) {
super(snapshot, msg);
}
public ConcurrentSnapshotExecutionException(StreamInput in) throws IOException {
super(in);
}
@Override
public RestStatus status() {
return RestStatus.SERVICE_UNAVAILABLE;
}

Expected behavior
Errors which are client side misconfiguration or client side operations which aren't supported based on the system's concurrency specification should be a 4xx

Metadata

Metadata

Assignees

Labels

CCICollege Contributor Initiative related issues and PRsbugSomething isn't workingdistributed frameworkgood first issueGood for newcomershacktoberfestGlobal event that encourages people to contribute to open-source.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions