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

Client unable to connect to minio K8 Instance, providing no error or logs to debug #1030

Open
Dazing opened this issue Mar 12, 2024 · 0 comments

Comments

@Dazing
Copy link

Dazing commented Mar 12, 2024

Unable to connect to Minio K8 instance (port forwarded to 9003) or in a application deployed to K8.

6.0.0, 6.0.1: "message=Connection error:The SSL connection could not be established, see inner exception.. Status code=0, response=The SSL connection could not be established, see inner exception., content="

6.0.2: Siliently fails

Neither is helpful.

FYI: Our Loki deployment is succesfully connecting to and using the Minio. Logs are being persisted and is visable in the Minio Console.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework> // Have tried net6.0 as well, no change
    <RootNamespace>minio_client</RootNamespace>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Minio" Version="6.0.2" /> // Tried: 6.0.0, 6.0.1, 6.0.2.  
  </ItemGroup>

</Project>
using Minio;
using Minio.DataModel.Args;

try
{
    var bucketname = "bigbucket-003";
    Console.WriteLine("Creating client..");
    var minio = new MinioClient()
        .WithEndpoint("localhost", 9000)
        .WithCredentials("key", "secret")
        .WithSSL(true)
        .Build();

    Console.WriteLine("BucketExistsAsync..");
    // Make a bucket on the server, if not already present.
    var beArgs = new BucketExistsArgs()
        .WithBucket(bucketname);
    bool found = await minio.BucketExistsAsync(beArgs).ConfigureAwait(false);
    
    Console.WriteLine($"Bucket exists '{found}'..");
    if (!found)
    {
        Console.WriteLine("MakeBucketAsync..");
        var mbArgs = new MakeBucketArgs()
            .WithBucket(bucketname);
        await minio.MakeBucketAsync(mbArgs).ConfigureAwait(false);
    }
}
catch (Exception ex)
{
    Console.WriteLine(ex.Message);
}
Console.ReadLine();

I expect a response of some sort, or least a wait to review logs in Minio console to debug connections.

The dotnet client for Minio is not up to gears with silent failures and quirks like not being able to set client as class property without random errors.

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

1 participant