Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating Empty folder in s3x hangs the gateway using AWS SDK client #56

Open
storming0x opened this issue Apr 22, 2020 · 3 comments
Open
Labels
upstream-optional indicates that this is a feature in upstream, but is not required for compatability

Comments

@storming0x
Copy link

storming0x commented Apr 22, 2020

Support for adding empty folder in s3x does not work like it does in s3 when using AWS SDK /Rest API. When trying this in s3x gateway the client request hangs and times out.

Expected Behavior

The AWS S3 SDK has support for empty folders, which is done via a / suffix at the end of the key name and a byte 0 file is added to the location to represent an empty folder.
Reference: https://stackoverflow.com/questions/19459893/how-to-create-folder-or-key-on-s3-using-aws-sdk-for-node-js
Calling code in NodeJs AWS SDK:

s3.putObject({ Bucket: 'my-bucket', Key: 'my-empty-folder/' }, (...args) => { console.log(args); });

Change/Fix: S3x can emulate the same empty folder feature as S3 by creating a placeholder .keep file in the requested location so that it can handle empty folders and subfolders.

Current Behavior

The s3x gateway times out or hangs when trying to call it with the above SDK code for empty folder.
The gateway does not support empty folders and subfolders in location, if improvement is added users could create folders and subfolders in s3x like they can in the s3 SDK client.

Possible Solution

Recursively create .keep files per locations in folder/subfolders to emulate empty folders.

Steps to Reproduce (for bugs)

  1. Boot up the gateway via: minio gateway s3x
  2. From a nodejs client try running this code: (can also be replicated with REST API)
    var AWS = require('aws-sdk'); var s3 = new AWS.S3({ accessKeyId: 'minio' , secretAccessKey: 'miniostorage' , endpoint: 'http://localhost:9000' , ... }); s3.putObject({ Bucket: 'my-bucket', Key: 'empty-folder/', }, (...args) => { console.log(args); });
  3. Gateway process hangs in terminal.

Context

Trying to implement a folder like browser using s3x for IPFS that has parity with S3 SDK and can also work for clients using existing S3 storage.

Your Environment

  • Commit Info: commit a85f85c (HEAD -> master, tag: v0.0.7, origin/master, origin/HEAD)
  • Environment name and version (e.g. nginx 1.9.1): MAC_OS Mojave 10.14.6
  • Server type and version: MAC_OS Mojave 10.14.6
  • Operating System and version (uname -a): Darwin Kernel Version 18.7.0: Mon Feb 10 21:08:45 PST 2020; root:xnu-4903.278.28~1/RELEASE_X86_64 x86_64
  • Link to your project: fleek.co
@bonedaddy bonedaddy added the upstream-optional indicates that this is a feature in upstream, but is not required for compatability label Apr 22, 2020
@storming0x
Copy link
Author

@xiegeo
Copy link

xiegeo commented Apr 28, 2020

@dmolina79 thanks, feel free to make a pull request anytime.

@storming0x
Copy link
Author

@xiegeo we are testing on our local build, if we find no issues ill prepare a PR, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream-optional indicates that this is a feature in upstream, but is not required for compatability
Projects
None yet
Development

No branches or pull requests

3 participants