Copied to clipboard

Flag this post as spam?

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


  • Angus 34 posts 128 karma points
    Dec 04, 2014 @ 11:49
    Angus
    0

    Error Refreshing Distributed List (v6.2.1)

    When creating a document programmatically using ContenrService the following error is reported in log:

    ERROR Umbraco.Core.Sync.DefaultServerMessenger - [Thread 18] Error refreshing distributed list

    System.InvalidOperationException: Cannot refresh by id if the idArrayType is null  at Umbraco.Core.Sync.DefaultServerMessenger.PerformDistributedCall(IEnumerable`1 servers, ICacheRefresher refresher, MessageType dispatchType, IEnumerable`1 ids, Type idArrayType, String jsonPayload)

    The document *is* published to both the master and slave. What is the significance of the error? Can it be ignored?

    Umbraco v6.2.1 (Assembly version: 1.0.5261.28997)

    Thanks.

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Dec 04, 2014 @ 11:53
    Dennis Aaen
    0

    Hi Angus,

    Perhaps this thread from StackOverflow can help you to solve the error.

    http://stackoverflow.com/questions/19131915/umbraco-content-syncing-issue-error-refreshing-a-node-in-the-distributed-list

    Hope this heps,

    /Dennis

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 04, 2014 @ 12:26
    Jan Skovgaard
    0

    Hi Angus

    If the solution Dennis mentions above does not work for you would you then mind sharing your code so the c# wizards can have a look and figure out if there is something that needs to be changed in order to get rid of the error perhaps?

    /Jan

  • Angus 34 posts 128 karma points
    Dec 04, 2014 @ 17:47
    Angus
    0

    Thanks for the prompt reply.

    Newly created documents are being *successfully* published to BOTH the master and slave so this doesn't appear to be an authentication issue.

    Calling the following method successfully creates and publishes the content but it generates the log file error:

    public bool AddWhatsNew(string nodeName, int parentId, string headline, string summary, string urlpickerMode, string targetURL, int targetNodeId, string publicationDate)
    {
    try
    {
    // get the content service
    var contentService = ApplicationContext.Current.Services.ContentService;
    // create 'What's New' doc
    IContent newdoc = contentService.CreateContent(nodeName, parentId, "whatsnew");
    // set values : headline, summary, target, publicationdate
    newdoc.SetValue("headline", headline);
    newdoc.SetValue("summary", summary);
    // set 'target' property, a urlpicker
    Property p = newdoc.Properties["target"];
    // create new urlpicker state
    UrlPickerState pState = new UrlPickerState();
    // set values : assume urlpicker mode 'URL' or 'Content'
    pState.Title = nodeName;
    if (urlpickerMode.Equals("URL")) {
    pState.Mode = UrlPickerMode.URL;
    pState.Url = targetURL;
    } else {
    pState.Mode = UrlPickerMode.Content;
    pState.Url = targetURL;
    pState.NodeId = targetNodeId;
    }
    // set the 'target' parameter value to the serialisation of the urlpicker state
    p.Value = pState.Serialize(UrlPickerDataFormat.Xml);
    //newdoc.SetValue("publicationdate", publicationDate);    // doesn't work in 6.2.1! 
    string[] dateEelements = publicationDate.Split('-');
    int year = Int32.Parse(dateEelements[0]);
    int month = Int32.Parse(dateEelements[1]);
    int day = Int32.Parse(dateEelements[2]);
    newdoc.SetValue("publicationdate", new DateTime(year, month, day));
    // save and publish the document
    contentService.SaveAndPublishWithStatus(newdoc);
    return true;
    }
    catch (Exception cdex)
    {
    LogHelper.Info(this.GetType(), "\nAddWhatsNew : " + cdex.Message + " : " + cdex.StackTrace);
    return false;
    }
    }

     

    Exmaple Call:

    AddWhatsNew("Planning Service - Development Plan Consultations", 4009, "Planning Service - Development Plan Consultations", "Update to Review of Supplementary Guidance for Wind Energy Development...", "URL", "http://intranet/planningservice/devplanconsultations.asp", -1, "2014-12-03");

  • Simon Dingley 1474 posts 3431 karma points c-trib
    Dec 20, 2014 @ 09:07
  • Angus 34 posts 128 karma points
    Dec 22, 2014 @ 13:58
    Angus
    0

    Hi Simon,

    Errors still appearing in the log file! Other than the mild irritation caused by the presence of the errors, as our setup is in development and functionality is not compromised - the newly created documents being published to both the local and the distributed server, i.e., both caches are being successfully updated - I'm basically ignoring the errors for now.

    /Angus

Please Sign in or register to post replies

Write your reply to:

Draft