BoldGrid / w3-total-cache

GNU General Public License v2.0
152 stars 85 forks source link

400 Bad Request from minify CSS #814

Closed jamieburchell closed 6 months ago

jamieburchell commented 8 months ago

Occasionally I am seeing references in my HTML to stylesheets that produce this output:

Screenshot 2024-02-05 092226

This results in broken/missing styles on the website.

When this happens, the file in question - in this case 6e7bc.css doesn't exist in the cache directory. Clearing all W3TC caches does not rectify the issue. To solve it, I had to regenerate Elementor's CSS then clear the W3TC caches.

Thinking that something was wrong with the generated CSS from Elementor, I compared the files it generated the first time around with the files that it generated the second time around and they were actually identical.

### wp-core ###

version: 6.4.3
site_language: en_GB
user_language: en_GB
timezone: Europe/London
permalink: /%category%/%year%/%monthnum%/%day%/%postname%/
https_status: true
multisite: false
user_registration: 0
blog_public: 1
default_comment_status: undefined
environment_type: production
user_count: 5
dotorg_communication: true

### wp-paths-sizes ###

wordpress_path: /var/www/web/wp
wordpress_size: loading...
uploads_path: /var/www/web/app/uploads
uploads_size: loading...
themes_path: /var/www/web/app/themes
themes_size: loading...
plugins_path: /var/www/web/app/plugins
plugins_size: loading...
database_size: loading...
total_size: loading...

### wp-dropins (2) ###

advanced-cache.php: true
object-cache.php: true

### wp-active-theme ###

name: Hello Elementor (hello-elementor)
version: 3.0.1
author: Elementor Team
author_website: https://elementor.com/?utm_source=wp-themes&utm_campaign=author-uri&utm_medium=wp-dash
parent_theme: none
theme_features: core-block-patterns, widgets-block-editor, menus, post-thumbnails, automatic-feed-links, title-tag, html5, custom-logo, editor-style, align-wide, woocommerce, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider
theme_path: /var/www/web/app/themes/hello-elementor

### wp-mu-plugins (3) ###

Bedrock Autoloader: version: 1.0.3, author: Roots
Disable status tests: version: 1.0.0, author: Roots
Register Theme Directory: version: 1.0.0, author: Roots

### wp-plugins-active (11) ###

Code Snippets: version: 3.6.3, author: Code Snippets Pro
Converter for Media: version: 5.12.0, author: matt plugins
DCO Comment Attachment: version: 2.4.0, author: Denis Yanchevskiy
Elementor: version: 3.19.0, author: Elementor.com
Elementor Pro: version: 3.19.0, author: Elementor.com
Pods - Custom Content Types and Fields: version: 3.0.10, author: Pods Framework Team
Post Types Order: version: 2.1.4, author: Nsp Code
Rank Math SEO: version: 1.0.212, author: Rank Math
Spreaker Shortcode: version: 1.8.1, author: Spreaker
W3 Total Cache: version: 2.6.1, author: BoldGrid
Wordfence Security: version: 7.11.1, author: Wordfence

### code-snippets (6) ###

snippet-6: name: Enqueue Template Stylesheets, scope: front-end, modified: 2021-09-09 11:13:01
snippet-7: name: Set WordPress email from address, scope: global, modified: 2021-11-22 12:18:55, tags: [filter, action]
snippet-9: name: Change comments heading for tribute page, scope: global, modified: 2022-05-24 11:52:58, tags: [filter]
snippet-12: name: Remove website fields from comments form, scope: global, modified: 2023-02-03 09:39:25, tags: [filter]
snippet-13: name: Prevent RankMath from purging page cache, scope: global, modified: 2023-04-24 16:03:50, tags: [filter]
snippet-15: name: Disable Skip to Content Link, scope: global, modified: 2023-12-01 17:10:05, tags: [filter]

### wp-media ###

image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1692
imagemagick_version: ImageMagick 6.9.12-50 Q16 x86_64 17254 https://legacy.imagemagick.org
imagick_version: 3.7.0
file_uploads: 1
post_max_size: 50M
upload_max_filesize: 40M
max_effective_size: 40 MB
max_file_uploads: 20
imagick_limits: 
    imagick::RESOURCETYPE_AREA: 3 GB
    imagick::RESOURCETYPE_DISK: 9.2233720368548E+18
    imagick::RESOURCETYPE_FILE: 768
    imagick::RESOURCETYPE_MAP: 3 GB
    imagick::RESOURCETYPE_MEMORY: 2 GB
    imagick::RESOURCETYPE_THREAD: 1
    imagick::RESOURCETYPE_TIME: 9.2233720368548E+18
imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, AVI, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, H, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIDEO, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV
gd_version: 2.3.3
gd_formats: GIF, JPEG, PNG, WebP, BMP, AVIF, XPM
ghostscript_version: not available

### wp-server ###

server_architecture: Linux 4.18.0-513.9.1.el8_9.x86_64 x86_64
httpd_software: Apache
php_version: 8.1.27 64bit
php_sapi: fpm-fcgi
max_input_variables: 1000
time_limit: 120
memory_limit: 256M
max_input_time: 60
upload_max_filesize: 40M
php_post_max_size: 50M
curl_version: 7.61.1 OpenSSL/1.1.1k
suhosin: false
imagick_availability: true
pretty_permalinks: true
current: 2024-02-05T09:29:48+00:00
utc-time: Monday, 05-Feb-24 09:29:48 UTC
server-time: 2024-02-05T09:29:45+00:00

### wp-database ###

extension: mysqli
server_version: 10.5.22-MariaDB-log
client_version: mysqlnd 8.1.27
max_allowed_packet: 16777216
max_connections: 51

### wp-constants ###

WP_HOME: https://www.example.com
WP_SITEURL: https://www.example.com/wp
WP_CONTENT_DIR: /var/www/web/app
WP_PLUGIN_DIR: /var/www/web/app/plugins
WP_MEMORY_LIMIT: 40M
WP_MAX_MEMORY_LIMIT: 256M
WP_DEBUG: false
WP_DEBUG_DISPLAY: false
WP_DEBUG_LOG: false
SCRIPT_DEBUG: false
WP_CACHE: true
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: Undefined
WP_DEVELOPMENT_MODE: undefined
DB_CHARSET: utf8mb4
DB_COLLATE: undefined

### wp-filesystem ###

wordpress: not writable
wp-content: not writable
uploads: writable
plugins: not writable
themes: not writable
mu-plugins: not writable

### pods ###

pods-server-software: Apache
pods-user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
pods-session-save-path: /var/www/session
pods-session-save-path-exists: Yes
pods-session-save-path-writable: Yes
pods-session-max-lifetime: 1440
pods-opcode-cache-apc: No
pods-opcode-cache-memcached: No
pods-opcode-cache-opcache: Yes
pods-opcode-cache-redis: No
pods-object-cache-apc: No
pods-object-cache-apcu: No
pods-object-cache-memcache: No
pods-object-cache-memcached: Yes
pods-object-cache-redis: No
pods-memory-current-usage: 25.810M / 40M
pods-memory-current-usage-real: 28.000M
pods-network-wide: No
pods-install-location: /var/www/web/app/plugins/pods/
pods-developer: No
pods-tableless-mode: No
pods-relationship-table-enabled: Yes
pods-relationship-table-status: 10
pods-light-mode: No
pods-strict: No
pods-allow-deprecated: Yes
pods-api-cache: Yes
pods-shortcode-allow-evaluate-tags: No
pods-sessions: Disable sessions
pods-can-use-sessions: Yes
pods-settings-types_only: No
pods-settings-watch_changed_fields: Yes
pods-settings-metadata_integration: Yes
pods-settings-metadata_override_get: Yes
cssjoe commented 6 months ago

@jamieburchell This issue appears to be a configuration issue in the hosting environment. We see that your post includes "wp-content: not writable" and a WordPress installation path that most likely is owned by "root" and your PHP running user is not "root". We recommend reviewing your server configuration. You can also ask us for help by going to our Premium support page ("wp-admin/admin.php?page=w3tc_support"). Our GitHub issues section is for bugs and enhancements.

jamieburchell commented 6 months ago

It has nothing to do with the wp-content directory not being writable @cssjoe. It's set like that for security reasons as per Roots Bedrock and WordPress hardening best practice. The folders that need to be writable within it are in fact writable. That includes the W3TC directories and uploads. It's an occasional occurrence (as stated) which further invalidates your reasoning.

I still believe it's a race condition of some sort and I continue to run in to it occasionally.

Your dismissive response and immediate closure of this issue as invalid is frustrating.