Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • NSC 23 posts 123 karma points
    Nov 26, 2021 @ 09:31
    NSC
    0

    usync publish to server only sends a shell of the node

    When using the the "publish to..." or "publish to server..." options in uSync with Umbraco 9 (both uSync and Umbraco updated to latest version) I can't get the anything but the "shell" of the node to show up on the receiving end.

    So if I send the following: enter image description here

    I end up receiving this: enter image description here

    So none of the values of the properties actually get sent. There is no errors in Umbraco's logs.

    Any ideas what's going wrong?

  • Kevin Jump 2343 posts 14890 karma points MVP 8x c-trib
    Nov 26, 2021 @ 10:19
    Kevin Jump
    0

    Hi,

    no idea (yet) why its doing that, but it looks like it is only running the first half of the sync process.

    Syncing content is done in two stages, the nodes are created in the first one and the properties updated in the second step.

    if you add debug logging for uSync it might give you a bit more information and maybe a hint of where it is going wrong.

    in app settings, add a "uSync": "Debug" value to the Serilog settings so it looks something like this

    "Serilog": {
        "MinimumLevel": {
          "Default": "Information",
          "Override": {
            "Microsoft": "Warning",
            "Microsoft.Hosting.Lifetime": "Information",
            "System": "Warning",
            "uSync": "Debug"
          }
        }
      },
    
  • NSC 23 posts 123 karma points
    Nov 26, 2021 @ 10:35
    NSC
    0

    After adding debug logging I get this: enter image description here

    Though I don't know why they're disabled - I haven't disabled any handlers AFAIK.

  • Kevin Jump 2343 posts 14890 karma points MVP 8x c-trib
    Nov 26, 2021 @ 10:43
    Kevin Jump
    0

    Hi

    Yeah with debugging on I would expect that when you perform a sync from the standard uSync dashboard. In the background uSync publisher has disabled all of those handlers for a normal sync (so publishedContentHandler is the one publisher uses but not a normal uSync. the others are to handle file transferes).

    However when you push content from the content tree - you should see something like this. on your 'source' server

    enter image description here

    and something like this on the target:

    enter image description here

  • NSC 23 posts 123 karma points
    Nov 26, 2021 @ 11:05
    NSC
    0

    Aaaahhh, I found the issue now - TL;DR: It's my fault! :D

    I have made a handler that blocks anyone without an admin role from changing certain things (because you cannot set permissions for specific properties on a node, which is disappointing) but uSync doesn't have an admin role when trying to transfer content, so it fails.

    Disabling this handler makes it work flawlessly :) Is there any way to give uSync a role or indentify the uSync process so I can keep my handler while not breaking uSync?

  • Kevin Jump 2343 posts 14890 karma points MVP 8x c-trib
    Nov 26, 2021 @ 11:13
    Kevin Jump
    1

    Hi,

    Maybe it might depend a bit on your handler,

    when uSync publisher is running the remove commands the process running creates a Claim Identity with the name "hmacauth" with a "Remote" claim,

    so maybe you could check to see if that claim exists on the process (not sure if this makes sense or would work?)

    more generically whenever uSync is doing something it actually pauses some of the other uSync elements using the uSyncEventService.

    you could inject this service and then check for IsPaused. which would tell you if uSync is doing anything at the time, and therefor likely the thing that is updating the content.

    e.g

    if (_uSyncEventService.IsPaused) { 
       // triggered by an usync update
    }
    

    not sure but these might help?

  • NSC 23 posts 123 karma points
    Nov 26, 2021 @ 11:49
    NSC
    0

    Using uSyncEventService.IsPaused works perfectly :)

    Thanks so much for your help Kevin!

Please Sign in or register to post replies

Write your reply to:

Draft