Try our conversational search powered by Generative AI!

Error converting local assets to Azure blob storage

Vote:
 

Using Episerver 11 on Episerver Azure host

On a new site, I created many media images that are currently stored in the App_Data blob folder.  I've installed the EpiCode.BlobConverter package to migrate these to Azure blob storage.  I've confirmed that my Azure blob provider has been added to the web.config file.  

<episerver.framework>
  <blob defaultProvider="azureblobs" xdt:Transform="Insert">
    <providers>
      <add name="azureblobs" type="EPiServer.Azure.Blobs.AzureBlobProvider,EPiServer.Azure" connectionStringName="EPiServerAzureBlobs" container="mysitemedia"/>
    </providers>
  </blob>
</episerver.framework>


However, when I run the "Convert File Blobs" job, I get the following error for all images.  

System.IO.IOException: The process cannot access the file 'D:\home\site\wwwroot\App_Data\blobs\fff13e7fcf584be3869b7ba1113d3e74\42922beab0db42aeb9889606ebdec309_Thumbnail.png' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at EPiServer.Framework.Blobs.FileBlob.OpenWrite() at EPiServer.Framework.Blobs.FileBlob.Write(Stream data) at EPiCode.BlobConverter.BlobJob.ProcessFile(String path, String directory)

Any idea on how to convert these images to blob storage?

#205819
Edited, Jul 24, 2019 15:56
Vote:
 

I'm unfamiliar with BlobConverter, but perhaps you can try to run Clear Thumbnail Properties job first to clear the thumbnail blobs, to reduce the migration time overall. Those thumbnails will be created on demand anyway. 

#205822
Jul 24, 2019 16:11
Vote:
 

Just tried clearing thumbnails.  That job ran successfully and did clear quite a few.  However, the same error when running BlobConverter.  Thanks for the input.

#205823
Jul 24, 2019 16:15
Vote:
 

So you have the file name that is "being used". You can use https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer, then Find -> Find Handle Or Dll, then search by the file name, you'll find out which process is using that find, then can kill it. 

#205825
Jul 24, 2019 16:34
Vote:
 

I am running this job on an Episerver hosted Azure environment.  I don't have the ability to run that.

#205827
Jul 24, 2019 16:43
Vote:
 

Then that is likely the problem. Your site does not have access to those files on DXC, and the error threw can be misleading.

I'd suggest to run that on local site with access to the files locally (You can point to the db on DXC)

#205831
Jul 24, 2019 16:51
Vote:
 

Hey,

If blob converter is not working then you can use the import/export process of Episerver.

First export your media items and import it to your azure site it will automatically upload it in blob storage.

Thanks

Ravindra 

#205832
Jul 24, 2019 17:16
Vote:
 

Following the advice from Quan Mai above, I ran this site locally and the "Convert File Blobs" job ran successfully.  I've viewed the site with the Azure Storage Explorer and can verify that the blobs are there.  Thanks for everyone's help.

#205847
Jul 24, 2019 19:01
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.