Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

Found a bug: ServiceBus Stored Procedure on Non-English SQL Server

$
0
0

Hi there,

 

When installing Azure Service Bus and Workflow Manager 1.0 on a non-English System (in this case German) the Event Log is spammed with these messages (Warnings):

 

TrackingId: 03823126-f67e-413b-82f9-42f554d8f1ed_GIT-W12-SPQAAPP, SubsystemId: NoSystemTracker. A SQL exception was caught. Command = [dbo].[MarkBrokenResourceManifests], error number = 242, procedure = MarkBrokenResourceManifests, database name = SbGatewayDatabase, server = IT-W12-SPQASQL\QA_SP13SQL12, error = error number = 242, error state = 3, error class = 16, error message = Bei der Konvertierung eines varchar-Datentyps in einen datetime-Datentyp liegt der Wert außerhalb des gültigen Bereichs., procedure = MarkBrokenResourceManifests, line number = 18

System.Data.SqlClient.SqlException (0x80131904): Bei der Konvertierung eines varchar-Datentyps in einen datetime-Datentyp liegt der Wert außerhalb des gültigen Bereichs.

  bei System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

   bei System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

   bei System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)

   bei System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()

   bei System.Data.SqlClient.SqlDataReader.get_MetaData()

   bei System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

   bei System.Data.SqlClient.SqlCommand.CompleteAsyncExecuteReader()

   bei System.Data.SqlClient.SqlCommand.InternalEndExecuteReader(IAsyncResult asyncResult, String endMethod)

   bei System.Data.SqlClient.SqlCommand.EndExecuteReaderInternal(IAsyncResult asyncResult)

   bei System.Data.SqlClient.SqlCommand.EndExecuteReader(IAsyncResult asyncResult)

   bei Microsoft.Cloud.ServiceBus.Common.Sql.SqlCommandAsyncResult.<GetAsyncSteps>b__1(SqlCommandAsyncResult thisPtr, IAsyncResult r)

   bei Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)

ClientConnectionId:4aeb6f7a-e409-4728-a832-31ba327fc251

 

We took the liberty to look into the mentioned stored procedure (Bug is inDatabase: SbGatewayDatabase, SP: MarkBrokenResourceManifests). In that procedure you do the following:

 and[Expiration]= '9999-12-31 23:59:59.997'

 

This of course doesn’t work on a non-English SQL Server as can be tested with the following:

selectCASEgetutcdate() WHEN  '9999-12-31 23:59:59.997'THEN'' ELSE'works'END

 

On a German SQL Server this throws the error (The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.) – it would work when you write it like so:

selectCASEgetutcdate() WHEN  '9999-31-12 23:59:59.997'THEN'' ELSE'works'END

 

But of course a string like this wouldn’t work on a US-English System.

 

 

Come on guys. You compare GetUTCDate() with a string? Without culture or casting the string to something meaningful? :-)


Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>