I have created a new subscription with Email but I’m not receiving any email from the server.
Then after looking into Subscription diagnostics found that this error.
I have tried all frequency
Frequency => 1m & 1hr and 1 day
Failed to process subscription ‘Notify Team Manual Intervention Raised’. Error while executing SQL command in transaction ‘ProcessSubscriptions’: Incorrect syntax near ‘forgroups’.
Incorrect syntax near ‘)’.
The command being executed was:
IF EXISTS(SELECT *
FROM dbo.[Event]
WHERE ((([SpaceId] = ‘Spaces-1’) OR ([SpaceId] IS NULL)))
AND ([UserId] in (@userids_0))
AND ([Id] in (SELECT er.EventId from EventRelatedDocument er where er.RelatedDocumentId in (@regardinganyprojects_0, @regardinganyprojects_1)))
AND ([Id] in (SELECT er.EventId from EventRelatedDocument er where er.RelatedDocumentId in (@regardinganyprojects_0, @regardinganyprojects_1)forgroups))
AND ([Id] in (SELECT er.EventId from EventRelatedDocument er where er.RelatedDocumentId in (@regardinganyenvironments_0)))
AND ([Category] in (@eventcategories_0))
AND ([AutoId] > @fromautoid)
AND ([AutoId] <= @toautoid))
SELECT @true_0
ELSE
SELECT @false_1
System.Exception: Error while executing SQL command in transaction ‘ProcessSubscriptions’: Incorrect syntax near ‘forgroups’.
Incorrect syntax near ‘)’.
The command being executed was:
IF EXISTS(SELECT *
FROM dbo.[Event]
WHERE ((([SpaceId] = ‘Spaces-1’) OR ([SpaceId] IS NULL)))
AND ([UserId] in (@userids_0))
AND ([Id] in (SELECT er.EventId from EventRelatedDocument er where er.RelatedDocumentId in (@regardinganyprojects_0, @regardinganyprojects_1)))
AND ([Id] in (SELECT er.EventId from EventRelatedDocument er where er.RelatedDocumentId in (@regardinganyprojects_0, @regardinganyprojects_1)forgroups))
AND ([Id] in (SELECT er.EventId from EventRelatedDocument er where er.RelatedDocumentId in (@regardinganyenvironments_0)))
AND ([Category] in (@eventcategories_0))
AND ([AutoId] > @fromautoid)
AND ([AutoId] <= @toautoid))
SELECT @true_0
ELSE
SELECT @false_1 —> System.Data.SqlClient.SqlException: Incorrect syntax near ‘forgroups’.
Incorrect syntax near ‘)’.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource
1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteScalar()
at Nevermore.Transient.IDbCommandExtensions.<>c__DisplayClass11_0.b__0()
at Nevermore.Transient.RetryPolicy.ExecuteAction[TResult](Func1 func) at Nevermore.RelationalTransaction.ExecuteScalar[T](String query, CommandParameterValues args, Nullable
1 commandTimeout)
— End of inner exception stack trace —
at Nevermore.RelationalTransaction.ExecuteScalar[T](String query, CommandParameterValues args, Nullable1 commandTimeout) at Nevermore.QueryBuilder
2.Any()
at Octopus.Server.Schedules.SubscriptionsProcessor.IsWorkRequiredForSubscriptions(IRelationalTransaction transaction, IEnumerable`1 subscriptions, DateTimeOffset processingDate, Int64 upToEventAutoId) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Schedules\SubscriptionsProcessor.cs:line 69
Octopus.Server version 2019.9.12 (2019.9.12+Branch.tags-2019.9.12.Sha.e1cf1796f5c4739226ef4cd9c8da27141fe9b46a)