CON-1252 - SendEmail Workflow don't find uploaded file to attach in Azure Storage

Created by Vidar Solberg 31 Jan 2017, 08:07:56 Updated by Jacob Midtgaard-Olesen 21 Mar 2018, 15:41:53

Tags: Gold partner

Is duplicated by: CON-1273

We have a Umbraco 7.5.7 site using Umbraco Forms 4.4.0 (NuGet) and Azure Storage for uploaded files.The FileSystemProviders.config:

The UploadStorageDirectory in UmbracoForms.config is empty:

Almost everything works fine. Uploaded files got stored in the Azure storage, links to files in the backoffice Entries works, and the workflow email is sent (file links in the emails are relative, though). But when checking the "Attach file uploads to email" in the Send email workflow step, the following error appears in the log when submitting the form: Umbraco.Forms.Core.Providers.WorkflowTypes.SendEmail - There was a problem sending an email to 'me@oursite.no' from Workflow for Form 'Contact form' with id '...' for Record with unique id '...' System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\home\site\wwwroot\media\forms\upload\form_......\filename.pdf'.

So the only problem seems to be that the email sender is trying to pick up the file from the web site's media-folder instead of the Azure storage - or more correct; the registered FileSystemProvider.

1 Attachments

Download SendEmail2.cs

Comments

Alex Vilmur 09 Mar 2017, 19:22:50

I'm seeing this issue as well. Everything is stored correctly in blob storage and accessible in the backoffice. When trying to attach the file in an email it is not going to blob storage to retrieve the file.


Florin Lazau 10 Mar 2017, 15:22:14

Hi guys,

Any updates here?

I have exactly the same issue.

Thanks


Phil Dye 15 Dec 2017, 12:18:48

Duped by #CON-1273 ?


Claus Jensen 20 Mar 2018, 08:30:43

Have fixed this to use the VirtualPathProvider as suggested in the related issue. Confirmed that this still works with files stored local, while also working with Azure Blob Storage.

PR: https://github.com/umbraco/Forms/pull/183

This fix has been made in latest v7 branch and will not be backported to older versions as it is possible to patch this in existing sites using a custom workflow. I have attached a drop-in .cs file that can be put in ~/App_Code of an existing site which will add a "Send email (new)" workflow to the available workflows. Apart from the filesystem fix, it does exactly the same as the internal "Send email" workflow.


Warren Buckley 20 Mar 2018, 10:03:45

All tested & works fine - learnt a new way to deal with files in Azure Blob storage too (As different approach from one used in the Razor Email template workflow)


Steve 21 Mar 2018, 11:30:39

Time for a post mortem on this issue:

  • Can we be sure that nowhere else in the code of Forms/Courier/Deploy this issue still exist?
  • I assume this fix didn't require major architectural changes to the code so why wasn't this bug fixed sooner?
  • Customers of Umbraco Cloud are expected to host their media (and form uploads) in an Azure Storage account. If HQ checks the logfiles from Cloud customers you must have noticed a shitload of exceptions being logged.


Jacob Midtgaard-Olesen 21 Mar 2018, 15:41:53

Thank you for your feedback Steve, happy to see this issue resolved!

We resolve bugs as fast as possible here at HQ and work hard to ensure the continued high quality of our Cloud services. This issue had a bit longer resolution time than expected, we appreciate your patience.

We hope you enjoy the fix, let us know if you get additional problems.

Regards, Jacob Midtgaard-Olesen CTO, Umbraco


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty:

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 4.4.0

Due in version: 7.0.1

Sprint: Sprint 81

Story Points: 1

Cycle: 9