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.
- 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:
- Insert watchdog in file.inc where we see this error
- Enable dblog and try to reproduce the error you see above.
- Identify the failure point in the debug log. Here's what we see:
- Watchdog is showing that the file in question does not exist
- 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.