Need help with " Member must satisfy regular expression pattern" error

1

Hello all,

I'm trying to detect custom labels and have gone through all the steps in the guide including training, labeling, starting the project etc. The problem I'm having is when I try to actually detect custom labels from AWS CLI, the following error message is encountered:

An error occurred (ValidationException) when calling the DetectCustomLabels operation: 1 validation error detected: Value 'arn:aws:s3:::<my bucket ARN>' at 'image.s3Object.bucket' failed to satisfy constraint: Member must satisfy regular expression pattern: [0-9A-Za-z\.\-_]*

According to the docs link:https://docs.aws.amazon.com/rekognition/latest/customlabels-dg/detecting-custom-labels.html#w1141aac36c23c10b2b1, here is the command.

aws rekognition detect-custom-labels --project-version-arn "model_arn"\
   --image '{"S3Object":{"Bucket":"bucket","Name":"image"}}'\
   --min-confidence 70

Accordingly:

"model_arn": copy-pasted from my model info page
"bucket": copy-pasted the full S3 ARN from my S3 bucket
"image": copy-pasted the full path of the image to analyze in the same S3 bucket

Would appreciate any suggestions into how to resolve this. Thanks.

asked 4 years ago20713 views
2 Answers
0

Posting the solution to help someone else (or most likely myself since I'm probably going to forget about this and face this problem again some day).

"bucket": NOT the ARN but the simple bucket name.
"image": the path to the S3 Object but excluding the bucket. Thus if the image file is in "assets" sub-folder, "dataset_1" sub-folder, "1278368" sub-folder, then the field should be "assets/dataset_1/1278368/my_image.jpg". NB: there is no leading slash before "assets".

answered 4 years ago
0

I experience slightly different but mainly same error:

botocore.exceptions.ClientError: An error occurred (ValidationError) when calling the DescribeStacks operation: 1 validation error detected: Value 'sam_standalone_a_stack-38b43029-CompanionStack' at 'stackName' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z][-a-zA-Z0-9]*|arn:[-a-zA-Z0-9:/._+]*

My case was due to '_' (expression not accept _ only -)

Be careful.

Oliver
answered a year 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.

Guidelines for Answering Questions