I'm using Hue (Hadoop User Experience) to access Amazon Simple Storage Service (Amazon S3) buckets on an Amazon EMR cluster. I get an error that there are no files matching the search criteria or the search failed.
Short description
You can receive on the following error messages:
- "There are no files matching the search criteria."
- "Failed to access path "s3a://awsdoc-example-bucket.hue1": hostname u'awsdoc-example-bucket.hue1.s3.amazonaws.com' doesn't match either of '*.s3.amazonaws.com', 's3.amazonaws.com'"
- "Failed to retrieve bucket: hostname u'awsdoc-example-bucket.hue1.s3.amazonaws.com' doesn't match either of '*.s3.amazonaws.com', 's3.amazonaws.com'"
The default Amazon S3 calling format for Hue is https://awsdoc-example-bucket.s3.amazonaws.com. If there is a dot (.) in your S3 bucket name, part of the bucket name is included in the Amazon S3 endpoint. For example, if your bucket is named awsdoc-example-bucket.hue, then Hue treats hue.s3.amazonaws.com as the Amazon S3 endpoint instead of s3.amazonaws.com.
Resolution
To resolve these errors, change the endpoint format to https://s3.amazonaws.com/awsdoc-example-bucket.
-
Open the /etc/boto.cfg file.
-
Add the following lines to the boto.cfg file:
[s3]
calling_format=boto.s3.connection.OrdinaryCallingFormat
-
Restart the Hue service:
For Amazon EMR versions earlier than 5.30:
$ sudo stop hue
$ sudo start hue
For Amazon EMR versions 5.30 and later:
$ sudo systemctl restart hue
Related information
Boto3 configuration