Skip to content

DataSync from S3 fails: Please verify that the subdirectory exists and is properly exported in /etc/exports

0

I'm in a similar situation to https://repost.aws/questions/QUENln9gK2Sp-9mez2Qmwk7g/copy-data-from-efs-to-efs-in-same-account-region : I'm transferring within the same account from our s3 bucket to our efs, which is mounted by the ec2 at /efs

The destination path is configured to be /efs/ and I'm getting error: Task failed to access location loc-yyyyyyyyyyy: xyyyyyyyyy: Could not mount subdirectory /efs/ on host 10.0.0.32. Please verify that the subdirectory exists and is properly exported in /etc/exports

The iam role for the data sync task was autogenerated during creation of the task and has all the permissions required at https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#awsui-tabs-:r4a:-amazon-s3-(source-location)-0

The efs has no file system policy and no access point. The subnet and security group values were copied from the ec2 that mounts the efs. I did not add an inbound rule for port 2049 (NFS) as suggested in https://docs.aws.amazon.com/datasync/latest/userguide/create-efs-location.html because I can't find any guidance about what the source address should be, and it's not mentioned in 3rd party guide https://blog.searce.com/moving-data-between-s3-and-efs-using-datasync-e34fbf620430#fab6

I have not been able to find where to look starting in the EFS console for an IAM policy according to "If you have an Amazon EFS file system that restricts access through an IAM policy..." at https://docs.aws.amazon.com/datasync/latest/userguide/create-efs-location.html

There is no exports file under /etc/ on the ec2 that mounts /efs I cannot find anything in https://docs.aws.amazon.com/datasync/latest/userguide/create-efs-location.html about whether this is actually required for my case and how to do it. I can't find a way to edit a location, and after creating a new location where I indicated the Path is /efs (no trailing slash), following the example /path/to/directory at https://docs.aws.amazon.com/datasync/latest/userguide/create-efs-location.html#heading:r2rv: after the location is created, its Path shows a trailing slash: /efs/

1 Answer
0

Hello,

This error ‘Task failed to access location’ typically occurs when the specified path during the location creation is not available at the destination. Essentially, DataSync attempts to migrate the files or folders by mounting the respective locations. However, if the path is missing or not present, this error is triggered.

To verify this, you can try mounting the EFS on one of your EC2 instances. If the path is not present in your EFS, please create a directory with the same name or specify the exact path that exists in your EFS. Once done, re-execute the datasync task.

https://docs.aws.amazon.com/datasync/latest/userguide/create-efs-location.html

If the issue persists, I recommend opening a support case with the AWS DataSync team. Provide the AWS region, Task ID, and execution ID to facilitate further troubleshooting.

answered a year ago
    1. Confirmed that df -h shows /efs under Mounted on
    2. Needs detail to be actionable: "you should still ensure that the IAM role associated with your DataSync task has the required EFS permissions"
    3. Visual inspection confirms the values are correct. Is there an aws cli command or similar to confirm?
    4. In the sg of the ec2 that mounts, added an inbound rule for NFS where the source is the name of the same sg.
    5. No agent should be needed in this case.
    6. Needs detail to be actionable.
    7. Confirmed.
    8. This depends on #2 above which needs detail to be actionable.

    After my change in #4, I selected button "Start (with defaults)" for the task, then went to Task History to wait for it to change from "Launching". Within about a minute, it showed an Error whose detail is the same as given in the title of this thread.

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.