Copied to clipboard

Flag this post as spam?

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


  • Bijesh Tank 192 posts 420 karma points
    Aug 10, 2011 @ 10:50
    Bijesh Tank
    0

    Error in scheduled task

    Hi,

    I have a scheduled task setup to import items from a datasource.  The task seems to kick off ok as I receive an email from the the cmsimport robot, but the import process always seems to have an error.  The error message is below:

    1 records in datasource 0 records added 0 records updated 0 records skipped 1 errors during import

    Errors:System.NullReferenceException: Object reference not set to an instance of an object. at CMSImportLibrary.FieldAdapters.FieldFactory.[1].[1](IFieldAdapter [1]) at System.Collections.Generic.List`1.FindAll(Predicate`1 match) at CMSImportLibrary.FieldAdapters.FieldFactory.Parse(Property prop, Object value, FieldAdapterOptions fieldAdapterService) at CMSImportLibrary.Import.ContentImporter.Import(ImportState state, User importAsUser)

     

    Any idea why this keeps happening? I get this for every single import that I try to run. If I do the import manually (going through the wizard steps) it seems to import and publish with no problem.

    Thanks

  • Bijesh Tank 192 posts 420 karma points
    Aug 10, 2011 @ 10:54
    Bijesh Tank
    0

    Forgot to mention, i have Umbraco v4.0.4.2 and CMSImport v1.2

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Aug 21, 2011 @ 09:39
    Richard Soeteman
    0

    Hi,

    What happens if you just open the saved import definition? The error is related to FieldAdapters, did you use one? If opening the saved definition gives you the same error you might want to delete these definitions and save the manual process again and schedule that one. Still a weird error though.

    Cheers,

    Richard

  • Bijesh Tank 192 posts 420 karma points
    Nov 30, 2011 @ 11:12
    Bijesh Tank
    0

    For some reason, this seems to be working again now and publishing items now on a scedule.  But now I have another weird issue, it seems to be creating duplicates of those items.  It only does this when I have the sceduled task activated, it creates around 7-8 duplicate items for every item it imports.  Importing it manally (right click & execute) works as normal and only imports and publishes once.

    I have checked in the umbracoSetting.config and made sure that ensureUniqueNaming is set to true, which it is.

    So next I checked the Umbraco log table and can see that it seems to call the scheduled task multiple times in a minute even though I have the polling set to 60 seconds (see line below)

     <task log="true" alias="CMSImportScheduler" interval="60" url="http://www.mydomain.com/umbraco/plugins/CMSImport/Handlers/ScheduleTaskHandler.ashx" />

    In the Umbraco log table, it says this (as an example):

    2722267 | 0 | -1 | 2011-11-30 10:03:46.690 | ScheduledTaskCMSImportScheduler has been called with response: True

    2722266 | 0 | -1 | 2011-11-30 10:03:45.723 | ScheduledTaskCMSImportScheduler has been called with response: True

    2722265 | 0 | -1 | 2011-11-30 10:03:27.527 | ScheduledTaskCMSImportScheduler has been called with response: True

    2722264 | 0 | -1 | 2011-11-30 10:03:25.617 | ScheduledTaskCMSImportScheduler has been called with response: True

    2722263 | 0 | -1 | 2011-11-30 10:03:20.450 | ScheduledTaskCMSImportScheduler has been called with response: True

    2722262 | 0 | -1 | 2011-11-30 10:03:20.013 | ScheduledTaskCMSImportScheduler has been called with response: True

    2722261 | 0 | -1 | 2011-11-30 10:03:03.477 | ScheduledTaskCMSImportScheduler has been called with response: True

     

    Why is it being called multiple times per minute, even though the task is set to once every 60 seconds? How can I get rid of the multiple calls?

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Nov 30, 2011 @ 13:22
    Richard Soeteman
    0

    Hi Bijesh,

    I think for some reason the umbraco scheduler queued up the scheduled url's and executes them at the same time. Not sure if that causes duplicate items because normally a relation record is created and then an update will occur.

    I've seen an email this week where the customer used an external ping site (pingdom) or Google to ping the scheduledtaskhandler every hour then the import occured. maybe that could be an option for you as well?

    Best,

    Richard

  • Bijesh Tank 192 posts 420 karma points
    Nov 30, 2011 @ 15:18
    Bijesh Tank
    0

    Thanks for replying Richard.

    It just seems that whenever I the schedule gets called, it does it 7 times with the set polling period when it should only be once. And on the front end it creates and publishes 7 versions of that same item as well. It just seems a little strange that even though the polling is set to 60 seconds it should only fire once, not 7.  

    This is an example of what is created in the content tree:

    Is there something I can do with the Umbraco scheduler to sort this? I'm not familiar with this.

    The external ping sounds interesting.  What is required to set this up and and URL would it ping?

    Thanks,

    Bijesh

Please Sign in or register to post replies

Write your reply to:

Draft