2

TL;DR Pantheon's distributed file system can't handle modules that refer to the temp file system across multiple requests, which messes up the Plupload module. What alternatives are there?

The error occurs when users upload images to the site using PLUpload, and it only occurs in the LIVE environment. Our discussions with pantheon support indicate that this is likely something to do with our code not playing nicely with the load balancing in the live environment. At this point though, we're pretty stumped on how to proceed. I was hoping someone here may have encountered it and could provide some insight on how to proceed.

In case the screenshots do not share correctly, I have included a link to a google doc

Here's an example of the error message.
Sample of error message

Some notes:

  • We uploaded 5 images here. 2 were rejected as you see in the pink notification below. The number of failed images appears to be entirely random - sometimes all will work. Sometimes just 1, sometimes none.
  • We have tried changing the path from temporary:// to public:// - this error appears to occur regardless of where the temp space is pointed. Only occurs in the live environment due to the load balancing in use with our hosting provider
  • Cloud-based hosting, so we do not have access to make changes to the load balancer.

Steps we've taken:

  1. Insert watchdog in file.inc where we see this error
  2. Enable dblog and try to reproduce the error you see above.
  3. Identify the failure point in the debug log. Here's what we see: enter image description here
  4. Watchdog is showing that the file in question does not exist
  5. We check the SFTP, and it's definitely there.

In our discussions with the hosting provider, here's what we learned:

  • This is likely a fringe case that the load balancer doesn't have the ability to handle.
  • It sounds like the module is making a number of requests with the assumption that they can share a tmp directory.
  • and this comment:

Do you know if the PLUpload file issues multiple HTTP requests (via AJAX maybe?) when doing the uploads? If so, it may be that it's assuming that the temporary filesystem is shared between all requests.

This is a common flaw in a lot of contributed modules or plugins: they assume that there's only one place the code is executing, and that the "temp" filesystem space is available consistently across N requests.

This isn't what temporary filesystems are really for, but in a legacy single machine architecture it will rarely cause failures. Once you are distributed that assumption will fail quite reliably.

Now for the part that has us stumped:

  • It seems that PLupload might not be our best approach. If we want to get it to work, we'd have to figure out how it's handling temporary file requests.
  • Our site was originally built with PLupload and Field Collection working together. I'm curious if there's other modules we can look into that will allow us to get the functionality of both within the confines of the hosting environment.
  • TL;DR Pantheon's distributed file system can't handle modules that refer to the temp file system across multiple requests, which messes up the Plupload module. What alternatives are there? – Clive Apr 24 '15 at 14:20
  • Thought that summary would be useful, I'm sure many people won't bother to read the whole thing on a Friday, well written though it is! – Clive Apr 24 '15 at 14:21
0

This is a note for people who face this problem. Maybe it can help them.

I had this error on a project. I see that it occurs on a plupload widget with a limit of file number set to 1. I replaced this field by a classic upload and the problem gone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.