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

Improve IndexNotFoundException message - specify the index name #34628

Closed
atapin opened this issue Oct 19, 2018 · 8 comments

Comments

@atapin
Copy link
Contributor

commented Oct 19, 2018

Currently I see the following stacktrace in logs: Caused by: org.elasticsearch.index.IndexNotFoundException: no such index. This makes finding a root cause hard in case of multiple indices. I suggest to populate the default error message with a missing index name:

class IndexNotFoundException ... {
    public IndexNotFoundException(String index, Throwable cause) {
        super("no such index: " + index , cause);
        setIndex(index);
    }

    public IndexNotFoundException(Index index, Throwable cause) {
        super("no such index: " + index.toString(), cause);
        setIndex(index);
    }
}
@elasticmachine

This comment has been minimized.

Copy link
Collaborator

commented Oct 19, 2018

@s1monw

This comment has been minimized.

Copy link
Contributor

commented Oct 19, 2018

we include the index already in the toString etc. in ElasticsearchException. I still think it makes sense to include it in the way you suggested. do you wanna open a PR for this?

@atapin

This comment has been minimized.

Copy link
Contributor Author

commented Oct 19, 2018

@s1monw yes, sounds great.

atapin added a commit to atapin/elasticsearch that referenced this issue Oct 19, 2018
Improved IndexNotFoundException's default error message
by including the missing index name. Fixes elastic#34628.
@atapin

This comment has been minimized.

Copy link
Contributor Author

commented Oct 19, 2018

@s1monw I'm getting the error on gradle check:

FAILURE: Build failed with an exception.

* What went wrong:
JAVA7_HOME required to run tasks:
  :modules:reindex:oldEs2Fixture
  :modules:reindex:oldEs1Fixture
  :modules:reindex:oldEs090Fixture

Are these tasks mandatory? May be they can be skipped somehow.

@s1monw

This comment has been minimized.

Copy link
Contributor

commented Oct 19, 2018

@atapin I think we are making progress to not require java7 for it. at this point it's necessary. You can just go and open a PR and we run tests for you on there.

@s1monw

This comment has been minimized.

Copy link
Contributor

commented Oct 19, 2018

this is issue is related #34341

@atapin

This comment has been minimized.

Copy link
Contributor Author

commented Oct 19, 2018

@s1monw done

@s1monw

This comment has been minimized.

Copy link
Contributor

commented Oct 20, 2018

@atapin we removed that java 7 requirement here #34646
you should be able to run the build now.

atapin added a commit to atapin/elasticsearch that referenced this issue Oct 22, 2018
Improved IndexNotFoundException's default error message
by including the missing index name. Fixes elastic#34628.
atapin added a commit to atapin/elasticsearch that referenced this issue Oct 23, 2018
Improved IndexNotFoundException's default error message
by including the missing index name. Fixes elastic#34628.
atapin added a commit to atapin/elasticsearch that referenced this issue Oct 24, 2018
Improved IndexNotFoundException's default error message
by including the missing index name. Fixes elastic#34628.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.