The specified bucket does not exist
I am using local file system as the storage backend, my conf file is wrote as the instruction:
s3proxy.authorization=none
s3proxy.endpoint=http://***hidden***:9234
jclouds.provider=filesystem
jclouds.filesystem.basedir=/home/esimimo/
And I am using following command to run s3proxy(the latest version):
nohup java -jar s3proxy --properties disk-simin.conf &
But I found:
- when I use the folder which contains <= 2 characters as the bucket name, it will fail:
curl http://***hidden***:9234/ki/aaa
<?xml version='1.0' encoding='UTF-8'?><Error><Code>NoSuchBucket</Code><Message>The specified bucket does not exist</Message><RequestId>4442587FB7D0A2F9</RequestId></Error>
- When I use the folder which contains > 2 characters as the bucket name, it will be successful:
curl http://***hidden***:9234/temp/aaa
aaaaaa
Should this be a bug or I missed something? Thanks in advance!
S3Proxy mimics the S3 bucket restrictions:
Bucket names must be at least 3 and no more than 63 characters long.
It is not clear that we must enforce the same restrictions. Perhaps we could enable this extra checking under some s3proxy.strict-bucket-names property. What do you think?
The validation logic looks like this:
// Validate container name
if (!uri.equals("/") && !isValidContainer(path[1])) {
if (method.equals("PUT") &&
(path.length <= 2 || path[2].isEmpty()) &&
!"".equals(request.getParameter("acl"))) {
throw new S3Exception(S3ErrorCode.INVALID_BUCKET_NAME);
} else {
throw new S3Exception(S3ErrorCode.NO_SUCH_BUCKET);
}
}
It has been several years but I suspect I implemented this for compatibility with s3-tests which should match AWS S3.
I agree with you. S3proxy should be much more flexible than AWS S3 :) Look forward your new release :)