Have posted some recent patches that I thought would help resolve this issue, but still having the same problems.
When loading a page that has not been visited in a while, it will request JavaScript files that do not exist in S3. After some time passes, new JavaScript files are loaded that do exist in S3, and the page works.
However, this is not a matter of caching -- if I visit the page again a little while later, it returns to the same state. As an example, here are the JS files requested the first few times a given page is loaded (and fails):
/s3fs-js/advagg_js/js__Li7v1YF9lEbIvK3za9RRxCmHJ0YFtTMVhGlk_4X3BYc__gPE5qgf5C1MYNZC_wejpP0_wDv1f0jCdW2iAl_QndCk__BnaddM1d0_Vxx6gPx5Kv7Ke6Klx40k62BA3pbd0Tkpw.js
/s3fs-js/advagg_js/js__zkpioVtqkvev74hko0sDdz5Sev-Fj9ZwZt0h1Jz3gjo__wdbkgtG_FGidQkTywE2bLFDI66htCxyYby-_t0GoVbk__BnaddM1d0_Vxx6gPx5Kv7Ke6Klx40k62BA3pbd0Tkpw.js
/s3fs-js/advagg_js/js__0YMrAP55K1J0I3R84eTCJgfZT6YRIXWOcD20ydlyybU__M9i0OZhAQM9FaL2j_EWHl2WZ0IQ_q4DnfkiCuSKjNGE__BnaddM1d0_Vxx6gPx5Kv7Ke6Klx40k62BA3pbd0Tkpw.js
And then after a certain period of time, the page successfully loads with these JS files, even though no changes have been made to files to be aggregated or AdvAgg settings:
/s3fs-js/advagg_js/js__Li7v1YF9lEbIvK3za9RRxCmHJ0YFtTMVhGlk_4X3BYc__gPE5qgf5C1MYNZC_wejpP0_wDv1f0jCdW2iAl_QndCk__BnaddM1d0_Vxx6gPx5Kv7Ke6Klx40k62BA3pbd0Tkpw.js
/s3fs-js/advagg_js/js__GM3GJPR36rRIz0TRkjC5OQwrioSyN9aoYRivDhCO_AM__qAl84FcCv2jyN22yFGS5Oc85cjd9zKX6p_cFNLGhe-M__BnaddM1d0_Vxx6gPx5Kv7Ke6Klx40k62BA3pbd0Tkpw.js
/s3fs-js/advagg_js/js__3LuYkqUjZCBoSLlHr2m61kSbmsCSqUKFXy8HcWtx3W4__fjMmdyFoQfs65a7ohq9q0rrTzQSedREzEOJ7PEgkNE8__BnaddM1d0_Vxx6gPx5Kv7Ke6Klx40k62BA3pbd0Tkpw.js
I also added some watchdog statements in advagg_build_aggregate_plans, and noticing that the $files_to_aggregate array almost always has values for JS files. Why would this code be running so frequently?
I would think once it is built, it should not change that often.
Comments
Comment #2
sgdev commentedThis is my current setup:
* HTTPRL 7.x-1.x-dev
* AdvAgg 7.x-2.x-dev
* s3fs 7.x-2.10
* Nginx 1.13.12
* HTTPS enabled via port 443
I've spent a lot of time running traces and stepping through AdvAgg code. I have found HTTPRL is running endlessly without receiving a response, causing a situation where a record exists in the database for the AdvAgg aggregate, but no file has been saved to S3 via the s3fs module.
The result is pages are loaded with no CSS or JS, because AdvAgg is referencing aggregates that don't actually exist.
These problems did not occur prior to switching to s3fs and moving our test environment to run everything through https. Could there be a server configuration issue? Maybe it's possible, but everything in the Status Report is telling us HTTPRL is configured correctly (using -1, etc.).
If I disable aggregates from being generated by HTTPRL, everything works without issue.
The HTTPRL code gets stuck in a loop and eventually Nginx reaches timeout after running for about 5 minutes. Here is the part of the trace where AdvAgg hands off to HTTPRL:
Once this is done, there are thousands of lines repeating the same HTTPRL tasks over and over. I'm assuming this is HTTPRL waiting for a response and never getting one.
I notice it also loops through acquiring a lock many times. Maybe a conflict, but could also just be that a new lock is needed given the amount of time it is taking.
I have a file of 325MB worth of trace data, all of this repeating multiple times before I killed the process.
As of right now, I have HTTPRL completely disabled, and using cURL HTTP Request (https://www.drupal.org/project/chr) as a replacement for
drupal_http_request. This works without issue.