-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[BUG] BinaryData.ToString() throws nullreference exception after upgrading Microsoft.Extensions.Azure/Azure.Core #46444
Comments
Change: #46134 (this mentioned the bug) |
@m-redding: Would you please coordinate with the Storage team to make sure a release is going out this week with your fixes? |
Hello @mlankamp the best way to fix this is to add a direct reference in your application on System.Memory.Data 8.0.0 or protect against the bug in the 6.0.0 package with a try/catch. Unfortunately, this is a bug in the System.Memory.Data package so it's not something that can be fixed in the Azure.Storage.Blobs package. |
After internal discussion, it's clear there was an error in my initial analysis. My understanding that the exception was internal to the Storage libraries was incorrect and, as Maddy noted, a new release won't resolve the issue. Apologies for the confusion. To add some additional context, there's a number of our dependencies that are in the process of being upgraded in order to ensure that we remain on supported versions and avoid vulnerabilities. Unfortunately, we also have to ensure compatibility with existing platforms such as Azure Functions and Azure PowerShell which add constraints to the versions that we're able to adopt. In this case, our version of Unfortunately, we cannot do the same for application calls to |
Hi @mlankamp. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation. |
@jsquire Thank you for the update. Maybe the release notes for https://github.com/Azure/azure-sdk-for-net/releases/tag/Microsoft.Extensions.Azure_1.7.6 should be updated, so that people know that, |
@jsquire Side effect with this (minor) upgrade Microsoft.Extensions.Azure from 1.7.5 --> 1.7.6 is/was that our azure functions running .net 8 inprocess won't handle servicebus triggers any longer. We didn't see any "toString()" but just the system.memory.data binary could not be found. The error which shows up: Exception while executing function: ServicebusHandlerName Could not load file or assembly 'System.Memory.Data, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
Note. HTTP trigger within the same azure function project just works with no errors. |
Also @bvmeer would you be mind copying & pasting what you wrote into a separate issue? Just in case anyone else running into this then it'll be easier to have it in one spot |
It looks like on top of what @bvmeer mentioned this upgrade seems to completely break .NET 6 in-process model to the point where host refuses to start. From what Ive seen this issue seems to occur not only on local machine but also in Azure Function Apps. Copy-pasted ver
In my case upgrading any of the following packages seems to break. The worst part is that this is considered a patch upgrade, so it was auto-merged by Renovate app to master.
Here's an example repository I used for testing: https://github.com/Kiruyuto/.net6-inprocess-break. |
Hi @mlankamp, since you haven’t asked that we |
/unresolve |
Hi @mlankamp. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation. |
Hi @mlankamp, since you haven’t asked that we |
/unresolve
@jsquire, thanks for the explanation. Azure.Core 1.40.0 is pulled in with Azure.Identity 1.12.0. For us, the System.Memory.Data 6.0.0 is broken, since with it any empty response fails. Sure, we can attempt upgrading it everywhere it gets pulled in like this internal pull request, but it is not a great solution. If we miss it, empty responses are going to fail. With .NET 6 out of support, is there a path forward for referencing a newer System.Memory.Data version from Azure.Core? |
@cataggar: To clarify, the .NET runtime 6.0 is out of support, but the 6.x line of packages are still actively maintained and supported. We're currently working to bump the 6.x dependencies to 8.x, but doing so requires internal coordination to ensure we retain compatibility with the Azure Functions host and supported versions of PowerShell. From context, I'm not sure if you're inquiring about an Azure Functions application (which is the context of this issue) or this is an unrelated question. If you are asking about a stand-alone scenario, then you can take a direct reference to If you're asking about an Azure Functions application, then you do not have that option and will have to wait for the host dependencies to be confirmed upgraded and fully deployed so that we can safely bump the Azure SDK dependencies. |
Hi @mlankamp. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation. |
I'll create a new issue. My appologies for reopening this one. |
Library name and version
Azure.Core 1.44.0
Describe the bug
The dependency System.Memory.Data is upgraded in version 1.44.0 to 6.0.0, this version has very annoying bug. When BinaryData is empty, the .ToString() method throws. This is fixed in a later version of the System.Memory.Data library.
The previous version (1.42.0) used System.Memory.Data version 1.0.2, this version doesn't have the problem.
Expected behavior
BinaryData.ToString() should not throw
Actual behavior
It does :-(
Reproduction Steps
Add manual package dependency to Microsoft.Extensions.Azure 1.7.6
public async Task UpdateBuildingFileStatusActivity(
[BlobInput("path/to/emptyfile.txt", Connection = "MadasterStorage")] BlobClient blob)
{
var content = await blob.DownloadContentAsync();
var text = content.Value.Content.ToString();
}
Environment
No response
The text was updated successfully, but these errors were encountered: