Jumoo / uSync.Complete.Issues

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

uSync v8.11.8 media files not created on target environment, using Azure blobs #177

Closed mhesselberg closed 1 year ago

mhesselberg commented 2 years ago

Describe the bug

Publishing a content node does copy over the media file used by the media node. The Media node is created as expected, however the actual media file is missing.

Version (please complete the following information):

Umbraco Version: 8.7.0 uSync Version: 8.11.0 uSync.Complete Version: 8.11.8

Our setup runs some dependency handlers using a derived class from SyncValueMapperBase and interface ISyncMapper, and returns the umb://media/ links as dependencies. One of these handlers is checking for links to content and media items in rich text editors.

The media nodes is created perfectly fine on the target environment, and referenced in the synced rich text editor content as expected as well. I can also see the file has been properly created on the blob storage as expected. So far so good.

However, the file itself is not set in the Media node (and neither is any other properties like width, height etc.)

When I try to push the media item directly from the Media section, I can see that the 'umbracoFile' property is being set (and this does solve the issue, but creates a non-acceptable workflow for the editor).

The error specifically occurs when using the Publisher prompt from the Content node that has a dependency on the media node. It only sets the FileHash value from the Content publish (and for the record, this only applies the second time the Publisher runs - the first time the FileHash isn't set either).

KevinJump commented 2 years ago

Hi, In the past we have had a few issues with azure blob storage

it might be worth looking at this issue https://github.com/Jumoo/uSync.Complete.Issues/issues/63 we ended up having a custom setting in web.config if the azure folder was non-custom

also we had this

the key is if you can share your azure settings (remove the connection values) and we can take a look also if you export a 'broken' media item with uSync and we could see what the umbracoFile value is , that might help pinpoint an issue

mhesselberg commented 2 years ago

I've already checked and searched those issues (ok, #86 was new, but seems unrelated) - and I'm pretty sure your fixes from those should have been applied (since we run 8.11/8.11.8) or be irrelevant (we use default media route).

Here's the web.config of the source: image

And here's the web.config of the target: image

This is the umbracoFile property value of the source: image

And here is the property values of the target (there aren't any): image

And finally, here's the previewed changes from source to target when publishing the page with the reference to the item - this is the reported changes to media: image

But if I preview the changes made when publishing the media item directly from the Media section, this is the preview I get: image

Even though the image looks like this on the target environment (as evidenced by the missing property values: image

Note that even the content page 'push' doesn't set the file correctly, either. So the fileHash change doesn't do anything on the target environment, nothing happens.

mhesselberg commented 2 years ago

@KevinJump I'm not entirely in the loop on your normal procedure for bug reports, how can I track the status of this bug?

KevinJump commented 2 years ago

Hi @mhesselberg sorry i missed this .

I done a check to see if this is working on latest things (Umb v8.18.4/ uSync v8.11.8 / AzureBlobProvider v3.0.2 ) (I don't think there are radical changed in later versions of Umbraco so i doubt upgrading would fix anything new)

So just to confirm (i think this mirrors your setup)

Source :

<add key="AzureBlobFileSystem.ContainerName:media" value="media" />
<add key="AzureBlobFileSystem.RootUrl:media" value="https://xxxxxxeu.blob.core.windows.net/" />
<add key="AzureBlobFileSystem.ConnectionString:media" value="xxxxxxx" />
<add key="AzureBlobFileSystem.MaxDays:media" value="365" />
<add key="AzureBlobFileSystem.UseDefaultRoute:media" value="true" />
<add key="AzureBlobFileSystem.UsePrivateContainer:media" value="false" />

Target:

<add key="AzureBlobFileSystem.ContainerName:media" value="media" />
<add key="AzureBlobFileSystem.RootUrl:media" value="https://xxxxxuk.blob.core.windows.net/" />
<add key="AzureBlobFileSystem.ConnectionString:media" value="xxxxxxx" />
<add key="AzureBlobFileSystem.MaxDays:media" value="365" />
<add key="AzureBlobFileSystem.UseDefaultRoute:media" value="true" />
<add key="AzureBlobFileSystem.UsePrivateContainer:media" value="false" />

so to confirm - that is two different storage accounts (going from Azure EU site to Azure UK site)

Pushing between the two works

(note, i haven't setup all the image processor stuff or anything - but that shouldn't change these results)


So maybe we need to just confirm uSync settings in case there is some thing there stopping this working.

This is a new install so the default settings on the server image

the uSync8.config file contains the default and publisher handler sets (the publisher one is important here as that is what we use when we push).

    <HandlerSets Default="default">
      <Handlers Name="default">
        <Handler Alias="dataTypeHandler" Enabled="true" />
        <Handler Alias="languageHandler" Enabled="true" />
        <Handler Alias="macroHandler" Enabled="true" />
        <Handler Alias="mediaTypeHandler" Enabled="true" />
        <Handler Alias="memberTypeHandler" Enabled="false" />
        <Handler Alias="templateHandler" Enabled="true" />
        <Handler Alias="contentTypeHandler" Enabled="true" />
        <Handler Alias="contentHandler" Enabled="true" />
        <Handler Alias="contentTemplateHandler" Enabled="true" />
        <Handler Alias="dictionaryHandler" Enabled="true" />
        <Handler Alias="domainHandler" Enabled="true" />
        <Handler Alias="mediaHandler" Enabled="true" />
        <Handler Alias="relationTypeHandler" Enabled="false" />
        <Handler Alias="memberHandler" Enabled="false" />
        <Handler Alias="memberGroupHandler" Enabled="false" />
        <Handler Alias="userHandler" Enabled="false" />
        <Handler Alias="userGroupHandler" Enabled="false" />
      </Handlers>
      <Handlers Name="publisher">
        <Handler Alias="dataTypeHandler" Enabled="true" Actions="All" />
        <Handler Alias="languageHandler" Enabled="true" Actions="All" />
        <Handler Alias="macroHandler" Enabled="true" Actions="All" />
        <Handler Alias="mediaTypeHandler" Enabled="true" Actions="All" />
        <Handler Alias="memberTypeHandler" Enabled="true" Actions="All" />
        <Handler Alias="templateHandler" Enabled="true" Actions="All" />
        <Handler Alias="contentTypeHandler" Enabled="true" Actions="All" />
        <Handler Alias="publishedContentHandler" Enabled="true" Actions="All" />
        <Handler Alias="contentTemplateHandler" Enabled="true" Actions="All" />
        <Handler Alias="dictionaryHandler" Enabled="true" Actions="All" />
        <Handler Alias="domainHandler" Enabled="true" Actions="All" />
        <Handler Alias="mediaHandler" Enabled="true" Actions="All" />
        <Handler Alias="publicAccessHandler" Enabled="true" Actions="All" />
        <Handler Alias="mediaFileHandler" Enabled="true" Actions="All">
          <Add Key="IncludeFileHash" Value="true" />
        </Handler>
      </Handlers>
    </HandlerSets>

I wonder if its in this config ? because if the publisher set is missing or the "IncludeFileHash" setting has been changed then what is sent across might not be what is expected.

mhesselberg commented 2 years ago

@KevinJump this time I was the one several days behind :D

The settings on source vs. target in the publisher

image

And here's the usync8.config of the source environment:

<?xml version="1.0" encoding="utf-8"?>
<uSync>
  <BackOffice>
    <Folder>~/uSync/v8/</Folder>
    <FlatFolders>True</FlatFolders>
    <ImportAtStartup>False</ImportAtStartup>
    <ExportAtStartup>False</ExportAtStartup>
    <ExportOnSave>True</ExportOnSave>
    <UseGuidFilenames>False</UseGuidFilenames>
    <BatchSave>False</BatchSave>
    <!-- calls a rebuild cache when an import completes
        (for Umbraco 8.3+ recommended value is false)  -->
    <RebuildCacheOnCompletion>False</RebuildCacheOnCompletion>
    <!-- handler sets -->
    <HandlerSets Default="default">
      <Handlers Name="default">
        <Handler Alias="dataTypeHandler" Enabled="true" />
        <Handler Alias="languageHandler" Enabled="true" />
        <Handler Alias="macroHandler" Enabled="true" />
        <Handler Alias="mediaTypeHandler" Enabled="true" />
        <Handler Alias="memberTypeHandler" Enabled="false" />
        <Handler Alias="templateHandler" Enabled="true" />
        <Handler Alias="contentTypeHandler" Enabled="true" />
        <Handler Alias="contentHandler" Enabled="true" />
        <Handler Alias="contentTemplateHandler" Enabled="true" />
        <Handler Alias="dictionaryHandler" Enabled="true" />
        <Handler Alias="domainHandler" Enabled="true" />
        <Handler Alias="mediaHandler" Enabled="true" />
        <Handler Alias="relationTypeHandler" Enabled="false" />
        <Handler Alias="memberHandler" Enabled="false" />
        <Handler Alias="memberGroupHandler" Enabled="false" />
        <Handler Alias="userHandler" Enabled="false" />
        <Handler Alias="userGroupHandler" Enabled="false" />
      </Handlers>
      <Handlers Name="publisher">
        <Handler Alias="dataTypeHandler" Enabled="true" Actions="All" />
        <Handler Alias="languageHandler" Enabled="true" Actions="All" />
        <Handler Alias="macroHandler" Enabled="true" Actions="All" />
        <Handler Alias="mediaTypeHandler" Enabled="true" Actions="All" />
        <Handler Alias="memberTypeHandler" Enabled="true" Actions="All" />
        <Handler Alias="templateHandler" Enabled="true" Actions="All" />
        <Handler Alias="contentTypeHandler" Enabled="true" Actions="All" />
        <!-- publisher only send published content -->
        <Handler Alias="publishedContentHandler" Enabled="true" Actions="All" />
        <Handler Alias="contentTemplateHandler" Enabled="true" Actions="All" />
        <Handler Alias="dictionaryHandler" Enabled="true" Actions="All" />
        <Handler Alias="domainHandler" Enabled="true" Actions="All" />
        <Handler Alias="mediaHandler" Enabled="true" Actions="All" />
        <Handler Alias="publicAccessHandler" Enabled="true" Actions="All" />
        <Handler Alias="mediaFileHandler" Enabled="true" Actions="All">
          <Add Key="IncludeFileHash" Value="true" />
        </Handler>
      </Handlers>
    </HandlerSets>
    <!-- custom mappings to things that are already in umbraco -->
    <!-- if you content is stored exactly like it is in an existing 
             propertyEditor, you can map to it here. -->
    <!-- 
        <Mappings>
            <Add Key="MyCustomUrlPicker" Value="Umbraco.MultiUrlPicker" />
        </Mappings>
        -->
    <!-- defaults settings that can be used across all handlers -->
    <!-- 
        <HandlerDefaults>
            <Add Key="NoRemove" Value="true" />
            <Add Key="CreateOnly" Value="true" />
        </HandlerDefaults>
        -->
    <dependency>
      <publisherDependencyCache>True</publisherDependencyCache>
    </dependency>
  </BackOffice>
</uSync>
mhesselberg commented 2 years ago

@KevinJump any new developments here?

For now, we've convinced the editors to push their images/files manually from the Media section, but it's not ideal for their workflow.

mhesselberg commented 2 years ago

@KevinJump

I guess this is not a priority for you. I'll let our customer know that they will have to accept the less than ideal workflow if they stay on their current versions.

KevinJump commented 2 years ago

Hi,

yeah sorry i haven't really had time to dive into this over the last few weeks, - but i will take another look because this did work for me.

I suppose the only thing i just noticed from your screenshot above (i have looked at this issue before i just didn't notice) - is that you have 'Include media' unticked on the main content sync options. if this isn't ticked later by the user then the media won't form part of a content push. ?

I suspect you know that - but worth checking.

KevinJump commented 2 years ago

If you want to drop me an email kevin@jumoo.co.uk we could arrange a call next week, maybe to go over stuff, and see if there is anything we spot ?

mhesselberg commented 2 years ago

If you want to drop me an email kevin@jumoo.co.uk we could arrange a call next week, maybe to go over stuff, and see if there is anything we spot ?

My holidays are starting today, so I'll be off for most of July.

Yes, the default setup is by intent, they have to check it manually. It's a pretty large site content-wise (we get timeouts when trying to build a cache in uSync Publisher) so every little bit helps when they try to push content about.

I'll mail you and see if we can setup a screenshare session come August.

Thanks!

mhesselberg commented 1 year ago

On todays screenshare session, we couldn't reproduce the issue.

I got some pointers on what we could do to investigate if this occurs again.

I'll close the issue as 'not reproducible'.

Thanks!