Open Closed

Minio System.NullReferenceException : 'Object reference not set to an instance of an object.' #3267


User avatar
0
berly created
  • ABP Framework version: v5.3
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace: System.NullReferenceException : 'Object reference not set to an instance of an object.'

I do the same in my 5.2 project and work. I dont understand.


5 Answer(s)
  • User Avatar
    0
    berly created

    I tried with a new project, exactly the same error.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi @berly, thanks for reporting. I'll check and write you back asap.

  • User Avatar
    1
    maliming created
    Support Team Fullstack Developer

    hi

    Use the below code to fix the problem, We will fix it in abp framework.

    Configure<AbpBlobStoringOptions>(options =>
    {
        options.Containers.Configure<PhotoContainer>(container =>
        {
            container.UseMinio(minio =>
            {
                minio.EndPoint = "localhost:9000"; // your minio endPoint
                minio.AccessKey = "minioadmin"; // your minio accessKey
                minio.SecretKey = "minioadmin"; // your minio secretKey
                minio.BucketName = "photo";
    
                minio.CreateBucketIfNotExists = true;
            });
    
            container.ProviderType = typeof(MyMinioBlobProvider);
        });
    }
    
    using Minio;
    using Volo.Abp.BlobStoring;
    using Volo.Abp.BlobStoring.Minio;
    
    namespace KlicKlac;
    
    public class MyMinioBlobProvider : MinioBlobProvider
    {
    
        public MyMinioBlobProvider(
            IMinioBlobNameCalculator minioBlobNameCalculator,
            IBlobNormalizeNamingService blobNormalizeNamingService)
            : base(minioBlobNameCalculator, blobNormalizeNamingService)
        {
        }
    
        protected override MinioClient GetMinioClient(BlobProviderArgs args)
        {
            var configuration = args.Configuration.GetMinioConfiguration();
    
            var client = new MinioClient()
                .WithEndpoint(configuration.EndPoint)
                .WithCredentials(configuration.AccessKey, configuration.SecretKey);
    
            if (configuration.WithSSL)
            {
                client.WithSSL();
            }
    
            return client.Build();;
        }
    }
    
    
  • User Avatar
    0
    berly created

    It works good, can you close the ticket? Are you refunding the issue as it is a bug?

  • User Avatar
    1
    maliming created
    Support Team Fullstack Developer

    Question Credits Refunded

Made with ❤️ on ABP v9.1.0-preview. Updated on December 12, 2024, 07:15