• Howdy.

    Our instance hasn’t had a successful pull from Salesforce since 6:44 am today. Pushes are happening successfully.

    I checked scheduling in the plugin – all good (set to run every 3 minutes, no changes).
    Nothing telling in the logs, including when debug is enabled.

    Looking in Scheduled Actions, the last entry I see for object_sync_for_salesforce_pull_check_records is “failed” at 1:04 am:

        2022-12-09 01:01:21 +0000
        action created
        2022-12-09 01:04:42 +0000
        action started via Async Request
        2022-12-09 01:10:14 +0000
        action marked as failed after 300 seconds. Unknown error occurred. Check server, PHP and database error logs to diagnose cause.

    Does this mean that’s the last time it ran at all, or just the last time it was recorded as “failed”? I see a couple of unrelated pending actions in there as well. I don’t see pull_check_records as pending though.

    Cron Manager suggests cron is running correctly. Nothing appears stuck in the queue and it updates on refresh.

    Is it telling that object_sync_for_salesforce_pull_check_records is not showing as pending in Scheduled Actions? I’m not sure how I would “get it back in there” – should I try disabling/re-enabling the plugin, or do you have other ideas for kick-starting things again?

    Thank you always for your amazing work on this.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author MinnPost

    (@minnpost)

    I think the first thing I’d try is just resaving the plugin schedule. For example, if your plugin is pulling data every 10 minutes, change it to every 11 minutes and then change it back to 10 and see if that fixes it.

    If it does not (and I guess even if it does, really) I think you might investigate whether your server has any PHP errors.

    Thread Starter metricmedia

    (@metricmedia)

    That does appear to be a good way to trigger it to restart, thank you.

    We did discover some PHP errors and cleaned them up, including one fatal one.

    Now we can update the frequency and that triggers a sync. The sync appears to pull all modified SF contact records, but it’s not pulling another type of record (experiences) that it normally pulls successfully. At first we thought there were just a lot of accumulated contact records to pull and once it got through those it would move on to experiences, but we’re caught up and just pulling a couple of contacts per sync, but it still ends up “failed” in Scheduled Actions and never pulls experiences. We’ve deliberately modified experiences to force a sync and they don’t sync.

    And, once it’s marked failed it doesn’t seem to run again automatically. It stays “failed” until we trigger it again by updating the schedule.

    Nothing meaningful now in PHP logs. No evidence of failures in the WP Logs custom post type. No mapping errors.

    The “failed” entries always include this in the log:
    action marked as failed after 300 seconds. Unknown error occurred. Check server, PHP and database error logs to diagnose cause.

    Is it normal once a scheduled action fails for it to remain in a failed state and not become active/pending again? Doesn’t seem like it would/should but we’re running out of ideas.

    Thread Starter metricmedia

    (@metricmedia)

    OK, we figured out what’s causing object_sync_for_salesforce_pull_check_records to fail.

    We had some logging in our function that runs on object_sync_for_salesforce_pull_object_allowed and apparently that is causing this timeout at 300 seconds and causing the job to be stuck in a failed state.

    We commented this out and the problem is fixed. However this leaves us wondering WHY this function caused the problem.

    We think it may have to do with our client having updated many records in Salesforce. This caused the function to have to log many entries at once, and that somehow exceeded a limit.

    The log function we were calling executed on each iteration of object_sync_for_salesforce_pull_object_allowed:

    custom_debug(array(‘mapping’ => $salesforce_mapping[‘name’], ‘object’ => $object), _FILE_, _LINE_);

    This logs the name of the object type we’re mapping, the object and the current file and line number.

    A lot of items ran through this function, so perhaps it’s just the sheer number of iterations that is choking it.

    Any thoughts? Ring any bells?

    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    It doesn’t ring any bells for me, but it does make sense. I think depending on the server’s resources, logging a large number of records could indeed be a bottleneck.

    Thread Starter metricmedia

    (@metricmedia)

    This happened again a few days ago. We asked the client and they did not update a large number of records.

    Can you think of what might cause the plugin to not restart once it’s in a failed state? This is the bigger problem – not why it fails but why it won’t restart after a failure.

    Any thoughts on where we might add logging to understand why it isn’t restarting? Or, ideas for a way to kickstart it automatically once it’s in a failed state?

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Not pulling data from Salesforce’ is closed to new replies.