Rock icon indicating copy to clipboard operation
Rock copied to clipboard

Exception on null HTTP Webhook Signing Key for Mailgun

Open DTS-Mike opened this issue 2 years ago • 1 comments

Description

When upgrading Rock to V15.4 there is a new field for 'HTTP Webhook Signing Key' on the Mailgun transport. Rock logged 1.9 million exceptions in 12 hours due to this field being blank and emailed the church admin.

Actual Behavior

Rock logged the null value as an exceptions 1.9 Million times in 12 hours.

Expected Behavior

Not continuously log the exception. Log 1 time on startup.

Steps to Reproduce

  • Upgrade from V15.3 to V15.4 with mailgun active.
  • See error in exception logs.

Exception Description: String reference not set to an instance of a String. Parameter name: s

Stack Trace: at System.Text.Encoding.GetBytes(String s) at Rock.Mailgun.MailgunUtilities.GenerateNewHMAC(String password, String challenge) at Rock.Mailgun.MailgunUtilities.AuthenticateMailgunRequest(Int32 timestamp, String token, String signature, String apiKey) at Mailgun.ProcessRequest() at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

image

**I am checking the Fresh Install Button even though I am not trying to reproduce on demo site. It will bring down Rock.

Issue Confirmation

  • [X] Perform a search on the Github Issues to see if your bug or enhancement is already reported.
  • [X] Try to reproduce the problem on a fresh install or on the demo site.

Rock Version

1.15.4

Client Culture Setting

en-US

DTS-Mike avatar Mar 06 '24 22:03 DTS-Mike

Log 1 time on startup.

@DTS-Mike There is no way to log that error 1 time on startup, but there does appear to be a problem with the migration that should have updated the Mailgun component's attribute value. Although we've not been able to reproduce this problem (and others have also not run into that when they updated to v15.4), we're working on a fix to correct that condition. We'll likely have to re-patch v15.4 so future updates to v15.4 also don't run into that situation.

nairdo avatar Mar 07 '24 00:03 nairdo