Skip to Content
0
Former Member
Sep 15, 2014 at 08:57 AM

Change in image folder storage strategy from default to S3 is causing deletion of media files in sys_master folder?

1727 Views

We have a unique situation. We are trying to use S3 storage strategy for images folder. Previously this folder was using default strategy (standard config). Our S3 config looks something like following,

 media.folder.images.storage.strategy=s3MediaStorageStrategy
 media.folder.images.url.strategy=s3MediaURLStrategy
 media.folder.images.accessKeyId=OURKEY
 media.folder.images.secretAccessKey=OURSECRET
 media.folder.images.endpoint=s3.amazonaws.com
 media.folder.images.bucketId=ourbucket
 media.folder.images.url.signed=false
 media.folder.images.url.unsigned.https=true
 media.folder.images.url.unsigned.virtualHost=false
 media.folder.images.url.validFor=120

In our development environment we are using DB dump and copy of sys_master folder from production (exluding images). We have copied all content of images folder to S3 bucket.

Now interesting bit, when we start Hybris locally it is deleting all the files in sys_master folder although it is keeping the folder structure as it is.

We tried several times with variety of configs but still same outcomes.

What we are missing here?

Our Hybris version: 5.0.2.1

This is definitely not an Amazon S3 issue. Our local.properties and project.properties are same in Prod and Dev with minor config differences.

Update: We enabled the media debug logging log4j.logger.de.hybris.platform.media = debug and this is what we found, clearly Hybris is removing the actually file assuming the cached file.

 INFO   | jvm 1    | main    | 2014/09/16 14:48:20.944 | DEBUG [Cluster 0: Lucenesearch-RebuildIndex-Job::de.hybris.platform.lucenesearch.jalo.RebuildIndexJob] (Cluster 0: Lucenesearch-RebuildIndex-Job) [DefaultLocalMediaFileCacheService$MediaCacheUnit] Removed cached file: C:\Work\hybris\data\media\sys_master\hfc\ha2\8831546982430.gif​

This is not an issue when either we use only default storage strategy or only s3 storage storage strategy, only when we use both we see this happening.