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

sf_replicate failing for objects containing text formulae in Sandbox after Spring 19 preview release

Hi,

After the Spring’19 Preview release on Saturday 5th January the dbamp replicates are now failing for some SF objects in our sandboxes.

It looks like its related to a SF issue where text formulae that had a length of 1300 in the metadata description (.../services/data/v45.0/sobjects/Opportunity/describe/) now have a length of 0. It looks like your code is setting the field width to 255 in this scenario but some of the formula values are exceeding 255 thus causing the replicate to fail.

I believe this new release is going out into Production on the 2nd of Feb.

Therefore would you be able to increase the 255 width to 1300 (its current value in Production SF) for fields that are calculated, of string type and have a length of 0.

Below is an example of the sandbox payload for a specific field with a value of 0 for length and another one for Production where the field width is set to 1300.

Also underneath that is the error message we get from dbamp after the replicate.

Please let me know if you need any more information.

Thanks,

Tristan.

***SANDBOX***

true
false
0
true
"IN:"&EnquiryID__c&"Q"
false
false
true
false
false
0
true
false
false
Application ID
0
Enquiry_Token__c
false
false
true
true
false
0
false
false
0
false
xsd:string
true
string
false
false

***PROD***

true
false
3900
true
"IN:"&EnquiryID__c&"Q"
false
false
true
false
false
0
true
false
false
Application ID
1300
Enquiry_Token__c
false
false
true
true
false
0
false
false
0
false
xsd:string
true
string
false
false

--- Starting SF_Replicate for Opportunity V3.7.2
16:53:39: Parameters: SALESFORCE_IUPSFUAT Opportunity pkchunk Version: V3.7.2
16:53:39: Drop Opportunity_Previous20190108T165339427 if it exists.
16:53:39: Create Opportunity_Previous20190108T165339427 with new structure.
16:53:40: DBAmpNet2 3.7.2.0 (c) Copyright 2015-2017 forceAmp.com LLC
16:53:40: Parameters: replicate Opportunity_Previous20190108T165339427 DB-AZU-002 SF_SANDBOX SALESFORCE_IUPSFUAT pkchunk
16:53:42: Job 7500Q0000015fEcQAI created on salesforce.
16:53:42: Using the bulkapi with polling every 60 seconds
16:53:43: Job still running.
16:53:59: Job still running.
16:55:00: Job still running.
16:56:01: Job still running.
16:57:02: Job still running.
16:58:02: Job still running.
16:59:03: Job still running.
17:00:04: Job still running.
17:01:04: Job still running.
17:02:05: Job Complete.
17:02:34: File downloaded successfully: F:\INTO\dbamp_temp\7500Q0000015fEcQAI-7510Q0000013MqoQAE-7520Q000000NBRn.csv
17:02:34: File downloaded successfully: F:\INTO\dbamp_temp\7500Q0000015fEcQAI-7510Q0000013MqiQAE-7520Q000000NBc2.csv
17:02:34: File downloaded successfully: F:\INTO\dbamp_temp\7500Q0000015fEcQAI-7510Q0000013MqnQAE-7520Q000000NBbd.csv
17:02:34: File downloaded successfully: F:\INTO\dbamp_temp\7500Q0000015fEcQAI-7510Q0000013MqsQAE-7520Q000000NBdF.csv
17:02:34: Files downloaded complete.
17:02:35: Loading file into SQL Server: F:\INTO\dbamp_temp\7500Q0000015fEcQAI-7510Q0000013MqiQAE-7520Q000000NBc2.csv
17:02:35: Loading file into SQL Server: F:\INTO\dbamp_temp\7500Q0000015fEcQAI-7510Q0000013MqnQAE-7520Q000000NBbd.csv
17:02:35: Loading file into SQL Server: F:\INTO\dbamp_temp\7500Q0000015fEcQAI-7510Q0000013MqoQAE-7520Q000000NBRn.csv
17:02:35: Loading file into SQL Server: F:\INTO\dbamp_temp\7500Q0000015fEcQAI-7510Q0000013MqsQAE-7520Q000000NBdF.csv
17:02:35: File loaded failed: F:\INTO\dbamp_temp\7500Q0000015fEcQAI-7510Q0000013MqiQAE-7520Q000000NBc2.csv System.InvalidOperationException: The given value of type String from the data source cannot be converted to type nvarchar of the specified target c
olumn. ---> System.InvalidOperationException: String or binary data would be truncated.
at System.Data.SqlClient.SqlBulkCopy.ConvertValue(Object value, _SqlMetaData metadata, Boolean isNull, Boolean& isSqlType, Boolean& coercedToDataFeed)
--- End of inner exception stack trace ---
at System.Data.SqlClient.SqlBulkCopy.ConvertValue(Object value, _SqlMetaData metadata, Boolean isNull, Boolean& isSqlType, Boolean& coercedToDataFeed)
at System.Data.SqlClient.SqlBulkCopy.ReadWriteColumnValueAsync(Int32 col)
at System.Data.SqlClient.SqlBulkCopy.CopyColumnsAsync(Int32 col, TaskCompletionSource`1 source)
at System.Data.SqlClient.SqlBulkCopy.CopyRowsAsync(Int32 rowsSoFar, Int32 totalRows, CancellationToken cts, TaskCompletionSource`1 source)
at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinued(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at DBAmpNet2.ReplicateBulkCopy.d__64.MoveNext()
17:02:35: File loaded failed: F:\INTO\dbamp_temp\7500Q0000015fEcQAI-7510Q0000013MqnQAE-7520Q000000NBbd.csv System.InvalidOperationException: The given value of type String from the data source cannot be converted to type nvarchar of the specified target c
olumn. ---> System.InvalidOperationException: String or binary data would be truncated.
at System.Data.SqlClient.SqlBulkCopy.ConvertValue(Object value, _SqlMetaData metadata, Boolean isNull, Boolean& isSqlType, Boolean& coercedToDataFeed)
--- End of inner exception stack trace ---
at System.Data.SqlClient.SqlBulkCopy.ConvertValue(Object value, _SqlMetaData metadata, Boolean isNull, Boolean& isSqlType, Boolean& coercedToDataFeed)
at System.Data.SqlClient.SqlBulkCopy.ReadWriteColumnValueAsync(Int32 col)
at System.Data.SqlClient.SqlBulkCopy.CopyColumnsAsync(Int32 col, TaskCompletionSource`1 source)
at System.Data.SqlClient.SqlBulkCopy.CopyRowsAsync(Int32 rowsSoFar, Int32 totalRows, CancellationToken cts, TaskCompletionSource`1 source)
at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinued(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at DBAmpNet2.ReplicateBulkCopy.d__64.MoveNext()
17:02:35: File loaded failed: F:\INTO\dbamp_temp\7500Q0000015fEcQAI-7510Q0000013MqoQAE-7520Q000000NBRn.csv System.InvalidOperationException: The given value of type String from the data source cannot be converted to type nvarchar of the specified target c
olumn. ---> System.InvalidOperationException: String or binary data would be truncated.
at System.Data.SqlClient.SqlBulkCopy.ConvertValue(Object value, _SqlMetaData metadata, Boolean isNull, Boolean& isSqlType, Boolean& coercedToDataFeed)
--- End of inner exception stack trace ---
at System.Data.SqlClient.SqlBulkCopy.ConvertValue(Object value, _SqlMetaData metadata, Boolean isNull, Boolean& isSqlType, Boolean& coercedToDataFeed)
at System.Data.SqlClient.SqlBulkCopy.ReadWriteColumnValueAsync(Int32 col)
at System.Data.SqlClient.SqlBulkCopy.CopyColumnsAsync(Int32 col, TaskCompletionSource`1 source)
at System.Data.SqlClient.SqlBulkCopy.CopyRowsAsync(Int32 rowsSoFar, Int32 totalRows, CancellationToken cts, TaskCompletionSource`1 source)
at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinued(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at DBAmpNet2.ReplicateBulkCopy.d__64.MoveNext()
17:02:35: File loaded failed: F:\INTO\dbamp_temp\7500Q0000015fEcQAI-7510Q0000013MqsQAE-7520Q000000NBdF.csv System.InvalidOperationException: Cannot access destination table 'Opportunity_Previous20190108T165339427'. ---> System.Data.SqlClient.SqlException:
A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) ---> System.ComponentModel.Win32Exception: No process is on the other end of the pipe

--- End of inner exception stack trace ---
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
at System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync()
at System.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket()
at System.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer()
at System.Data.SqlClient.TdsParserStateObject.TryReadByte(Byte& value)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlBulkCopy.RunParser(BulkCopySimpleResultSet bulkCopyHandler)
at System.Data.SqlClient.SqlBulkCopy.CreateAndExecuteInitialQueryAsync(BulkCopySimpleResultSet& result)
at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestAsync(CancellationToken cts, TaskCompletionSource`1 source)
--- End of inner exception stack trace ---
at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestAsync(CancellationToken cts, TaskCompletionSource`1 source)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at DBAmpNet2.ReplicateBulkCopy.d__64.MoveNext()
17:02:35: File load complete.
17:02:35: 0 rows copied.
17:02:35: Deleted file: F:\INTO\dbamp_temp\7500Q0000015fEcQAI-7510Q0000013MqiQAE-7520Q000000NBc2.csv
17:02:35: Deleted file: F:\INTO\dbamp_temp\7500Q0000015fEcQAI-7510Q0000013MqnQAE-7520Q000000NBbd.csv
17:02:35: Deleted file: F:\INTO\dbamp_temp\7500Q0000015fEcQAI-7510Q0000013MqoQAE-7520Q000000NBRn.csv
17:02:35: Deleted file: F:\INTO\dbamp_temp\7500Q0000015fEcQAI-7510Q0000013MqsQAE-7520Q000000NBdF.csv
17:02:35: DBAmpNet2 Operation FAILED.
17:02:37: Error: Replicate program was unsuccessful.
17:02:37: Error: Command string is C:\"Program Files"\DBAmp\DBAmpNet2.exe Export "Replicate:pkchunk" "Opportunity_Previous20190108T165339427" "DB-AZU-002" "SF_SANDBOX" "SALESFORCE_IUPSFUAT"
--- Ending SF_Replicate. Operation FAILED.
1 person has
this problem
+1
Reply