Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Can't sf_Replicate but I can select from a view

The past few weeks I have started having problems with sf_Replicate.

I am trying to Replicate Campaign_Member (or Contact) and it fails.

I can do a SELECT through the view, but the SELECT TOP 1000 takes over 10 minutes to return. If I specify a specific record in the WHERE it comes back almost instantly. So I know SalesForce is online.

use [salesforce backups]
-- default 100k ;
exec sf_Replicate 'Salesforce_PROD','CampaignMember','pkchunk';

--- Starting SF_Replicate for CampaignMember V3.5.3
11:33:30: Parameters: Salesforce_PROD CampaignMember pkchunk Version: V3.5.3
11:33:30: Drop CampaignMember_Previous if it exists.
11:33:30: Create CampaignMember_Previous with new structure.
11:33:34: DBAmpNet2 3.5.3.0 (c) Copyright 2015-2017 forceAmp.com LLC
11:33:35: Parameters: export CampaignMember_Previous TENHDCTHCRMSQL1 salesforce backups Salesforce_PROD pkchunk
11:33:41: Job 7501R00000WUzBwQAL created on salesforce.
11:33:42: Using the bulkapi with polling every 60 seconds
11:33:42: Job still running.
11:33:57: Job still running.
11:34:58: Job still running.
11:35:58: Job still running.
11:36:59: Job still running.
11:37:59: Job still running.
11:39:00: Job still running.
11:40:00: Job still running.
11:41:00: Job still running.
11:42:01: Job still running.
11:43:01: Job still running.
11:44:02: Job still running.
11:45:02: Job still running.
11:46:02: Job still running.
11:47:03: Job Complete.
11:47:29: Error: Batch 7511R00000fxbIsQAI failed.
11:47:29: Error: InvalidBatch : Failed to process query: SERVER_UNAVAILABLE: Unable to complete the creation of the query cursor at this time, please retry your query later.
11:47:29: Error: Could not get batch result Ids from Salesforce.
11:47:29: DBAmpNet2 Operation FAILED.
11:47:29: Error: Replicate program was unsuccessful.
11:47:29: Error: Command string is C:\"Program Files"\DBAmp\DBAmpNet2.exe Export:pkchunk "CampaignMember_Previous" "TENHDCTHCRMSQL1" "salesforce backups" "Salesforce_PROD"
--- Ending SF_Replicate. Operation FAILED.
Msg 50000, Level 16, State 1, Procedure SF_Replicate, Line 362
--- Ending SF_Replicate. Operation FAILED.
1 person has
this problem
+1
Reply
  • The Error is: "SERVER_UNAVAILABLE: Unable to complete the creation of the query cursor at this time, please retry your query later."

    This is a Salesforce Server error, not a DBAmp error. This error message means the Salesforce servers are currently down or not accepting requests. This condition usually only lasts a few minutes or less. Does this error occur every time you try to replicate CampaignMember and Contact or just intermittently?

    Also, can you post a screenshot of the Server Options page of the linked server and the DBAmp.DBAmp Provider Options page?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated indifferent, undecided, unconcerned

  • The error has been occurring for at least a week. I can not replicate, but I can do a select through the view.

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated indifferent, undecided, unconcerned

  • It fails with that same exact error every time you run it? Even if you run it right now?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated indifferent, undecided, unconcerned

  • Yes.

    Replicate fails after 5-10 minutes for both Contact and Campaign Member.

    The SELECT TOP 1000 will work for Campaign_Member after about 12 minutes.

    The SELECT with a WHERE works for both Contact and Campaign Member.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated indifferent, undecided, unconcerned

  • How many total records are in each of those two objects?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated indifferent, undecided, unconcerned

  • 86 million in Contact.

    I can’t replicate Campaign Member sonI don’t have the record count.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated indifferent, undecided, unconcerned

  • Can you try the following and see if you receive the same error:

    exec sf_Replicate 'Salesforce_PROD','CampaignMember','bulkapi'
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated indifferent, undecided, unconcerned

  • Can you go to the Bulk Monitoring on your Salesforce org and find the following job: 7501R00000WUzBwQAL

    In that job can you look at the batches and see if any failed with this type of an error message: "InvalidBatch : Failed to process query: SERVER_UNAVAILABLE: Unable to complete the creation of the query cursor at this time, please retry your query later."
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated indifferent, undecided, unconcerned

  • I tried the BULKAPI and it returned with this message after a while:

    --- Starting SF_Replicate for CampaignMember V3.5.3
    12:10:37: Parameters: Salesforce_PROD CampaignMember bulkapi Version: V3.5.3
    12:10:37: Drop CampaignMember_Previous if it exists.
    12:10:38: Create CampaignMember_Previous with new structure.
    12:10:39: DBAmpNet2 3.5.3.0 (c) Copyright 2015-2017 forceAmp.com LLC
    12:10:40: Parameters: export CampaignMember_Previous TENHDCTHCRMSQL1 salesforce backups Salesforce_PROD bulkapi
    12:10:47: Job 7501R00000WV9EHQA1 created on salesforce.
    12:10:47: Using the bulkapi with polling every 60 seconds
    12:10:48: Job still running.
    12:11:04: Job still running.
    12:12:04: Job still running.
    12:13:05: Job still running.
    12:14:05: Job still running.
    12:15:05: Job still running.
    12:16:07: Job still running.
    12:17:07: Job still running.
    12:18:08: Job still running.
    12:19:08: Job still running.
    12:20:09: Job still running.
    12:21:09: Job still running.
    12:22:10: Job still running.
    12:23:10: Job still running.
    12:24:11: Job still running.
    12:25:12: Job still running.
    12:26:14: Job still running.
    12:27:15: Job still running.
    12:28:16: Job still running.
    12:29:17: Job still running.
    12:30:18: Job still running.
    12:31:20: Job still running.
    12:32:20: Job still running.
    12:33:21: Job still running.
    12:34:22: Job still running.
    12:35:22: Job still running.
    12:36:23: Job still running.
    12:37:23: Job still running.
    12:38:23: Job still running.
    12:39:24: Job still running.
    12:40:24: Job still running.
    12:41:25: Job still running.
    12:42:27: Job still running.
    12:43:28: Job still running.
    12:44:28: Job still running.
    12:45:29: Job still running.
    12:46:30: Job still running.
    12:47:30: Job still running.
    12:48:31: Job still running.
    12:49:32: Job still running.
    12:50:32: Job still running.
    12:51:33: Job still running.
    12:52:34: Job still running.
    12:53:35: Job still running.
    12:54:36: Job still running.
    12:55:38: Job still running.
    12:56:38: Job still running.
    12:57:40: Job still running.
    12:58:41: Job still running.
    12:59:42: Job still running.
    13:00:43: Job still running.
    13:01:43: Job still running.
    13:02:45: Job still running.
    13:03:45: Job still running.
    13:04:47: Job still running.
    13:05:47: Job still running.
    13:06:48: Job still running.
    13:07:48: Job still running.
    13:08:49: Job still running.
    13:09:49: Job still running.
    13:10:50: Job still running.
    13:11:51: Job still running.
    13:12:52: Job still running.
    13:13:53: Job still running.
    13:14:53: Job still running.
    13:15:54: Job still running.
    13:16:54: Job still running.
    13:17:55: Job still running.
    13:18:56: Job still running.
    13:19:56: Job still running.
    13:20:57: Job still running.
    13:21:57: Job still running.
    13:22:58: Job still running.
    13:23:58: Job still running.
    13:24:59: Job still running.
    13:25:59: Job still running.
    13:27:00: Job still running.
    13:28:01: Job still running.
    13:29:01: Job still running.
    13:30:02: Job still running.
    13:31:02: Job still running.
    13:32:03: Job still running.
    13:33:04: Job still running.
    13:34:04: Job still running.
    13:35:05: Job still running.
    13:36:06: Job still running.
    13:37:07: Job still running.
    13:38:08: Job still running.
    13:39:08: Job still running.
    13:40:09: Job still running.
    13:41:10: Job still running.
    13:42:10: Job still running.
    13:43:11: Job still running.
    13:44:11: Job still running.
    13:45:12: Job still running.
    13:46:13: Job still running.
    13:47:13: Job still running.
    13:48:14: Job still running.
    13:49:14: Job still running.
    13:50:14: Job still running.
    13:51:15: Job still running.
    13:52:15: Job still running.
    13:53:16: Job still running.
    13:54:16: Job still running.
    13:55:17: Job still running.
    13:56:18: Job still running.
    13:57:19: Job still running.
    13:58:20: Job still running.
    13:59:21: Job still running.
    14:00:21: Job still running.
    14:01:22: Job still running.
    14:02:23: Job still running.
    14:03:23: Job still running.
    14:04:24: Job still running.
    14:05:24: Job still running.
    14:06:25: Job still running.
    14:07:25: Job still running.
    14:08:26: Job still running.
    14:09:27: Job still running.
    14:10:27: Job still running.
    14:11:28: Job still running.
    14:12:28: Job still running.
    14:13:29: Job still running.
    14:14:30: Job still running.
    14:15:31: Job still running.
    14:16:32: Job still running.
    14:17:32: Job still running.
    14:18:34: Job still running.
    14:19:34: Job still running.
    14:20:35: Job still running.
    14:21:35: Job still running.
    14:22:35: Job still running.
    14:23:36: Job still running.
    14:24:37: Job still running.
    14:25:37: Job still running.
    14:26:38: Job still running.
    14:27:38: Job Complete.
    14:27:39: Error: Batch 7511R00000fxnDuQAI failed.
    14:27:39: Error: InternalServerError : Retried more than 15 times
    14:27:39: Error: Could not get batch result Ids from Salesforce.
    14:27:39: DBAmpNet2 Operation FAILED.
    14:27:39: Error: Replicate program was unsuccessful.
    14:27:39: Error: Command string is C:\"Program Files"\DBAmp\DBAmpNet2.exe Export:bulkapi "CampaignMember_Previous" "TENHDCTHCRMSQL1" "salesforce backups" "Salesforce_PROD"
    --- Ending SF_Replicate. Operation FAILED.
    Msg 50000, Level 16, State 1, Procedure SF_Replicate, Line 366
    --- Ending SF_Replicate. Operation FAILED.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated indifferent, undecided, unconcerned

  • Salesforce is having issues getting the batches back to DBAmp and is failing internally on their server. If you go to the Bulk Monitoring page on Salesforce, can you look up the job: 7501R00000WV9EHQA1 and batch: 7511R00000fxnDuQAI and see what the state message says? Can you also do the same for job: 7501R00000WUzBwQAL and batch: 7511R00000fxbIsQAI?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated indifferent, undecided, unconcerned