Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send email workflow not using filesystemprovider #477

Closed
jmayntzhusen opened this issue Jan 13, 2021 · 5 comments
Closed

Send email workflow not using filesystemprovider #477

jmayntzhusen opened this issue Jan 13, 2021 · 5 comments

Comments

@jmayntzhusen
Copy link

jmayntzhusen commented Jan 13, 2021

A brief description of the issue goes here.

In Forms we have some standard field types and workflows, the relevant field type here is an upload field and the relevant workflow is one where you can set a form to send an email with the form submission when submitted.

By default form uploads are stored in ~/media/forms/upload/[guid]/[guid]/[guid]/filename.pdf

The upload storage destination is based on the filesystem provider, so if you change to blob storage it will start to place them in the same path but within the blob storage instead of in the server filesystem.

This still allows you to submit forms, and the records in the backoffice are also working just fine - the problem is the send email workflow that comes out of the box allows you to include attachments for uploads, and when it tries to get that attachment it doesn't check the filesystemprovider but just looks in the physical file system - which is no longer used and it throws an error saying the file doesn't exist, and the email doesn't get sent.

Reproduction

If you're filing a bug, please describe how to reproduce it. Include as much
relevant information as possible, such as:

Bug summary

Specifics

This was tested on
Umbraco: 7.15.6
Umbraco.Forms: 7.4.1

However looking at the workflow code I suspect it has the same issue on v8:
https://github.com/umbraco/Forms/blob/7.4.1/Umbraco.Forms.Core.Providers/WorkflowTypes/SendEmail.cs#L89
https://github.com/umbraco/Forms/blob/release-8.6.0/src/Umbraco.Forms.Core.Providers/WorkflowTypes/SendEmail.cs#L101

Steps to reproduce

  • Create a Form with an upload field
  • Add a workflow of type "send email", make sure you tick "include attachments"
  • Set up SMTP and blob storage
  • Render the Form on the frontend and make a submission
  • Check that the uploaded file is in the blob storage
  • Check that the uploaded file exists and works in the record

Expected result

The email sends and the uploaded file is attached

Actual result

Email is never sent, throws this error:

2021-01-13 13:49:41,839 [P12772/D5/T55] INFO  Umbraco.Forms.Web.Services.RecordService - Form Entry Submitted - Form Entry Id: '0', Form Id: 'adf160f1-39f5-44c0-b01d-9e2da32bf093', User: ''
 2021-01-13 13:49:41,902 [P12772/D5/T55] ERROR Umbraco.Forms.Core.Providers.WorkflowTypes.SendEmail - There was a problem sending an email to '[email protected]' from Workflow for Form 'Contact Form' with id 'adf160f1-39f5-44c0-b01d-9e2da32bf093' for Record with unique id 'b4a8e00e-2671-4393-a28e-4f06373f1ae2'
System.IO.FileNotFoundException: Could not find file 'C:\home\site\wwwroot\media\forms\upload\form_adf160f1-39f5-44c0-b01d-9e2da32bf093\89c71940-e2e3-4d3c-f1ff-1e65d2fe5b28\umbracotracelog.prweswe2sv3anv.txt.2021-01-11'.
File name: 'C:\home\site\wwwroot\media\forms\upload\form_adf160f1-39f5-44c0-b01d-9e2da32bf093\89c71940-e2e3-4d3c-f1ff-1e65d2fe5b28\umbracotracelog.prweswe2sv3anv.txt.2021-01-11'
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at System.Web.Hosting.MapPathBasedVirtualFile.Open()
   at Umbraco.Forms.Core.Providers.WorkflowTypes.SendEmail.Execute(Record record, RecordEventArgs e)
 2021-01-13 13:49:42,020 [P12772/D5/T55] INFO  Umbraco.Forms.Web.Services.RecordService - Form Entry Approved - Form Entry Id: '1', Form Id: 'adf160f1-39f5-44c0-b01d-9e2da32bf093', User: ''

This item has been added to our backlog AB#10094

@bergmania bergmania added the state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks label Jan 21, 2021
@AndyButland
Copy link

There's a related issue here when it comes to XSLT files used for transformations of emails and XML posts - they are also expected to live on the file system.

@aguyfromdenmark
Copy link

I have this issue as well.
On a site running Umbraco 8.6.7 and Forms 8.4.2 on Cloud.

@nikolajlauridsen
Copy link

I couldn't reproduce the issue, however, a fix has been added so that we now use the media filesystemsprovider, so this bug should have been fixed.

@umbrabot umbrabot removed the state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks label Feb 8, 2021
@skttl
Copy link

skttl commented Feb 23, 2021

Is this issue also for sending xslt formatted emails?

I'm still getting this error message when sending XSLT-formatted emails on 8.6.1.

System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\media\1769\xsltfile.xslt'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
   at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
   at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
   at System.Xml.Xsl.Xslt.XsltLoader.CreateReader(Uri uri, XmlResolver xmlResolver)
   at System.Xml.Xsl.Xslt.XsltLoader.Load(Compiler compiler, Object stylesheet, XmlResolver xmlResolver)
   at System.Xml.Xsl.Xslt.Compiler.Compile(Object stylesheet, XmlResolver xmlResolver, QilExpression& qil)
   at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
   at System.Xml.Xsl.XslCompiledTransform.Load(String stylesheetUri)
   at Umbraco.Forms.Core.Data.Helpers.XsltHelper.TransformXML(XmlNode xml, String xsltFile, Dictionary`2 settings)
   at Umbraco.Forms.Core.Providers.WorkflowTypes.SendXsltEmail.Execute(Record record, RecordEventArgs e)

I have verified that the file actually exists

@skttl
Copy link

skttl commented Feb 23, 2021

Also tried uploading the xslt again and assigning it (after doing a workaround for another bug #348)

But still no cigar

System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\media\nvknz4qz\xsltfile.xslt'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
   at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
   at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
   at System.Xml.Xsl.Xslt.XsltLoader.CreateReader(Uri uri, XmlResolver xmlResolver)
   at System.Xml.Xsl.Xslt.XsltLoader.Load(Compiler compiler, Object stylesheet, XmlResolver xmlResolver)
   at System.Xml.Xsl.Xslt.Compiler.Compile(Object stylesheet, XmlResolver xmlResolver, QilExpression& qil)
   at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
   at System.Xml.Xsl.XslCompiledTransform.Load(String stylesheetUri)
   at Umbraco.Forms.Core.Data.Helpers.XsltHelper.TransformXML(XmlNode xml, String xsltFile, Dictionary`2 settings)
   at Umbraco.Forms.Core.Providers.WorkflowTypes.SendXsltEmail.Execute(Record record, RecordEventArgs e)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants