Minio: Access to files denied

Created on 19 Feb 2017  路  4Comments  路  Source: minio/minio

Hi

In your minio shopping app demo you create a public link to the image. I have copied this line of code and tried this with my minio installation and I get an access denied error.

var publicUrl = minioClient.protocol + '//' + minioClient.host + ':' + minioClient.port + '/' + minioBucket + '/' + obj.name

Expected Behavior

I would expect to see the image in the browser when accessing the url.

Current Behavior

I get the following error:

<?xml version="1.0" encoding="UTF-8"?>
<Error>
    <Code>AccessDenied</Code>
    <Message>Access Denied.</Message>
    <Key></Key>
    <BucketName></BucketName>
    <Resource>/testbucket/IMG_0278.JPG</Resource>
    <RequestId>3L137</RequestId>
    <HostId>3L137</HostId>
</Error>

Steps to Reproduce (for bugs)

  1. install minio with homebrew brew install minio
  2. start the service brew services start minio (fix the .plist file before ;))
  3. log in to the web interface
  4. create a bucket
  5. upload a file
  6. use the node.js minio client, initialize client with server credentials
  7. and add the following code:
var stream = minioClient.listObjects(minioBucket,'', true)
stream.on('data', function(obj) {
  // Lets construct the URL with our object name.
  var publicUrl = minioClient.protocol + '//' + minioClient.host + ':' + minioClient.port + '/' + minioBucket + '/' + obj.name
  console.log(publicUrl);
});
  1. copy the generated url and paste it into the browser

Context

I was trying to load a file through the browser, like you do in the shopping app demo.

Your Environment

  • Version used: 2017-02-16T01:47:30Z
  • Environment name and version (e.g. nginx 1.9.1): with and without MAMP PRO 4 as proxy
  • Server type and version: MAMP PRO 4.1
  • Operating System and version: macOS Sierra

What could this be? Do I have to change something?

Thanks

community

Most helpful comment

Never mind, I found it. 馃槉

For those having the same issue, either use the command line client to set the policy for the bucket to public, more here, or use the web interface, where you click on the three dots next to the bucket name and add a row with the prefix * and Read and Write permissions.

All 4 comments

Never mind, I found it. 馃槉

For those having the same issue, either use the command line client to set the policy for the bucket to public, more here, or use the web interface, where you click on the three dots next to the bucket name and add a row with the prefix * and Read and Write permissions.

It was a sad day once i got threw access denied

i got the same issue even though i set public permission for the bucket

Never mind, I found it.

For those having the same issue, either use the command line client to set the policy for the bucket to public, more here, or use the web interface, where you click on the three dots next to the bucket name and add a row with the prefix * and Read and Write permissions.

@iamso how to do this same but from mc cli?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fkautz picture fkautz  路  4Comments

Alexander-He picture Alexander-He  路  5Comments

anuaimi picture anuaimi  路  5Comments

alfozan picture alfozan  路  4Comments

maltefiala picture maltefiala  路  3Comments