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

solrbackup s3- Incremental backup URI [s3:/solr-backup/] expected to hold a single directory. Number found: 0 #589

Closed
anilkhichar opened this issue Jul 12, 2023 · 1 comment

Comments

@anilkhichar
Copy link

anilkhichar commented Jul 12, 2023

Solrbckup is successful but can't list/restore from the backed up data in S3.

  • Solrbackup Setup
    kubectl edit solrcloud solr-prod

    backupRepositories:
    - name: "solr-backup-repo"
      s3:
        region: "us-west-2"
        bucket: "<solr-s3-bucket>"
    
  • SolrBackup

    ---
    apiVersion: solr.apache.org/v1beta1
    kind: SolrBackup
    metadata:
      name: "solr-backup"
    spec:
      repositoryName: "solr-backup-repo"
      solrCloud: "solr-prod"
      collections:
        - mycollection
    
    $ kubectl get solrbackups
    NAME             CLOUD        STARTED   FINISHED   SUCCESSFUL   NEXTBACKUP   AGE
    solr-backup   solr-prod           17m           true              true                      17m
    
  • LISTBACKUP (Failing here)

    curl -X POST http://localhost:8983/v2/collections/backups -H 'Content-Type: application/json' -d '
      {
        "list-backups" : {
          "name": "solr-backup",
          "repository": "solr-backup-repo",
          "location": "/"
        }
      }
    '
    
  • Error:

      {
      "responseHeader":{
        "status":500,
        "QTime":1270},
      "error":{
        "msg":"Incremental backup URI [s3:/solr-backup/] expected to hold a single directory. Number found: 0",
        "trace":"java.lang.IllegalStateException: Incremental backup URI [s3:/solr-backup/] expected to hold a single directory. Number found: 0\n\tat org.apache.solr.core.backup.BackupFilePaths.buildExistingBackupLocationURI(BackupFilePaths.java:172)\n\tat org.apache.solr.handler.admin.CollectionsHandler$CollectionOperation.lambda$static$35(CollectionsHandler.java:1547)\n\tat org.apache.solr.handler.admin.CollectionsHandler$CollectionOperation.execute(CollectionsHandler.java:1775)\n\tat org.apache.solr.handler.admin.CollectionsHandler.invokeAction(CollectionsHandler.java:245)\n\tat org.apache.solr.handler.admin.CollectionsHandler.handleRequestBody(CollectionsHandler.java:212)\n\tat org.apache.solr.handler.CollectionBackupsAPI.listBackups(CollectionBackupsAPI.java:55)\n\tat org.apache.solr.api.AnnotatedApi$Cmd.invoke(AnnotatedApi.java:310)\n\tat org.apache.solr.api.AnnotatedApi.call(AnnotatedApi.java:218)\n\tat org.apache.solr.api.V2HttpCall.handleAdmin(V2HttpCall.java:383)\n\tat org.apache.solr.servlet.HttpSolrCall.handleAdminRequest(HttpSolrCall.java:893)\n\tat org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:584)\n\tat org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)\n\tat java.base/java.lang.Thread.run(Unknown Source)\n",
        "code":500}}
    
@anilkhichar anilkhichar changed the title solrbackupseiifccvjnjuvkbrnigirnknliuvdrgtccjdtddvhrkkn - Incremental backup URI [s3:/solr-backup/] expected to hold a single directory. Number found: 0 solrbackup - Incremental backup URI [s3:/solr-backup/] expected to hold a single directory. Number found: 0 Jul 12, 2023
@anilkhichar anilkhichar changed the title solrbackup - Incremental backup URI [s3:/solr-backup/] expected to hold a single directory. Number found: 0 solrbackup s3- Incremental backup URI [s3:/solr-backup/] expected to hold a single directory. Number found: 0 Jul 12, 2023
@anilkhichar
Copy link
Author

anilkhichar commented Jul 13, 2023

Finally, I resolved it by adding collection name as suffix. Same is working with RESTORE as well
Now the "name" => SolrBackup.metadata.name + '-' + SolrBackup.spec.collection

curl -X POST http://localhost:8983/v2/collections/backups -H 'Content-Type: application/json' -d '
  {
    "list-backups" : {
      "name": "solr-backup-mycollection",
      "repository": "solr-backup-repo",
      "location": "/"
    }
  }
'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant