Posted: October 10, 2019 at 4:12 pm
Hi there, Other times it seems like it’s downloading but then it drops you on a 404 page (example 404 url: /wp-content/uploads/espresso/batch_temp_folder/##########/event-espresso-registrations-2019-10-10%2015-08-26.csv) Any guesses about what might be going on? This is happening on my dev and test environs too, and i’ve tried turning off all non-EE plugins. It didn’t make a difference. We’re on WP 5.2.3. |
|
Hi there,
So when the CSV downloads, is there a pattern to the missing registrations?
If you open up Chrome dev tools (or similar) and view the console section when downloading the CSV, does it show any JS errors? It’s possible the request is triggering a mod_sec rule on the server which is then being directed to a 404. It’s not common but we have seen it before. Any errors in the error_log when you trigger a CSV download? |
|
You get a different number of registrations in the CSV every time you download the same event, but it appears to be missing the registrations that happened in the middle time period, in groups of 50. Here’s one example in detail: Out of 83 approved registrations, the CSV includes only 33. It includes the most recent registrant (from today) then skips 50 people and includes the first 32 people who registered. Another event which has 218 approved registrations: The most recent 51 registrations followed by the first 17 registrations (missing 150). I just exported the same event again, and this time only 50 rows are missing. When it is writing the CSV file, you see this text printing: The file will download automatically when done, and then you will be redirected.<br> Registrations report started successfully...<br> Wrote 50 rows to report CSV file...<br> Wrote 50 rows to report CSV file...<br> Wrote 50 rows to report CSV file...<br> Wrote 50 rows to report CSV file...<br> Wrote 17 rows to report CSV file... But it looks like some of those 50 rows chunks aren’t getting written. The only error that appears in the chrome dev console which seems relevant (whether or not a CSV file is written) is this: batch_file_runner_init.js?ver=4.10.1.p:65 Resource interpreted as Document but transferred with MIME type text/csv: "../wp-content/uploads/espresso/batch_temp_folder/../event-espresso-registrations-2019-10-11%2017-32-33.csv". No PHP errors are appearing. |
|
Yeah, so it sounds like some of the batch requests are being dropped. Do you have any customizations hooking into the CSV process? If so, try disabling those and see if you have the same issue. Something else you can test is to set this in your
Run another export and confirm if all registrations are included.
Meaning there are other errors or that is the only error thrown? If there are JS error being thrown during the batch process it can prevent it from working, although I’m guessing not based batch text you added above. The above isn’t a problem, thats from the download itself rather than the batch processes (which appear to be the problem here). |
|
Thanks for the suggestions, Tony. They seemed to help fix the bug on my Dev environment, but my Test and Live environments are still buggy. I have copied up the database and files, and copied down the code, so you would think they are all the same. We have been experiencing another bug which might be related(?) — If you reload the page, the “return to Event Cart” button appears, and nothing else. However, if I go into the dashboard from another window and flush the site cache, then refresh the checkout page, all of the Attendee Information fields load. This bug also happens on Test and Live but not on Dev, FWIW. |
|
BTW, this bug also seems to have appeared right after I updated to event espresso core update v4.10.1.p two weeks ago. |
|
So using That constant tells Event Espresso NOT to use the batch process so if you still have missing registrations the batch write process isn’t the cause. Note that with that constant set on a site you should NOT see anything like this: https://monosnap.com/file/WInYnS7r6Nchqab6gE7D58VPWqZyPW The download should just start in the browser.
Do you have any customizations hooking into the CSV process?
Which cache? You can’t cache any of the EE critical pages so if they are cached you’ll need to exclude them, you can follow this guide: https://eventespresso.com/wiki/setup-nocache-exclusion-rules-event-espresso/
Are Live and Test on the same server whilst Dev is local/another server?
Are you 100% sure that’s the case? Any other updates done at the same time? I can’t see anything in the 4.10.1 changes that would link to any of these issues. |
|
ok, so I got
working and it seemed to fix my checkout problem. Then I commented it out, turned debugging for my Test environment on and commented out the add-wp-username-to-csv customization i made hooking into the CSV process. Now I’m getting this error during the batch process:
—
and had trace
Does this narrow it down at all?
|
|
May I ask what you changed? The above line should have nothing to do with the checkout process so I’m not sure how that caused the above.
Hmm, sort of. EE can’t access the temp batch file in the above location but the odd part is that apparently it can for some requests on the batch process as your getting different results and missing registrations from various steps in the list (the first X registrations missing, or the middle X registrations missing and so on). On the above site, look in Is it empty? If not, if you check in one of the directories, does it have a Currently, the only thing I can think of for the above is your host may be blocking the request and whatever rule they have to do so isn’t blocking every request. I recommend opening a ticket with your host and have them confirm if this is the case, I’ll check in with our developers and see if there something I’m missing that may be causing this. |
|
This is the code that I commented out: https://gist.github.com/hreidco/4b6f5f2a7f9f0337e6d2650b428cebe1 FHEE__EE_Export__report_registrations__reg_csv_array which I just learned from EEH_Debug_Tools.helper was deprecated in version 4.9.69.p in favor of FHEE__EventEspressoBatchRequest__JobHandlers__RegistrationsReport__reg_csv_array . I also learned from my host, Pantheon, that when we were bumped up to a higher traffic level on Oct 1 (whoops! forgot about that), we were put on multiple app servers (only Test & Live), which distributes temporary files across multiple urls, apparently (https://pantheon.io/docs/tmp#multiple-application-containers). if (isset($_ENV['PANTHEON_ENVIRONMENT'])) { define('SOME_TMP_SETTING', 'wp-content/uploads/private/tmp'); } as a placeholder if the conflicting app can’t be changed. Do you have any suggestions for the SOME_TMP_SETTING that would put the CSVs in my custom directory? |
|
That code only runs on the CSV export, it doesn’t run within the checkout process. With regards to
From the docs you linked to:
EE isn’t using I do think that multiple containers are causing this issue and your earlier comment:
Would also point to multiple containers causing this as dev only runs on a single container, Test and Live do not. Assuming you’ve pulled all of the code and database from test/live to dev to compare against the same data? So if Can you create a ticket with pantheon and ask which directory we should be using? I can (and will) ask but I’m not a pantheon customer. For the time being, you can export your registration by adding the constant I gave you earlier to your test/live sites
Just make sure it’s above the line
That does not use a temp file, only the batch process does, so it should work. |
|
You were right, that deprecated expression is unrelated.
and
and
This doesn’t exactly clarify a solution for me, but I would like to try filtering to the /uploads/private folder with ($_ENV['PANTHEON_ENVIRONMENT']) to see if anything changes, even though that is obviously not a long-term solution.
Yes, it’s all the same.
This is all I got from them:
I also found this thread on the subject (re: drupal): https://github.com/pantheon-systems/documentation/issues/401. They start going into a WP solution here: https://github.com/pantheon-systems/documentation/pull/584#discussion-diff-32785886 but it doesn’t appear to be resolved. Are communications with payment processors also using temporary file paths? |
|
In that case, the above directory isn’t shared, it’s synced, and that isn’t going to work with this setup.
You can’t use that directory, because of this:
The browser won’t have access to the .csv file to download it once complete.
Initially, that would appear to be a step in the right direction until you remember this line:
Whatever we do to use a temp directory/file in App Container 1 (AC1) starts the batch process and builds out the temp batch directory in uploads, right? I then steps into the batch process and sends off an ajax request to collect the first batch of registrations (REQUEST 1), that batch goes to AC1 and processes fine taking say 3 seconds, then it does another (REQUEST 2), again that goes to AC1 and processes fine again taking 3 seconds, until…. The next request (REQUEST 3) is load balanced and hits App Container 2 (AC2). Now, the first thing that is going to happen here is the request to pull the details checks for the temp .csv file, lets say AC2 hasn’t had that file propagate from AC1 yet, it doesn’t exist and you get the above EE_Error stating the file is missing…. Even if that didn’t happen, lets say the file propagated fairly quickly and did so right after REQUEST 1 on AC1, if its not a shared directory across App containers then the .csv is now going to be out of date on AC2, it has the details from Request 1 but does it have them from Request 2? If not, you now have missing rows but EE can’t identify that is the case, AC2 now writes to the .csv file with REQUEST 3’s details, if that is then synced BACK to AC1 without some kind of merge (that’s not as simple as it sounds) your data is now inconsistent. In short, a batch process that writes to a directory/file like ours that is then synced (not shared) across multiple containers with a delay (however short) isn’t going to work, the requests are sequential so there can not be a delay between when it writes one batch and the other. Without a persistent shared (not synced) directory we can use across all app containers (or a way to force specific requests to use a specific App Container) the batch process simply will not work with Pantheon and you’ll need to use the If you really want to try using
and
They allow you to change the base URL used but again, I don’t think it will work.
No, what (if any) issues are you getting with payment methods? — Disclaimer – this is all based on my assumptions of how Pantheon works, I may be completely wrong but the above is my best guess. |
|
Thanks for spelling that out, Tony. I really appreciate your time on this thread. I’m starting to wrap my head around the concept. And I’m thinking we may need to switch hosts. Reported intermittent issues: Do you think these are likely caused by the switching app servers? If so, we’ll need to leave Pantheon immediately. |
|
To be honest, thats sounding likely. The more I think about it, if some requests for the same user are hitting one AC and then another, it’s going to fail. Either that or switch to a package that does no use multiple app containers with Pantheon.
You site switched to multiple app containers around Oct 1st, so this would suggest it its an issue from multiple containers but I’ll break each one down:
This one I’m a little unsure of as its been mentioned working and then not working a couple of times when changing a function that appears irrelevant to that step, but…. If we take the function out of the equation a second, the login request we use is done via an ajax request, if that request is being sent to a different app container than the one you are on, thats likely going to cause the login to fail and the if the request returns nothing but is authorized then EE will load nothing. Again that’s just a guess though.
Same again here really, if the user is loading the site on AC1 and then the payment options request is going to AC2, I’m fairly sure it’s going to break the checkout process and do the above.
There’s lot of possible causes for this, if we stick with the AC1 and AC2 problem it’s the same thing over again, however, if the user got through on AC1, hit and error from a request going to AC2 it may also break the checkout continuing forward (hard to say for sure) but say they refreshed the page and the form loaded when submitting that could just be completely different from what EE is actually expecting.
When you say no transaction data, do you mean no EE Transaction at all or no payment within a EE transaction?
Could be linked with the above issue, but we would need to investigate this further.
I can’t say for sure, I’m not a sys admin and my understanding of how their systems work is very limited. I’m making some educated guesses and a lot of assumptions above (which I generally try to avoid doing) which may be incorrect but seem feasible. What I can tell you is the CSV issue seems likely to be from multiple containers, especially with the feedback from support, it just seems likely that the request is hitting another container and can’t find the file in We don’t often run into all of the above issues at once with users using single containers/sites/servers/{insert new term here}. I’m assuming this worked fine for you up until around Oct 1st onwards? That is appearently when Pantheon switched you over to multiple containers, so if you started running into issues then, it points to that being the likely cause. It works on Dev (which uses a single app container) but not Test/Live (which uses multiple app containers). If Pantheon does not want to troubleshoot this further then my recommendation would be to switch hosts, EE’s batch CSV process works fine on the majority of setups and splitting up requests for any e-commerce type setup is going to cause similar problems to this. |
|
OK, we’re migrating to a new host. Pantheon believes the fault lies with Event Espresso 🙂 |
|
The support post ‘Incomplete Registration Report Downloads’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.