Email attachment via load balancer | Community
Skip to main content
Milan_Vucetic
Level 9
Dec 16, 2019 9:29 AM UTC
Solved

Email attachment via load balancer

Hi everyone,

 

I am playing with email attachments from local computer and it works fine when it is used on test environment as there exist only one app server.

When it is used on production environment where exist two app servers and load balancer in front of them, attachment is uploaded only on one server (which is current in the moment of the upload) and some temporary error is thrown:

Unable to finalize storage of resource as the file has not been uploaded...

 

So, until we start delivery execution load balancer can switch user to another server where file does not exist and brake it.

Is there a "easy & nice" way to overcome this without uploading files with workflows, etc... ?

 

Regards,

Milan

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Jonathon_wodnicki
Jonathon_wodnickiAccepted solution
New Participant
Dec 18, 2019 3:32 PM UTC

Hi,

 

Easy answer is to just mount resource dirs from a network share, which you should be doing anyway for workflow file uploads etc.

Another option is to list both app servers as mta child's in their instance confs, which logically should cause the first to publish attachments to the second and vice-versa.

Finally, your load balancer should be in active/passive mode, with all traffic going to the primary until it dies. There are other issues with active/active, e.g. preventing users from reliably using unconditional halt on workflows.

 

Thanks,

-Jon

4 replies

Jonathon_wodnicki
Jonathon_wodnickiAccepted solution
New Participant
Dec 18, 2019 3:32 PM UTC

Hi,

 

Easy answer is to just mount resource dirs from a network share, which you should be doing anyway for workflow file uploads etc.

Another option is to list both app servers as mta child's in their instance confs, which logically should cause the first to publish attachments to the second and vice-versa.

Finally, your load balancer should be in active/passive mode, with all traffic going to the primary until it dies. There are other issues with active/active, e.g. preventing users from reliably using unconditional halt on workflows.

 

Thanks,

-Jon

Translate
Milan_Vucetic
Level 9
Dec 20, 2019 11:17 AM UTC

Hi wodnicki,

I can change upload path on app servers and that will solve my problem:

 

from uploadDirectory="$(XTK_INSTALL_DIR)/var/$(INSTANCE_NAME)/upload/"  to uploadDirectory="mounted_partition/upload/"

The question is, can this change impact any other regular process on AC?

 

Thanks in advance.

Milan

Translate
_Manoj_Kumar_
New Participant
Dec 16, 2019 9:50 AM UTC

Hello Milan,

 

You can use Amazon S3 integration in this case and upload your static content there.

 

Thanks,

Manoj

Translate
     Manoj     Find me on LinkedIn
Milan_Vucetic
Level 9
Dec 16, 2019 10:16 AM UTC

Hi Manoj,


this is helpful. I am trying to find and easy way (change form/js code) in order to solve it.

As we have a mounted partition to both server (for sharing logs and partition is visible by both servers) it is feasible to change upload path to there but I cannot find where this is defined.

By default attach is uploaded to the /usr/local/neolane/nl6/var/InstanceName/upload

 

Regards,

Milan

Translate