Error log: You’ll see this error when you try to take a snapshot, restore from one, or list your snapshots, but you reference a repository that OpenSearch doesn’t know about.
JSON
None
{
"error": {
"root_cause": [
{
"type": "repository_missing_exception",
"reason": "[my_s3_backup_repo] missing" // <-- The repo name
}
],
"type": "repository_missing_exception",
"reason": "[my_s3_backup_repo] missing"
},
"status": 404
}
Why… is this happening? This is a simple “Not Found” error for snapshot repositories. Before you can save (snapshot) or load (restore) data, you must register a repository. This repository is a one-time setup that tells OpenSearch where to store the snapshot data (e.g., an S3 bucket, an Azure Blob Storage container, or a shared filesystem path).
This error means you tried to use a repository (e.g., PUT /_snapshot/my_s3_backup_repo/snapshot_1) but OpenSearch has no repository registered with that name.
Common causes:
- Simple typo: You misspelled the repository name.
- You never registered it: You’re trying to take a snapshot but skipped the step of creating the repository first.
- Cluster restart (for some types): If you’re using a shared filesystem (type: fs) repository, you must register it in
opensearch.ymlon all cluster manager and data nodes. If you only registered it via the API (a “transient” setting), it might be lost on a full cluster restart. (Note: S3/Azure repos are “persistent” and survive restarts).
Best Practice:
1. List your repositories: First, check which repositories OpenSearch actually knows about.
Bash
None
GET /_snapshot/_all?v
2. Or just get a specific one (this will 404 if it’s missing):
Bash
None
GET /_snapshot/my_s3_backup_repo
3. Register your repository: You need to do this only once per repository. This example is for an S3 bucket.
- Step 1: Install the plugin:
sudo bin/opensearch-plugin install repository-s3(and restart nodes). - Step 2: Add your S3 credentials to the keystore:
Bash
None
bin/opensearch-keystore add s3.client.default.access_key
bin/opensearch-keystore add s3.client.default.secret_key
- Step 3: Register the repository via the API:
JSON
None
PUT /_snapshot/my_s3_backup_repo
{
"type": "s3",
"settings": {
"bucket": "my-opensearch-snapshot-bucket-name",
"region": "us-east-1"
}
}
4. Verify it: After registering, run POST /_snapshot/my_s3_backup_repo/_verify to confirm OpenSearch can connect to and write to the repository.
What else can I do? Having trouble with snapshot repository permissions (like S3 IAM roles or filesystem permissions)? This is the most common hurdle. Check the official documentation for your repository type (repository-s3, repository-azure, etc.) or ask the OpenSearch community. For direct help, contact us in The OpenSearch Slack Channel in #General.