Umbraco Commerce Concurrency exception
m

Mike Masey

over 1 year ago
Heyo, I'm currently experiencing an unexpected error with my local Umbraco Commerce instance. It was all working as expected then suddenly started throwing this error on a successful transaction. The order completes correctly, but it doesn't take me to the confirmation page. I'm using both the Stripe and Checkout packages, although the checkout is a copy of the source, rather than the nuget due to needing some additional functionality. The error appears to be coming from Umbraco Commerce itself, but i'm not sure why. I did accidently restart the site midway through a transaction so I wonder if somethings gone funky in the db? This is all is get form the error message
System.Data.DBConcurrencyException: A Concurrency update occurred in table 'umbracoCommerceOrder' for primary key value(s) = 'a28b060c-6bed-4ab9-a433-019002723487' and version = '11'
   at Umbraco.Commerce.Infrastructure.Resiliency.PollyExecutionStrategyBase.ExecuteAsync[TResult](Func`2 operation, Func`2 verifySucceeded, CancellationToken cancellationToken)
   at Umbraco.Commerce.Core.UmbracoCommerceUnitOfWorkProvider.ExecuteAsync[T](IUnitOfWorkOptions options, Func`3 action, CancellationToken cancellationToken)
   at Umbraco.Commerce.Cms.Web.Controllers.UmbracoCommercePaymentController.CallbackWithRetry(IPaymentProvider paymentProvider, PaymentProviderContext ctx, Int32 retryCount, Int32 maxRetries)
Any assistance would be greatly appreciated. This is on Umbraco 13.3.2 and Umbraco Commerce 13.1.4.
Scanning File Uploads in Umbraco Forms (Azure Blob Configuration)
p

Piotr KrĂłl

8 months ago
Hi everyone, I'm currently working with Umbraco 10.8.6 and Umbraco Forms 10.5.4, with my media stored on Azure Blob Storage. I have a contact form that includes a File Upload field where users can attach a file. My goal is to scan the file's contents using my existing method, ScanFile()—which takes a Stream representing the file content—before the file is saved in the system to ensure it doesn’t contain any malicious software. I've tried a few approaches so far: 1. I attempted to add a custom workflow to validate the file. However, it seems that by the time the workflow runs, the file is already saved in a temporary folder on Azure Blob. 2. I also tried using the MediaSavingNotification, but it appears that Umbraco Forms bypasses this notification when a file is uploaded via the form. 3. Additionally, I experimented with something like a FormValidateNotification. In that case, I had access to all the values from the submitted form. However, the file upload field's value appears as a 260-character string that doesn’t contain the file's content; it ends with the attached file's name. I'm not sure what this string represents, and I couldn’t find any documentation about it. Another idea I had was to add middleware to intercept the HTTP request after the form is submitted. However, that approach feels clunky, and I'm convinced there must be a better way. Has anyone faced a similar issue or have suggestions on the best approach to scan the file before it is saved? Perhaps there are even better methods that I haven’t considered. Thanks in advance for your help!