Mirroring: "TOP or FETCH clause contains an invalid value" at validating mirroring settings

Found in

EPiServer.CMS.Core 10.3.0

Fixed in

EPiServer.CMS.Core 10.3.2


Dec 30, 2016


Apr 11, 2017


CMS Core


Closed, Fixed and tested


Steps to reproduce
1. Upgrade a 7.5 CMS site to
2. Configure mirroring from Page1 to Page2 -> mirroring settings are valid and its function runs properly.
3. Upgrade to CMS Core 10.3.x.
4. Open Config > Mirroring > check the system for the mirroring settings.

Expected: Validation is OK.
Actual: Error message below appears in the Messages column.
_ When checking the system again, you see warning message as "Failed to check system, the reason is Error executing task "m1 > m2": The request channel timed out while waiting for a reply after 00:01:00. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout."
_ When run the Mirroring Service job, failed with error "Exception has been thrown by the target of an invocation. [Error executing task "m1 > m2": An error occurred while receiving the HTTP response to http://vnlabvm10:17000/MirroringSourceServer.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.
]" (nothing is written in log file)

[SqlException (0x80131904): A TOP or FETCH clause contains an invalid value.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +3277336
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +345
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +5002
System.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows) +278
System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more) +284
System.Data.SqlClient.SqlDataReader.Read() +42
System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping) +158
System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) +230
System.Data.Common.DataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) +508
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +281
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +182
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +129
EPiServer.DataAccess.Internal.<>c_DisplayClass9_0.<ListLog>b_0() +251
EPiServer.Data.Providers.Internal.<>c_DisplayClass28_0`1.<Execute>b_0() +56
EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute(Func`1 method) +925
EPiServer.DataAbstraction.Internal.DefaultScheduledJobRepository.LoadLog(Guid id) +52
EPiServer.MirroringService.MirroringMonitoring.MirroringDataJSONCreator.GetMirroringScheduleLog(Guid context) +266
EPiServer.UI.Admin.ContentMirroringServiceEdit.GetMiroringScheduleLog() +49
EPiServer.UI.Admin.ContentMirroringServiceEdit.OnLoad(EventArgs e) +387
System.Web.UI.Control.LoadRecursive() +68
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436