Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Unable to use Azurite as an Blob Storage emulator using storage spring boot starter:2.2.0 #762

@zoosm3

Description

@zoosm3

Environment

  • Spring boot starter:

    • storage spring boot starter:2.2.0
  • OS Type: Windows 10

  • Java version:

    • 11
  • I'm using Azurite and Azure Storage Emulator for local development

Summary

Unable to use the Blob Storage emulators with this SDK

Reproduce steps

  1. Use the latest Azurite or Azure Storage Emulator

  2. Configure application.properties based on Azurete's Storage Accounts

azure.storage.account-name=devstoreaccount1
azure.storage.account-key=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==
azure.storage.container-name=upload
azure.storage.allow-telemetry=false
  1. Upload a file with TransferManager
final BlockBlobURL blockBlobURL = containerURL.createBlockBlobURL(getFullPath());

final AsynchronousFileChannel fileChannel = AsynchronousFileChannel.open(Paths.get(bean.getFullPath()));

TransferManager.uploadFileToBlockBlob(fileChannel, blockBlobURL, 8 * 1024 * 1024, createUploadOptions(getMimeType()))
                    .toCompletable()
                    .doOnComplete(() -> { putLog(); })
                    .doOnError(error -> { putLog(); })
                    .blockingAwait();

Expected Results

A file shoud be successfully uploaded to the Blob storage emulator but failed

because the endpoing is not 'http://devstoreaccount1.blob.core.windows.net/' but http://127.0.0.1:10000/myaccount/according to Enulator's Endpoint & Connection URL

Actual Results

2019-11-07 16:44:22.203  INFO 8440 --- [ionThreadPool-2] Azure Storage Java SDK                   : 'http://devstoreaccount1.blob.core.windows.net/upload?restype=container'==> OUTGOING REQUEST (Try number='4')

2019-11-07 16:44:50.227  WARN 8440 --- [ntLoopGroup-5-8] io.netty.util.concurrent.DefaultPromise  : An exception was thrown by com.microsoft.rest.v2.http.NettyClient$AcquisitionListener.operationComplete()

java.lang.NullPointerException: null
        at com.microsoft.rest.v2.http.NettyClient$AcquisitionListener.emitError(NettyClient.java:425) ~[client-runtime-2.0.2.jar:na]
        at com.microsoft.rest.v2.http.NettyClient$AcquisitionListener.operationComplete(NettyClient.java:246) ~[client-runtime-2.0.2.jar:na]
        at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:577) ~[netty-common-4.1.42.Final.jar:4.1.42.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:551) ~[netty-common-4.1.42.Final.jar:4.1.42.Final]
        at io.netty.util.concurrent.DefaultPromise.access$200(DefaultPromise.java:35) ~[netty-common-4.1.42.Final.jar:4.1.42.Final]
        at io.netty.util.concurrent.DefaultPromise$1.run(DefaultPromise.java:501) ~[netty-common-4.1.42.Final.jar:4.1.42.Final]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[netty-common-4.1.42.Final.jar:4.1.42.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:510) ~[netty-common-4.1.42.Final.jar:4.1.42.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:518) ~[netty-transport-4.1.42.Final.jar:4.1.42.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044) ~[netty-common-4.1.42.Final.jar:4.1.42.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.42.Final.jar:4.1.42.Final]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.42.Final.jar:4.1.42.Final]
        at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]

java.lang.RuntimeException: java.util.concurrent.TimeoutException: The source did not signal an event for 60 seconds and has been terminated.
        at io.reactivex.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:46) ~[rxjava-2.2.13.jar:na]
        at io.reactivex.internal.observers.BlockingMultiObserver.blockingGet(BlockingMultiObserver.java:93) ~[rxjava-2.2.13.jar:na]
        at io.reactivex.Single.blockingGet(Single.java:2835) ~[rxjava-2.2.13.jar:na]


Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions