Groups | Blog | Home
all groups > sql server replication > september 2007 >

sql server replication : Replication error


nas
9/4/2007 8:48:00 PM
Hi all,
I got this error when the snapshot agent run after the setup of the
subscriber. How do I resolve this?

Error messages:
Message: StartIndex cannot be less than zero.
Parameter name: startIndex
Command Text:
select 'number' = convert(int, 0), 'definition' = definition
from sys.sql_modules
where object_id = object_id(@qualified_object_name)
union all
select 'number' = convert(int, procedure_number), 'definition' = definition
from sys.numbered_procedures
where object_id = object_id(@qualified_object_name)
Parameters: @qualified_object_name = [dbo].[RM_FILL_MULTILINES1]

Stack: at
Microsoft.SqlServer.Replication.AgentCore.ExecuteWithOptionalResults(CommandSetupDelegate
commandSetupDelegate, ProcessResultsDelegate processResultsDelegate, Int32
queryTimeout, CommandBehavior commandBehavior)
at
Microsoft.SqlServer.Replication.AgentCore.ExecuteWithOptionalResults(CommandSetupDelegate
commandSetupDelegate, ProcessResultsDelegate processResultsDelegate,
CommandBehavior commandBehavior)
at
Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.TextModeOnObjectScripter.Script()
at
Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateNonTableArticleSchScript(Scripter
scripter, BaseArticleWrapper articleWrapper, SqlSmoObject smoObject, Boolean
quotedIdentifierOn, Boolean ansiNullsOn, Boolean textMode)
at
Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateStoredProcedureArticleScripts(ArticleScriptingBundle articleScriptingBundle)
at
Microsoft.SqlServer.Replication.Snapshot.TransSmoScriptingManager.GenerateArticleScripts(ArticleScriptingBundle articleScriptingBundle)
at
Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateObjectScripts(ArticleScriptingBundle articleScriptingBundle)
at
Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.DoScripting()
at
Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.DoScripting()
at
Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.GenerateSnapshot()
at Microsoft.SqlServer.Replication.SnapshotGenerationAgent.InternalRun()
at Microsoft.SqlServer.Replication.AgentCore.Run() (Source: MSSQLServer,
Error number: 52006)
Get help: http://help/52006
Source: mscorlib
Target Site: System.Text.StringBuilder Remove(Int32, Int32)
Message: StartIndex cannot be less than zero.
Parameter name: startIndex
Stack: at System.Text.StringBuilder.Remove(Int32 startIndex, Int32 length)
at
Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.TextModeOnObjectScripter.ProcessGetObjectScriptResult(SqlDataReader dataReader)
at
Microsoft.SqlServer.Replication.AgentCore.ExecuteWithOptionalResults(CommandSetupDelegate
commandSetupDelegate, ProcessResultsDelegate processResultsDelegate, Int32
queryTimeout, CommandBehavior commandBehavior) (Source: mscorlib, Error
number: 0)
Get help: http://help/0

Hilary Cotter
9/8/2007 6:34:55 AM
can you enable logging so we can see where it is failing?

http://support.microsoft.com/kb/312292

--
RelevantNoise.com - dedicated to mining blogs for business intelligence.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
[quoted text, click to view]

nas
9/11/2007 1:52:02 AM
Hi,
I've enabled logging and extracted the last part where the error occured.
Hope it helps.


2007-09-11 08:31:19.10 SQL Command dump
2007-09-11 08:31:19.10 ================
2007-09-11 08:31:19.10 Server: CSMHRIS
2007-09-11 08:31:19.10 Database: COMMON
2007-09-11 08:31:19.10 Command Text: sys.sp_releaseapplock
2007-09-11 08:31:19.10 Parameters:
2007-09-11 08:31:19.10 @Resource = CSMHRIS-COMMON-COMMON-21
2007-09-11 08:31:19.10 @LockOwner = Session
2007-09-11 08:31:19.10 @DbPrincipal = db_owner
2007-09-11 08:31:19.26 [87%] The replication agent had encountered an
exception.
2007-09-11 08:31:19.26 Source: Replication
2007-09-11 08:31:19.26 Exception Type:
Microsoft.SqlServer.Replication.ReplicationAgentSqlException
2007-09-11 08:31:19.26 Exception Message: StartIndex cannot be less than zero.
2007-09-11 08:31:19.26 Parameter name: startIndex
2007-09-11 08:31:19.26 Message Code: 52006
2007-09-11 08:31:19.26
2007-09-11 08:31:19.26 Call Stack:
2007-09-11 08:31:19.26
Microsoft.SqlServer.Replication.ReplicationAgentSqlException: StartIndex
cannot be less than zero.
2007-09-11 08:31:19.26 Parameter name: startIndex --->
System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.
2007-09-11 08:31:19.26 Parameter name: startIndex
2007-09-11 08:31:19.26 at System.Text.StringBuilder.Remove(Int32
startIndex, Int32 length)
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.TextModeOnObjectScripter.ProcessGetObjectScriptResult(SqlDataReader dataReader)
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.AgentCore.ExecuteWithOptionalResults(CommandSetupDelegate
commandSetupDelegate, ProcessResultsDelegate processResultsDelegate, Int32
queryTimeout, CommandBehavior commandBehavior)
2007-09-11 08:31:19.26 --- End of inner exception stack trace ---
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.AgentCore.ExecuteWithOptionalResults(CommandSetupDelegate
commandSetupDelegate, ProcessResultsDelegate processResultsDelegate, Int32
queryTimeout, CommandBehavior commandBehavior)
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.AgentCore.ExecuteWithOptionalResults(CommandSetupDelegate
commandSetupDelegate, ProcessResultsDelegate processResultsDelegate,
CommandBehavior commandBehavior)
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.TextModeOnObjectScripter.Script()
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateNonTableArticleSchScript(Scripter
scripter, BaseArticleWrapper articleWrapper, SqlSmoObject smoObject, Boolean
quotedIdentifierOn, Boolean ansiNullsOn, Boolean textMode)
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateStoredProcedureArticleScripts(ArticleScriptingBundle articleScriptingBundle)
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.Snapshot.TransSmoScriptingManager.GenerateArticleScripts(ArticleScriptingBundle articleScriptingBundle)
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateObjectScripts(ArticleScriptingBundle articleScriptingBundle)
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.DoScripting()
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.DoScripting()
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.GenerateSnapshot()
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.SnapshotGenerationAgent.InternalRun()
2007-09-11 08:31:19.26 at Microsoft.SqlServer.Replication.AgentCore.Run()
2007-09-11 08:31:22.01 [87%]
********************************************************************************
2007-09-11 08:31:22.01 The replication agent had encountered an unexpected
exception, a memory dump
2007-09-11 08:31:22.01 containing information about the exception has been
generated at the following
2007-09-11 08:31:22.01 location:
2007-09-11 08:31:22.01
2007-09-11 08:31:22.01 C:\Program Files\Microsoft SQL
Server\90\Shared\ErrorDumps\ReplAgent_20070911163150.mdmp
2007-09-11 08:31:22.01

[quoted text, click to view]
nas
9/11/2007 1:54:00 AM
Hi,
I've enalbed the logging and extracted the last part where the error
occured. Hope it helps in identifying the problem.


2007-09-11 08:31:19.10 SQL Command dump
2007-09-11 08:31:19.10 ================
2007-09-11 08:31:19.10 Server: CSMHRIS
2007-09-11 08:31:19.10 Database: COMMON
2007-09-11 08:31:19.10 Command Text: sys.sp_releaseapplock
2007-09-11 08:31:19.10 Parameters:
2007-09-11 08:31:19.10 @Resource = CSMHRIS-COMMON-COMMON-21
2007-09-11 08:31:19.10 @LockOwner = Session
2007-09-11 08:31:19.10 @DbPrincipal = db_owner
2007-09-11 08:31:19.26 [87%] The replication agent had encountered an
exception.
2007-09-11 08:31:19.26 Source: Replication
2007-09-11 08:31:19.26 Exception Type:
Microsoft.SqlServer.Replication.ReplicationAgentSqlException
2007-09-11 08:31:19.26 Exception Message: StartIndex cannot be less than zero.
2007-09-11 08:31:19.26 Parameter name: startIndex
2007-09-11 08:31:19.26 Message Code: 52006
2007-09-11 08:31:19.26
2007-09-11 08:31:19.26 Call Stack:
2007-09-11 08:31:19.26
Microsoft.SqlServer.Replication.ReplicationAgentSqlException: StartIndex
cannot be less than zero.
2007-09-11 08:31:19.26 Parameter name: startIndex --->
System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.
2007-09-11 08:31:19.26 Parameter name: startIndex
2007-09-11 08:31:19.26 at System.Text.StringBuilder.Remove(Int32
startIndex, Int32 length)
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.TextModeOnObjectScripter.ProcessGetObjectScriptResult(SqlDataReader dataReader)
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.AgentCore.ExecuteWithOptionalResults(CommandSetupDelegate
commandSetupDelegate, ProcessResultsDelegate processResultsDelegate, Int32
queryTimeout, CommandBehavior commandBehavior)
2007-09-11 08:31:19.26 --- End of inner exception stack trace ---
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.AgentCore.ExecuteWithOptionalResults(CommandSetupDelegate
commandSetupDelegate, ProcessResultsDelegate processResultsDelegate, Int32
queryTimeout, CommandBehavior commandBehavior)
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.AgentCore.ExecuteWithOptionalResults(CommandSetupDelegate
commandSetupDelegate, ProcessResultsDelegate processResultsDelegate,
CommandBehavior commandBehavior)
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.TextModeOnObjectScripter.Script()
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateNonTableArticleSchScript(Scripter
scripter, BaseArticleWrapper articleWrapper, SqlSmoObject smoObject, Boolean
quotedIdentifierOn, Boolean ansiNullsOn, Boolean textMode)
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateStoredProcedureArticleScripts(ArticleScriptingBundle articleScriptingBundle)
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.Snapshot.TransSmoScriptingManager.GenerateArticleScripts(ArticleScriptingBundle articleScriptingBundle)
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateObjectScripts(ArticleScriptingBundle articleScriptingBundle)
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.DoScripting()
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.DoScripting()
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.GenerateSnapshot()
2007-09-11 08:31:19.26 at
Microsoft.SqlServer.Replication.SnapshotGenerationAgent.InternalRun()
2007-09-11 08:31:19.26 at Microsoft.SqlServer.Replication.AgentCore.Run()
2007-09-11 08:31:22.01 [87%]
********************************************************************************
2007-09-11 08:31:22.01 The replication agent had encountered an unexpected
exception, a memory dump
2007-09-11 08:31:22.01 containing information about the exception has been
generated at the following
2007-09-11 08:31:22.01 location:
2007-09-11 08:31:22.01
2007-09-11 08:31:22.01 C:\Program Files\Microsoft SQL
Server\90\Shared\ErrorDumps\ReplAgent_20070911163150.mdmp
2007-09-11 08:31:22.01


[quoted text, click to view]
AddThis Social Bookmark Button