Skip to content
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

[CCR] The stats for an unknown index return a 200 status #37021

Closed
sebelga opened this issue Dec 28, 2018 · 3 comments
Closed

[CCR] The stats for an unknown index return a 200 status #37021

sebelga opened this issue Dec 28, 2018 · 3 comments
Assignees
Labels
>bug :Distributed Indexing/CCR Issues around the Cross Cluster State Replication features

Comments

@sebelga
Copy link
Contributor

sebelga commented Dec 28, 2018

When we try to access the stats for a follower index that does not exist, we receive a 200 status with the following response

GET /unknown/_ccr/stats

Status 200
{
    "indices": []
}

To be consistent with other APIs and follow REST standards, it should return a 404 status.

If we try the same with the /_stats API we do get the correct status

GET /unknown/_stats

Response
{
    "error": {
        "root_cause": [
            {
                "type": "index_not_found_exception",
                "reason": "no such index [unknown]",
                "resource.type": "index_or_alias",
                "resource.id": "unknown",
                "index_uuid": "_na_",
                "index": "unknown"
            }
        ],
        "type": "index_not_found_exception",
        "reason": "no such index [unknown]",
        "resource.type": "index_or_alias",
        "resource.id": "unknown",
        "index_uuid": "_na_",
        "index": "unknown"
    },
    "status": 404
}
@sebelga sebelga added the :Distributed Indexing/CCR Issues around the Cross Cluster State Replication features label Dec 28, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

@sebelga sebelga changed the title [CCR] The stats on an unknown index return a 200 status [CCR] The stats for an unknown index return a 200 status Dec 28, 2018
@kradygithub
Copy link

kradygithub commented Dec 31, 2018 via email

@martijnvg martijnvg added the >bug label Jan 7, 2019
@martijnvg
Copy link
Member

@sebelga Makes sense, this should be fixed.

@martijnvg martijnvg self-assigned this Jan 7, 2019
martijnvg added a commit to martijnvg/elasticsearch that referenced this issue Jan 8, 2019
non existing indices.

Currently it returns an empty response with a 200 response code.

Closes elastic#37021
martijnvg added a commit that referenced this issue Jan 22, 2019
…existing index (#37220)

Currently it returns an empty response with a 200 response code.

Closes #37021
martijnvg added a commit that referenced this issue Jan 22, 2019
…existing index (#37220)

Currently it returns an empty response with a 200 response code.

Closes #37021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed Indexing/CCR Issues around the Cross Cluster State Replication features
Projects
None yet
Development

No branches or pull requests

4 participants