Yes, this error would happen when you try loading the repository's index file, which happens before trying to create a snapshot.
I would recommend the following to get you out of your predicament:
- disconnect your two clusters from the repository
- In your repository, at the top level directory, you will see some
index-N
files, where N is some number... for example,index-0
,index-1
, etc. Delete all of theindex-N
files, but do not delete theindex
file which does not have a-N
after it. So keepindex
but delete allindex-N
blobs. - Create the repository in your 5.x cluster. This should generate fresh
index-N
files for you, based on the current state of the repository. - Now you can also create the repository in the 2.x cluster, just make sure you create it as
readonly
: see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html#_shared_file_system_repository for documentation on thereadonly
flag.