-
Notifications
You must be signed in to change notification settings - Fork 493
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 Report] GetFileUploadSasUriAsync throws ObjectDisposedException #2235
Comments
@JohanNorberg I did notice some issues with your code though that don't seem to be related to the issue you are hitting but will affect the quality of the code. 1-
Can be simplified to :
Your main method is 2- Creating a new HTTP client every time you want to send a request is ill-advised. It will result in connection issues and port exhaustion. You should either create a static HTTP client and reuse it or instead use the Azure Storage SDK as illustrated in our sample code for file upload notification 3- It's recommended to close your device client once you are done with it. The using statement will Dispose it but to properly close everything, you should call |
Hey, ok, sorry about the messy code. I just experimented until I could reproduce the error and then submitted with the code I had. I should have cleaned up before submitting the bug report. I've cleaned up the code here:
The output is as follows (using SDK 1.39):
However, downgrading to 1.37.2 gives the following output:
|
I can't repro the issue you are coming across for some reason. I tried all mutations of windows/linux and 1.39 and 1.38 SDK versions. |
@JohanNorberg As discussed today, we highly recommend using device SAS authentication instead of group SAS authentication. If your SAS token gets leaked in one device your whole IoT hub is compromised. Having said all that, there is a bug in the SDK where the initial CBS link doesn't get disposed which is causing the behavior you see. We are working on a fix and it will be out soon. So to work around the issue, we recommend the following:
Let us know if you find this useful. In the meanwhile, we will fix the issue and include it in the next release. |
Context
The bug is in 1.38, 1.39
Everything worked as it should in earlier versions, tested: 1.37.2, 1.37, 1.36, 1.35
Description of the issue
The SDK version 1.38 introduced issues when uploading files using DeviceClient, with Pooling and Amqp_Tcp_Only
To reproduce (100% reproduceable, on both Linux and Windows):
Code sample exhibiting the issue
you will need a textfile called "example.txt" in the same folder.
This will throw when using SDK version 1.38 & 1.39 but NOT on earlier versions.
Console log of the issue
The text was updated successfully, but these errors were encountered: