https://opendal.apache.org/ logo
Wrote this to work with minIO but
# general
m
Wrote this to work with minIO, but getting
PermissionDenied
error even though I've double checked my creds, endpoint, etc. Any known issues around this?
Copy code
builder.root("/data");
    builder.bucket("new-bucket");
    builder.endpoint("http://192.168.1.80:9000");
    builder.access_key_id("minioadmin");
    builder.secret_access_key("minioadmin");
    let op: Operator = Operator::new(builder)?.finish();

    let mut file = File::open(path).expect("Unable to open file");
    let mut buf = Vec::new();
    file.read_to_end(&mut buf)?;

    op.write(&format!("{}/{}", "uploads", &file_id), buf).await?
I also tried this against the play.min.io instance using their creds. I'm able to connect to both without issue using the
mc
cli client. Thought I'd ask here instead of open an issue directly, but happy to do that if preferred.
x
Maybe we should configure region for this instance.
We will use
us-east-1
for non-AWS s3 instance, but it seems not a good idea.
m
Thanks 👍
It's me again 🙂 Having issues now testing 0.39.0 against S3 directly as well. builder:
Copy code
let mut builder = S3::default();
    builder.endpoint("https://s3.amazonaws.com");
    builder.bucket("new-bucket");
    builder.region("us-east-1");
    let op: Operator = Operator::new(builder)?.finish();
write:
Copy code
let mut file = File::open(path).expect("Unable to open file");
    let mut buf = Vec::new();
    file.read_to_end(&mut buf)?;

    op.write(&format!("{}/{}", "uploads", &file_id), buf).await?
list:
Copy code
let entries = op.blocking().list("/")?;
    entries.into_iter().for_each(|e| {
        println!("{e:?}");
    });
both of these ops are failing with error message:
Unsupported(permanent) at {blocking_list,write} => operation is not supported
the
at {}
depending on the op of course
x
Sadly, s3 doesn't support blocking_list operation in v0.39.
We will release a BlockingLayer to make it possible in the coming v0.40: https://opendal.apache.org/docs/rust/opendal/layers/struct.BlockingLayer.html
It's bit strange that
write
also failed, would you like to share the full example so that we can reproduce it?
m
Here's a simple reproducible case. Let me know if you need anything else https://github.com/metame/rust-examples/blob/opendal/opendal-example/src/main.rs
x
Hi, the original code is not compilable. I did some little change, and it works.

https://cdn.discordapp.com/attachments/1137884797830696960/1141208234057809930/image.png▾

https://cdn.discordapp.com/attachments/1137884797830696960/1141208386369753169/image.png▾

The only change I made is adding a return type for
aws_builder
.
m
Thanks, will check it out
x
I will keep online for next hour until this issue resovled. Welcome to post updates here 😘
m
Going to bed right now ha. Late over here. Thank you for responses and will check it out in my morning 🙂
x
Oh, oops, sorry for the late message, I'm just getting up. Wish you have a good night.
m
No problem at all. Enjoy your morning and day 🙂
It works! I'm new to Rust actually and wasn't aware that passing the unit type to a function would not throw a compiler error so that's partly why I didn't catch this obvious mistake of not actually returning the
builder
from my config functions.
So after further research for my own understanding, it turns out the only reason my code compiled is because
Builder
is implemented for
()
in the openDAL project. I was wondering what the purpose of this implementation is and whether or not it could/does contribute to a less desirable developer experience?
x
Oh, this is a designed behavior that using () as dummy implementation for all opendal traits
We add this for easier building a dummy service or layer
m
Is the purpose of the dummy implementations for testing? Or something else?
x
Mostly for testing. And there are use cases that users want to implement layers upon a dummy accessor.
m
Thank you for the further detail 🙇