umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.42k stars 2.67k forks source link

V13 RC: Webhooks - Nothing is in log & exception thrown when content published #15092

Closed warrenbuckley closed 10 months ago

warrenbuckley commented 11 months ago

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

13.0.0-rc1

Bug summary

The webhook payload is sent out correctly, but an exception is shown after publishing a content node that is triggering the webhook complaining about

String or binary data would be truncated in table umbracoWebhookLog column requestBody

Specifics

image

Logs UmbracoTraceLog.HACKMAKEDO.20231101.json

[15:14:40 INF] Document Home (id=1057) has been published.
[15:14:41 ERR] Exception (2694ed31).
Microsoft.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated in table 'D:\CODE\HACKMAKEDO\UMBRACOV13PLAYGROUND\UMBRACO\DATA\UMBRACO.MDF.dbo.umbracoWebhookLog', column 'requestBody'. Truncated value: '{"Name":"Home","CreateDate":"2023-11-01T15:07:01.507Z","UpdateDate":"2023-11-01T15:14:40.75Z","Route'.
The statement has been terminated.
   at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at Microsoft.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean isAsync, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String method)
   at Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar()
   at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)
   at System.Data.Common.DbCommand.ExecuteScalarAsync(CancellationToken cancellationToken)
--- End of stack trace from previous location ---
   at NPoco.Database.ExecutionHookAsync[T](Func`1 action)
   at NPoco.Database.ExecuteScalarHelperAsync(DbCommand cmd)
   at NPoco.Database.InsertAsyncImp[T](PocoData pocoData, String tableName, String primaryKeyName, Boolean autoIncrement, T poco, Boolean sync)
   at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.WebhookLogRepository.CreateAsync(WebhookLog log)
   at Umbraco.Cms.Core.Services.WebhookLogService.CreateAsync(WebhookLog webhookLog)
   at Umbraco.Cms.Infrastructure.Services.Implement.WebhookFiringService.SendRequestAsync(Webhook webhook, String eventName, Object payload, Int32 retryCount, CancellationToken cancellationToken)
   at Umbraco.Cms.Infrastructure.Services.Implement.WebhookFiringService.FireAsync(Webhook webhook, String eventName, Object payload, CancellationToken cancellationToken)
   at Umbraco.Cms.Core.Webhooks.WebhookEventBase`2.HandleAsync(TNotification notification, CancellationToken cancellationToken)
   at Umbraco.Cms.Core.Events.INotificationAsyncHandler`1.HandleAsync(IEnumerable`1 notifications, CancellationToken cancellationToken)
   at Umbraco.Cms.Core.Events.EventAggregator.PublishCoreAsync[TNotification](IEnumerable`1 allHandlers, IEnumerable`1 notifications, CancellationToken cancellationToken)
   at Umbraco.Cms.Core.Events.NotificationAsyncHandlerWrapperImpl`1.HandleAsync[TNotification,TNotificationHandler](IEnumerable`1 notifications, CancellationToken cancellationToken, ServiceFactory serviceFactory, Func`4 publish)
   at Umbraco.Cms.Core.Events.EventAggregator.PublishNotificationsAsync[TNotification,TNotificationHandler](IEnumerable`1 notifications, CancellationToken cancellationToken)
ClientConnectionId:293366fe-67d6-4c3e-99b1-c0fa2c356dd2
Error Number:2628,State:1,Class:16

Steps to reproduce

Expected result / actual result

No response

Zeegaan commented 10 months ago

Fixed in https://github.com/umbraco/Umbraco-CMS/pull/15103 🚀