Jumoo / uSync.Complete.Issues

Public Issue tracker and roadmap for uSync.Complete
https://jumoo.co.uk/usync/complete/
2 stars 1 forks source link

Media files in AWS S3 bucket nested folder not synchronising #143

Closed LottePitcher closed 2 years ago

LottePitcher commented 2 years ago

Describe the bug Using an S3 bucket which just uses /media as the folder works fine. However our staging and production environments have to use a folder structure such as /AB1234/media. Since upgrading uSync Complete, pushing of media from an environment with a nested folder doesn't report that it failed, but the media files themselves are not getting moved over. If we create a sync pack in this environment then the .usync file is also missing the media files.

Version:

I have tested this on Umbraco v8.17.1 on various uSync Complete versions. uSync Complete v8.11.1 seemed to work ok, i.e. the media moved across. It was after upgrading to v8.11.2 that it stopped working.

All uSync package version numbers (in case missed an upgrade):

  <package id="uSync" version="8.10.4" targetFramework="net472" />
  <package id="uSync.BackOffice.Core" version="8.10.4" targetFramework="net472" />
  <package id="uSync.Community.Contrib" version="8.10.4" targetFramework="net472" />
  <package id="uSync.Complete" version="8.11.4" targetFramework="net472" />
  <package id="uSync.ContentEdition" version="8.10.4" targetFramework="net472" />
  <package id="uSync.Core" version="8.10.4" targetFramework="net472" />
  <package id="uSync.Expansions.Core" version="8.11.4" targetFramework="net472" />
  <package id="uSync.Exporter" version="8.11.4" targetFramework="net472" />
  <package id="uSync.History" version="8.10.4" targetFramework="net472" />
  <package id="uSync.PeopleEdition" version="8.11.4" targetFramework="net472" />
  <package id="uSync.Publisher" version="8.11.4" targetFramework="net472" />
  <package id="uSync.Snapshots" version="8.11.4" targetFramework="net472" />

S3 media provider:

  <package id="Our.Umbraco.FileSystemProviders.S3.Core" version="8.1.0" targetFramework="net472" />
  <package id="Our.Umbraco.FileSystemProviders.S3.Media" version="8.1.1" targetFramework="net472" />

I appreciate we are have a unconventional set up. I've listed out everything below that we have to do to the site in order to get the nested folder set up working in S3, a fair few hoops to jump through sadly :(

S3 web.config settings:

    <add key="AWSAccessKey" value="XXXX" />
    <add key="AWSSecretKey" value="XXXX" />
    <add key="BucketFileSystem:Region" value="eu-west-1" />
    <add key="BucketFileSystem:BucketName" value="XXXX" />
    <add key="BucketFileSystem:MediaPrefix" value="AB1234/media" />
    <add key="BucketFileSystem:FormsPrefix" value="forms" />
    <add key="BucketFileSystem:BucketHostname" value="https://XXXX.s3.amazonaws.com/" />
    <add key="BucketFileSystem:DisableVirtualPathProvider" value="false" />

uSync web.config settings: <add key="uSync.MediaFolder" value="/AB1234/media" />

config/imageprocessor/security.config imageprocessor-security-config.txt

This S3 provider has a virtual path hard coded to /media so we have also had to add a Component to override this behaviour. Wasn't sure if GitHub would like a .cs file so posting here as .txt: MediaFilePathFixComposer.txt

Oh and then finally we found we needed a physical folder called /AB1234/media in the website with the same web.config file that lives in /media.

I think that's everything! Thank you!

KevinJump commented 2 years ago

Hi,

Think we have a fix for this now, with the virtual path provider disabled, we where removing one of the bits of the media path prematurely before we got the file from the Umbraco services.

with that taken out it works. (also still works on azure, and without any file provider 👍 )

this will be in the next release 8.11.5 (which is all but complete now).

Just going to double check we haven't also done this in v9.

LottePitcher commented 2 years ago

Excellent, thanks for the update 🙏

KevinJump commented 2 years ago

Note to self : v9 is clear - and works already