Skip to content

Error in S3 location : Specified method is not allowed against the source when trying to input data in the Create Experiment Data Flow section.

0

I'm a little bit confused. I mean that once I fill the S3 location in the first section, then for export and training part, it generate 2 files (manifest and s3 in the specified path). So when trying to put the input data in s3 location for the experiment and data details part an error appears: "Invalid CSV, Parquet or Manifest file. The specified method is not allowed against this resource.."

When I paste the manifest or the csv S3 path files generated, the "Export data and train a model with SageMaker Autopilot" generated but neither of both works to continue the target and features part.

Thanks a lot for the support and happy ML-coding!

Some visuals for more understanding.

Part 1

Part 2

Part 3

Part 4

3 Answers
2
Accepted Answer

Hi Mike, I’m sorry to hear about the trouble you’re facing. I hope this information helps you resolve the issue.

Possible Causes

1. S3 Bucket Permissions Issue
- The IAM role associated with SageMaker may lack the necessary read/write permissions to access the S3 bucket or files.
- Make sure the bucket policy or IAM role includes the following permissions:
- s3:GetObject
- s3:PutObject
- s3:ListBucket
2. Incorrect S3 Path
- The path to the CSV or manifest file may be incorrect. Ensure it matches the required format with the correct folder structure and spelling (e.g., s3://your-bucket-name/path/to/your-file.csv).
3. File Format Issue
- Verify the CSV or manifest file format:
- CSV files must include a header row and consistent data types in each column.
- Manifest files should follow JSON Lines format. Example:

{"source": "s3://your-bucket-name/path/to/image1.jpg", "label": "cat"} {"source": "s3://your-bucket-name/path/to/image2.jpg", "label": "dog"}

4. S3 Object Lock or API Method Restrictions
- If S3 Object Lock or bucket versioning is enabled, it may block specific API calls, leading to the “method not allowed” error.

For more details about the error code, please refer to the doc : https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html

Solutions

1. Check IAM Role and S3 Permissions
- Update the IAM role policy to include the following:

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetObject", "s3:PutObject", "s3:ListBucket" ], "Resource": [ "arn:aws:s3:::your-bucket-name", "arn:aws:s3:::your-bucket-name/*" ] } ] }

2. Verify S3 File Paths
- Ensure that the S3 path you’re using follows the correct format (e.g., s3://your-bucket-name/path/to/file.csv).
- Avoid spaces or special characters in folder or file names, as they might cause issues.
3. Validate File Format
- CSV files: Make sure the first row contains column headers, and the data is consistent.
- Manifest files: Ensure each line is a valid JSON object with "source" and "label" fields.
4. Check for Object Lock Settings
- If Object Lock is enabled on the S3 bucket or objects, disable it to ensure all required API calls can be made.


- Use CloudTrail logs to check for any failed S3 API requests, which can help identify permission issues.
- Review the SageMaker Autopilot logs to get more details about the error and troubleshoot further.

answered 2 years ago

EXPERT

reviewed 2 years ago

  • Thanks a lot Cy ;)

0

Based on the information provided and the error message you're encountering, it appears that there might be an issue with the S3 data source configuration or permissions. Here are a few points to consider:

  1. S3 bucket location: Ensure that your S3 bucket is in the same AWS region as your SageMaker instance. The input bucket must be in the same AWS region as your training job.

  2. S3 data type: When specifying the S3 location, make sure you're using the correct S3 data type. There are three main types:

    • S3Prefix: This uses a key name prefix, and SageMaker will use all objects with that prefix.
    • ManifestFile: This is a file containing a list of object keys that SageMaker should use.
    • AugmentedManifestFile: This is similar to ManifestFile but with additional features.
  3. File format: Ensure that your input files are in the correct format (CSV, Parquet, or a valid manifest file). The error message suggests that the file might not be recognized as a valid input.

  4. Permissions: Verify that your IAM role has the necessary permissions to access the S3 bucket and the specific objects within it.

  5. S3 URI format: Make sure the S3 URI you're using is correctly formatted and points to the right location.

  6. Manifest file structure: If you're using a manifest file, ensure it's properly formatted. Each line should be a valid JSON object containing either a 'source-ref' or 'source' key.

  7. S3 Express One Zone: If you're using the new S3 Express One Zone storage class, make sure it's supported in your region and that you've configured it correctly for use with SageMaker.

To troubleshoot:

  • Double-check the S3 URI you're using.
  • Verify the file format and content.
  • Ensure your IAM role has the correct permissions.
  • Try using a simple S3Prefix instead of a manifest file if possible.
  • Check SageMaker logs for more detailed error messages.

If the issue persists, you may need to contact AWS support for further assistance, as there might be a specific configuration or permission issue that's not immediately apparent.
Sources
S3DataSource - Amazon SageMaker
Input manifest files - Amazon SageMaker
ProcessingS3Input - Amazon SageMaker
Accelerate machine learning model training with Amazon SageMaker and Amazon S3 Express One Zone

answered 2 years ago

EXPERT

reviewed 2 years ago

0

I ran into this as well, and it appears to be because SageMaker depends on S3 Select and the SelectObjectContent API call. S3 Select is now blocked for accounts that have not used it before, so it is impossible to import data into SageMaker from S3 with these accounts.

answered 2 years ago

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.