Some Files in Azure Blob Storage not shown in Media Library

Georg Pfeiffer asked on November 28, 2017 15:38

Hi,

we are currently trying to migrate our Kentico Media Library from file storage to Azure Blob Storage.

I loaded the Azure Storage Loader in the CMSModuleLoader. I added the appropriate appsettings in the web.config (AccountName, SharedKey, PublicContainer=true, BlobEndpoint). I copied all files from the file system to the Azure Blob Storage. Then I deleted the media library in the file system.

Now it mostly works fine, but some images are not shown. When I check a missing image it is there in the Kentico DB (table: Media_File) and also in the Azure Blob Storage, but it is not shown in the frontend (when using permanent urls, otherwise ofc it points directly to the Azure Blob Storage) and it's also not shown in the media library in the backend.

What's also strange is that when I explore the media library in Kentico's backend the number of files per folder is shown in brackets. For a folder I have for example 75 items, but when I click into the folder it only shows me ~35 items.

The problem is I can't reupload the missing files, because I get an error that they already exist in the DB. And I don't want to delete them in DB manually & reupload them because then I have to renew all the permanent URLs.

Do any of you know about this bug? Did I configure anything incorrectly?

Would appreciate any input.

Thanks, Georg

Correct Answer

Georg Pfeiffer answered on November 28, 2017 17:15

I figured it out.

The problem was that the filenames had upper-case letters in it. And since Kentico converts all filenames to lower-case it didn't find them on the Blob Storage.

This convention actually seems kinda strange. Why would all filenames be converted to lower-case when Azure Blob Storage is case-sensitive anyway?

0 votesVote for this answer Unmark Correct answer

Recent Answers


Brenden Kehren answered on November 28, 2017 15:51

Are you using a web farm? Are you positive those images are removed from the file system on the server? If not this will cause the problem you're stating. There is also a good chance there are orphaned files/db records out there too with this conversion. Do some queries against the database and see what's in a specific directory you're having problems with. Then compare the file system AND the blob storage. Most likely they didn't get copied fully or correctly and/or something not correct in the data.

0 votesVote for this answer Mark as a Correct answer

Georg Pfeiffer answered on November 28, 2017 16:08 (last edited on November 28, 2017 16:52)

Thanks for the fast response.

I'm positive that there are no more files on the file system. In fact I deleted the whole media library folder in the file system.

Ok upon checking again I can see that all files for that specific folder where it's not working are in DB as well as the blob storage. There are 74 files, but in Kentico backend I only see like ~35.

That's the really strange part. Everything seems correct but I still can't see or access it with permanent url.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on November 28, 2017 17:18

Azure uses lower case. Kentico converts them to lower case so they work properly with Azure blob storage. If you manually copied them, that would make sense.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.