micromasters icon indicating copy to clipboard operation
micromasters copied to clipboard

ReindexException: Unable to find index micromasters-ci_public_enrollment_default

Open sentry-io[bot] opened this issue 3 years ago • 5 comments

This has been going on for some time on CI.

Sentry Issue: MICROMASTERS-4V0

ReindexException: Unable to find index micromasters-ci_public_enrollment_default
  File "search/tasks.py", line 104, in index_users
    enrollments = [
  File "search/tasks.py", line 105, in <listcomp>
    enrollment for enrollment in enrollments if _document_needs_updating(enrollment)
  File "search/api.py", line 345, in document_needs_updating
    conn = get_conn()
  File "search/connection.py", line 76, in get_conn
    raise ReindexException("Unable to find index {index_name}".format(

sentry-io[bot] avatar Oct 05 '21 12:10 sentry-io[bot]

Do you think this can be closed?

pdpinch avatar Oct 18 '21 17:10 pdpinch

Do you think this can be closed?

Looked into the code as well and it was unlikely that some code change could have removed the indices that existed before so the indices might have been removed during some clean rebuild. This was fixed by running the recreate_index command on the CI instance of Micromasters. While running the recreate_index we saw some 502s but increasing the elastic search server timeout resolved the 502s. Running the recreate_index command added the missing indices.

Yes, this can be closed, We can reopen if we see it again.

arslanashraf7 avatar Oct 18 '21 19:10 arslanashraf7

This happened again. Do we need to run recreate_index again?

pdpinch avatar Nov 06 '21 13:11 pdpinch

This happened again. Do we need to run recreate_index again?

Yes, Ideally running the recreate_index should fix it and create the nonexistent indices.

arslanashraf7 avatar Nov 07 '21 00:11 arslanashraf7

Update, I've run the reindex again and it seems to have created the nonexistent indices, but I believe in light of this & this comments we'll have to add the recreate_index in the post deploy script in app.json & look into the Heroku build timeout OR see which app build(s) is deleting the indices because we are using the Same ES Instance for our RC/CI apps.

arslanashraf7 avatar Nov 08 '21 08:11 arslanashraf7