Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

A NullRefereceException in Blob's UploadFromStreamAsync() Func #517

Closed
duanjian opened this issue Dec 17, 2015 · 9 comments
Closed

A NullRefereceException in Blob's UploadFromStreamAsync() Func #517

duanjian opened this issue Dec 17, 2015 · 9 comments

Comments

@duanjian
Copy link

hello, when i use

IFormFile's file.OpenReadStream() get the stream

then use

var bBlob = _container.GetBlockBlobReference(path);
await bBlob.UploadFromStreamAsync(streamInput);
and got a NullReferenceException
the StackTrace is 

   在 Microsoft.WindowsAzure.Storage.Core.Util.StorageAsyncResult`1.End() 位置 c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Util\StorageAsyncResult.cs:行号 77
   在 Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.<>c__DisplayClass4.<CreateCallbackVoid>b__3(IAsyncResult ar) 位置 c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Util\AsyncExtensions.cs:行号 115

   在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   在 Schubert.Framework.FileSystem.AzureBlobFileStorage.<CreateBlobFromStream>d__5.MoveNext() 位置 C:\Users\duan\Source\Workspaces\Labijie\ProgrameFramework\Schubert_V1\src\Framework\Schubert.Framework.Azure\FileSystem\AzureBlobFileStorage.cs:行号 46

   在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   在 Schubert.Framework.FileSystem.AzureBlobFileStorage.<CreateFileAsync>d__10.MoveNext() 位置 C:\Users\duan\Source\Workspaces\Labijie\ProgrameFramework\Schubert_V1\src\Framework\Schubert.Framework.Azure\FileSystem\AzureBlobFileStorage.cs:行号 118

   在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()

in bata8 has no this problem , thank u

@davidfowl
Copy link
Member

I don't see ASP.NET on the call stack. Why do you think this is an ASP.NET bug? Is the stream null?

@duanjian
Copy link
Author

@davidfowl
bata8 is ok
the stream is not null
got this problem is after upgrade to rc2

@davidfowl
Copy link
Member

Did you update the azure sdk? Could it be a bug in there?

@duanjian
Copy link
Author

@davidfowl
the azure sdk's version is 2.7
need to update the azure sdk?

@davidfowl
Copy link
Member

I don't know. I'm saying that it doesn't look like an ASP.NET issue. If you copied the stream you get from ASP.NET to disk, does it fail the same way?

@duanjian
Copy link
Author

@davidfowl
i copied the stream get from ASP.NET to disk has no this exception , i will try to update the azure sdk.

@davidfowl
Copy link
Member

Doesn't seem asp.net related

@pemari-msft
Copy link

@davidfowl it seems that IFormFile's stream returns true for .CanSeek even though it's not seekable. Can you confirm this?

@Tratcher
Copy link
Member

Tratcher commented Feb 5, 2016

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

No branches or pull requests

4 participants