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

minio auth failed #1971

Open
clojurians-org opened this issue Jan 12, 2022 · 1 comment
Open

minio auth failed #1971

clojurians-org opened this issue Jan 12, 2022 · 1 comment

Comments

@clojurians-org
Copy link

i start a minio server, and use rusoto to call it, it response 403.

[hadoop@apex-dev-dcme-01 data-engine-0.2.0-bin]$ export MINIO_ACCESS_KEY=chinapex
[hadoop@apex-dev-dcme-01 data-engine-0.2.0-bin]$ export MINIO_SECRET_KEY=chinapex
[hadoop@apex-dev-dcme-01 data-engine-0.2.0-bin]$ ../back-end-data-serv-static/linux/minio-20210116  server .

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ You are running an older version of MinIO released 11 months ago ┃
┃ Update: Run `mc admin update`                                    ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Endpoint: http://10.25.21.40:9000  http://172.17.0.1:9000  http://172.18.0.1:9000  http://127.0.0.1:9000
RootUser: chinapex
RootPass: chinapex

Browser Access:
   http://10.25.21.40:9000  http://172.17.0.1:9000  http://172.18.0.1:9000  http://127.0.0.1:9000

Command-line Access: https://docs.min.io/docs/minio-client-quickstart-guide
   $ mc alias set myminio http://10.25.21.40:9000 chinapex chinapex

Object API (Amazon S3 compatible):
   Go:         https://docs.min.io/docs/golang-client-quickstart-guide
   Java:       https://docs.min.io/docs/java-client-quickstart-guide
   Python:     https://docs.min.io/docs/python-client-quickstart-guide
   JavaScript: https://docs.min.io/docs/javascript-client-quickstart-guide
   .NET:       https://docs.min.io/docs/dotnet-client-quickstart-guide
use rusoto_s3::{S3Client, S3, HeadBucketRequest} ;
use rusoto_core::Region ;
use rusoto_credential::{AwsCredentials, StaticProvider} ;

#[tokio::main]
async fn main() {
    let client = rusoto_core::request::HttpClient::new().expect("Failed to creat HTTP client") ;
    let region =  Region::Custom {
        name: "us-east-1".to_string(),
        endpoint: "http://10.25.21.40:9000".to_string()
    } ;
    let creds = StaticProvider::new_minimal("chinapex".to_string(), "chinapex".to_string()) ;
    let client = S3Client::new_with(client, creds, region) ;
    let resp = client
        .head_bucket(HeadBucketRequest {
            bucket: "larluo".to_string(),
            expected_bucket_owner: None,
        }).await ;
    println!("return: {:?}", resp) ;
    println!("finished!");
}

[larluo@larluo-centos8 minio-client-rust]$ cargo run
   Compiling minio-client-rust v0.1.0 (/home/larluo/my-work/my-repo/back-end-data-serv/data-client/proxy-client-http/minio-client-rust)
warning: unused import: `AwsCredentials`
 --> src/main.rs:4:25
  |
4 | use rusoto_credential::{AwsCredentials, StaticProvider} ;
  |                         ^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: 1 warning emitted

    Finished dev [unoptimized + debuginfo] target(s) in 5.64s
     Running `target/debug/minio-client-rust`
return: Err(Unknown(BufferedHttpResponse {status: 403, body: "", headers: {"accept-ranges": "bytes", "content-length": "289", "content-type": "
application/xml", "server": "MinIO", "vary": "Origin", "date": "Wed, 12 Jan 2022 10:00:43 GMT"} }))
finished!
@boul2gom
Copy link

boul2gom commented Sep 10, 2022

I got exactly the same error, in same context but with a 400 instead of 403 response code. Btw I think MinIO simply doesnt support head bucket/objects requests, like said here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants