-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Azure Blob Storage issue with 0 byte files #8715
Comments
Without relevant version information I cannot help you. Also, please do not tag me in repositories I do not own. |
Oh sorry for the tagging. I think you and Dean merged a PR that fixed the LRU cache recently so I thought I should warn you both about this.... version 1.0.2 |
I'll revert to 1.0.1 ... |
Wow this guy did a thumbsup too 😄 |
Scratch that silly question. |
I kept the files if you need one but definitely reverting to SixLabors.ImageSharp.Web 1.0.1 fixed the issue after I cleared the cache. Maybe the issue is in OC too because this is our own local cache. Need more testing. Actually not that silly since the size of that file is 0 bytes. |
Your own cache implementation? This could be a critical factor. |
I'm moving back to 1.0.2 to find that file in the ImageSharp cache. It's not my own cache it's the OC media cache. The only thing that changed is the SixLabor.ImageSharp.Web assembly recently. So this is why my guess on the issue went there first. |
Ok found the issue. It's not ImageSharp related. I litterally made my PC crash by adding the Azure Blob Storage DNS in my host file to point to 127.0.0.1 So it's a network and/or local storage issue which corrupted those files in the ms-cache folder. Then it logged that ImageSharp could not process these files. We need to have something in OC to prevent this from happening. |
StackOverflow is a surprise. I normally just get a timeout if I'm testing my Azure provider locally having forgotten to turn on the local emulator. |
I'm pretty sure we have something going on in OC because I remember talking about this with @deanmarcussen a while ago. He probably already knows. I'd be surprised that the issue is my SSD drive. It's just hard to repro a temporary network failure. Thanks for your helps by the way and sorry for my tagging 😉 |
I'm not sure I totally understand what you did here @Skrypt
I think I have seen behaviour from the blob storage client where you can induce a stack overflow by pointing it at a localhost address previously. i.e. a connection string of If this the equivalent of what you've done, then the thing to do would be to repro the issue without Orchard Core, and report it on the Azure Blob Storage repo. I'm not sure what we could do regarding it, as it seems a network related / blob storage client issue |
Well, I had the stackoverflow issue all day yesterday. The thing is that these 0 bytes files we're trying to get resized by ImageSharp and my PC was litterally freezing while I was on Skype with @jtkech. So, it's not just the Azure Blob Storage. I kept the files to be able to repro, but I should never had a 0 byte file saved on my drive at first. To repro the network issue I just decided to point the DNS to a local IP address "so that it fails reaching it". When I start the app in VS Code it properly fails with a exception page. I will try to repro make my PC crash today. Basically, what I did is change the DNS while the app was already running "debugging with VS Code". I'm using also the DataProtection keys from Azure so it's quite complicated to repro the initial issue. How could I repro getting a 0 byte file in the ms-cache folder? |
I kept the 0 byte files to test if we could not add a validation before trying to morph these files with ImageSharp. Though ImageSharp seems to properly fail and log these. Now, the other thing is that if my PC crashed or freezed it means that it does when it tries to read these files still or because of a network or ssd drive issue. But there is definitely an infinite loop happening. |
I'm now using a background task that will empty these cache folder periodically to refresh them as a solution. |
I've been able to repro the 0 byte file issue.
While testing this background task I've been spamming the pager of my website to see what would happen if these files we're getting queued up to get resized by ImageSharp. No issue there, the problem though is that the request gets cancelled and therefore it leaves a 0 byte file there on the drive. OrchardCore/src/OrchardCore/OrchardCore.Media.Core/DefaultMediaFileStoreCacheFileProvider.cs Lines 59 to 89 in 44d034e
It's an annoying issue that fills up my logs. So, having fun debugging this today 😉 And one thing I've noticed which would have made my life easier is to be able to purge the is-cache folder from ImageSharp without getting locked files. I made it work without throwing any log today, though it will log issues when I'm trying to remove a folder that just got a file added in while waiting on lock to release. So, purging the cache from the ImageSharp API would have been easier. Maybe not for Jim but for me 😉 |
Rethinking about the stackoverflow I got yesterday. It did happen again today. But it was happening when I got the issue from the previous post leaving me to think these Azure Blob Storage requests that gets cancelled queues up and then made the stackoverflow happen. But, I'm not sure yet. I think the stackoverflow is a collateral. Maybe an issue with the Azure Blob Storage client like Dean said yesterday (leaving notes to myself). |
Since you say this may be an issue with the client library, what we kept up-to-date since then, perhaps this is fixed now? Do you still experience this? |
It seems that this issue didn't really move for quite a while despite us asking the author for further feedback. Is this something you'd like to revisit any time soon or should we close? Please reply. |
Closing this issue because it didn't receive further feedback from the author for very long. If you think this is still relevant, feel free to reopen it with the requested details. |
When using the blob storage with the Media feature. If we get any kind of network issue that doesn't complete downloading the file from the blob storage to the ms-cache folder it can cause a stack overflow.
You can repro the issue by displaying a list of content items with a pager. Spam the pager links and you will end up with Azure Blog Storage requests that got cancelled.
If a file doesn't resume to get downloaded completely it will create a file in the ms-cache folder with 0 byte. If you are using ImageSharp to alter this image then it will log that the image cannot be processed because it has not header. It can't find the file type to "resize" the image...
/cc @deanmarcussen
The text was updated successfully, but these errors were encountered: