Azure Datalake Blob storage gen2 fails to connect [COMMUNITY HELP WANTED]

オープン
#41 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
azure, csharp
領域
backend, cloud

調査の方向性

Start by reading the Azure Blob Storage registration and connection path, especially StorageFactory.Modules.UseAzureBlobStorage() and FromConnectionString, then inspect ExtendedSdk.GetHttpPipeline(BlobServiceClient). The report says that method relies on Azure SDK internals and throws a NullReferenceException; identify the SDK change that breaks the pipeline access and reproduce the failure with a Gen2 connection. Done means the connection works without the reported exception.

索引モデルが issue の本文から書いたものです。

説明

Azure Data Lake bug fixed help wanted

Problem:
Try to create a blob connection azure blobstorage gen2 with FromConnectionString
did the StorageFactory.Modules.UseAzureBlobStorage() to register the azure blob storage extention
throws a NullReferenceException

Cause:
ExtendedSdk.GetHttpPipeline(BlobServiceClient sdkClient) is using internals of Azure BlobServiceClient and they have changed I assume.

This ugly hack did the trick:

            var accountName = <<StorageAccountName>>;
            var credential = new StorageSharedKeyCredential(accountName ,<<accessToken>>);
            
            var uri = new Uri($"https://{accountName}.blob.core.windows.net/");
            var client = new BlobServiceClient(uri, credential);


            FieldInfo BlobClientConfigurationField =
                typeof(BlobServiceClient).GetField("_clientConfiguration", BindingFlags.NonPublic | BindingFlags.Instance);

            var clientConfig = BlobClientConfigurationField.GetValue(client);
            var clientConfigType = clientConfig.GetType();
            PropertyInfo httpPipelineProperty =
                clientConfigType.GetProperty("Pipeline", BindingFlags.Public | BindingFlags.Instance);
            
            Azure.Core.Pipeline.HttpPipeline httpPipeline = httpPipelineProperty.GetValue(clientConfig) as Azure.Core.Pipeline.HttpPipeline;

            Type AzureDataLakeStorageType = typeof(IBlobStorage)
                .Assembly.GetType("FluentStorage.Azure.Blobs.AzureDataLakeStorage");
            // ConstructorInfo method = t.GetConstructor(new Type[] { typeof(BlobServiceClient), typeof(string), typeof(StorageSharedKeyCredential), typeof(string )} );
            //# Object o = method.Invoke(new Object[] {client, accountName, credential, null});
            Type extendedSdkType = typeof(IBlobStorage)
                .Assembly.GetType("Blobs.ExtendedSdk");

            var dlStorage = FormatterServices.GetUninitializedObject(AzureDataLakeStorageType);
            var extendedSdk = FormatterServices.GetUninitializedObject(extendedSdkType);

            var sdkClientField =
                extendedSdkType.GetField("_sdkClient", BindingFlags.Instance | BindingFlags.NonPublic);
            var pipelineField = extendedSdkType.GetField("_httpPipeline", BindingFlags.Instance | BindingFlags.NonPublic);
            var dsfBaseAddress = extendedSdkType.GetField("_dfsBaseAddress", BindingFlags.Instance | BindingFlags.NonPublic);

            sdkClientField.SetValue(extendedSdk, client);
            pipelineField.SetValue(extendedSdk, httpPipeline);
            dsfBaseAddress.SetValue(extendedSdk, $"https://{accountName}.dfs.core.windows.net/");

            var extendedField = AzureDataLakeStorageType.GetField("_extended", BindingFlags.Instance | BindingFlags.NonPublic);
            extendedField.SetValue(dlStorage, extendedSdk);
            

            var clientField2 = AzureDataLakeStorageType.BaseType.GetField("_client", BindingFlags.Instance | BindingFlags.NonPublic);
            clientField2.SetValue(dlStorage, client);

            var sasCredField = AzureDataLakeStorageType.BaseType.GetField("_sasSigningCredentials", BindingFlags.Instance | BindingFlags.NonPublic);
            sasCredField.SetValue(dlStorage, credential);

            var containerField = AzureDataLakeStorageType.BaseType.GetField("_containerNameToContainerClient", BindingFlags.Instance | BindingFlags.NonPublic);
            containerField.SetValue(dlStorage, new ConcurrentDictionary<string, BlobContainerClient>());
主要言語
C#
スター
464
フォーク
78
PR マージ指標
30日以内にマージされた PR はありません

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

robinrodricks/FluentStorage のほかの issue

robinrodricks/FluentStorage の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。