Restoring EFS using boto3 client does not work if EFS has already been restored once



I have been playing with EFS backup and restore and using python boto3 client for all the operations. I came across an edge-case scenario where EFS restore does not work. Below are the steps (all operations were done using python boto3 client unless explicitly mentioned)

  • I created an EFS backup. I then used the recovery point ARN to restore it back to the same file system by calling start_restore_job(). This created a restore job which successfully completed and created a separate restore directory on the file system
  • I then deleted the restored directory from the file system.
  • I then called start_restore_job() again using the same recovery point ARN and to the same file system. I expected it to create a new restore job, however it failed with error "An error occurred (InvalidParameterValueException) when calling StartRestoreJob operation: Restore job xyz already finished". xyz is the same restore job that was created in the first step. Looks like it does not create a new restore job if one has already completed successfully.
  • I then ran the restore operation from the console and it did create a new restore job as expected.

I am not sure whether this is a bug with boto3 client or the API itself, but I should be allowed to run multiple restores for the same recovery point ARN.

asked 4 months ago95 views
1 Answer
Accepted Answer

Reposting from Aram Koukia's comment:

Did you provide the IdempotencyToken? If you want to initiate a new Restore Job, you need to provide a new IdempotencyToken when making the API call.

StartRestoreJob API documentation:

answered 4 months ago
  • Yes, I did not provide the IdempotencyToken. It works now after providing the token value.

    Thanks for the help

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions