Welcome to the live blog! The live blog intends to dump my brain. It’s unfiltered, unedited and at times just information. It might have some knowledge or wisdom at times.
The original Live Blog is at https://wpguide.io/live-blog I will be migrating content over slowly.
OVH UK Bare-Metal Proxmox Additional IP’s and Enhance Control Panel
Introduction This article talks about deploying the Enhance Control Panel using Proxmox on OVH’s bare-metal instances in their UK datacenter with additional IP’s. Wow, that’s a mouth full. Virtualization and OVH bare-metal Instances with Additional IP’s When you order a bare-metal instance in OVH’s UK data center with additional IPs, and want to use virtulzation such as Proxmox. OVH UK’s data-center only supports internal addresses behind a bridge with the src option used for routing on your guest VM’s. They do not support virtual macs which other OVH data-centers do support. The UK data center is suppose to support virtual…
Mirroring the WordPress Plugin Directory, Short Sighted and Half the Equation
Introduction This was a response to a Facebook post about how wordpress.org could block access to mirroring it’s content. I had some thoughts that I ended up sharing and think its important for it to be online, I might not be getting everything right. But every great idea is spawned from not so great idea. WordPress.org Blocking Mirroring and Charging for Access I responded to someone stating that WordPress.org could just block those trying to mirror it’s data and potentially charge for access. This is true, here is my response. Yes, WordPress.org could block access to those looking to mirror…
WordPress Plugins Disappearing or Erroring After Update – Disabling Cloudflare Speed Brain
Introduction If you recently tried to update your WordPress website’s plugins, you might have run into issues where the plugins will fail and then disappear. Sometimes the plugin will error with a number of different messages. Installation failed: Could not copy file. Installation failed: The package could not be installed. PCLZIP_ERR_MISSING_FILE Update Failed: Could not copy file. WordPress Update Failed: the package could not be installed missing file You might also have errors in Chrome console. updates.min.js?ver=6.6.2:2 Uncaught TypeError: Cannot read properties of undefined (reading ‘attr’) at g.updates.updatePluginError (updates.min.js?ver=6.6.2:2:8930) at c (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:2:25304) at Object.fireWith [as rejectWith] (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:2:26053) at Object.<anonymous> (wp-util.min.js?ver=6.6.2:2:1230)…
Dealing with PHP-FPM Segfaults in Unbuntu
Introduction You’re getting 502 errors on your site, you have an Ubuntu server (this was a Ubuntu 22 server with GridPane) and you’re digging deeper and see that Nginx is getting a connection reset by peer from PHP-FPM in the sites error log. 024/10/07 08:52:28 [error] 753728#753728: *2097 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 0.0.0.0, server: domain.com, request: “GET /add-slimpod-to-homescreen/ HTTP/2.0”, upstream: “fastcgi://unix:/var/run/php/php81-fpm-domain.com.sock:”, host: “domain.com”, referrer: “https://domain.com/help/” You start digging more and more, and start looking in /var/log/syslog and find a segfault during the same time. Oct 7 08:52:28 server1 kernel: [1658840.187828]…
Reboot maintenance notification from Vultr, what does it mean?
Introduction Someone posted this, I responded and thought the internet would benefit. Hi, this is the first mail from Vultr I get announcing Maintenance. Especially this sentence got me confused. Please be aware that as we do not have access to your filesystem, this reboot will not be as clean as if it were done from within your OS, so preparing your software/filesystem with a graceful shutdown of services and the VPS itself would be advised. Does this mean I have to shutdown the server, because I can only reboot from the GP dashboard. Response This is common sentence from…
Resolving .well-known/traffic-advice 404 Errors
Introduction You might be seeing the following errors in your Nginx log pilling up. 2024/09/19 15:03:56 [error] 807292#807292: *2418 open() “/var/www/domain.com/htdocs/.well-known/traffic-advice” failed (2: No such file or directory), client: 142.250.32.40, server: domain.com, request: “GET /.well-known/traffic-advice HTTP/2.0”, host: “domain.com” What is .well-known/traffic-advice? The traffic-advice file, located in the /.well-known/ directory, is a JSON configuration file, although it doesn’t have a .json extension, likely for future adaptability. Currently utilized only by Chrome, this file communicates with prefetch proxies that visit your website, instructing them whether or not to prefetch your pages and, if so, to what extent. This extent is represented as…
Resolving “nginx: [warn] could not build optimal variables_hash” Nginx Error
Introduction You’ve made some changes to Nginx, and did a syntax check or restarted/reloaded, you might have been greeted with this. nginx: [warn] could not build optimal variables_hash, you should increase either variables_hash_max_size: 1024 or variables_hash_bucket_size: 64; ignoring variables_hash_bucket_size What does this mean? The Nginx documentation has the following to say https://nginx.org/en/docs/hash.html To quickly process static sets of data such as server names, map directive’s values, MIME types, names of request header strings, nginx uses hash tables. During the start and each re-configuration nginx selects the minimum possible sizes of hash tables such that the bucket size that stores keys with identical…
Caching Facebook Query Parameters/Strings with Nginx
Introduction When someone shares a link on Facebook, the link they click includes an extra query string, like the following. https://managingwp.io/live-blog/nginx-error-setrlimitrlimit_nofile-25562325-failed-1-operation-not-permitted/?fbclid=IwY2xjawE6Cz1leHRuA2FlbQIxMQABHQtQRq0Ma2pk9bXQQfM_vyGWE_YPHCMp9VhWudfQR9N6FRv7pkKjL7ZTfQ_aem_GTXCB2GK_bezDLTO7WhktA This is problematic because common Nginx configurations will not cache URLs with a query string, and it’s even worse when a site is using WordPress, as these queries will result in a dynamic request. Configuration for Nginx FastCGI Caching on GridPane Unfortunately, this guide is specifically for GridPane, but you can read more about doing this on Easy Engine. https://community.easyengine.io/t/ignore-query-parameters-with-fastcgi-cache/4622 The variable $uri only resolves to index.php, and $request_uri includes the path and query strings. We will address this…
Nginx Error: setrlimit(RLIMIT_NOFILE, 25562325) failed (1: Operation not permitted)
Introduction You might have noticed this error in your Nginx log file at some point, especially on larger WordPress sites. 2024/08/22 00:46:09 [alert] 364292#364292: setrlimit(RLIMIT_NOFILE, 25562325) failed (1: Operation not permitted) What is setrlimit? A Linux system has limits on what resources a process (application can utilize. It’s safeguards the system from keeling over. A linux system as a number of limits, the C programming language has a function called setrlimit, which sets the maximum number of file descriptors that a process can open. A file descriptor is used to interact with an I/O resource such as a file or…
Openlitespeed or Litespeed: Error: can’t open log file!
Introduction This is going to be a quick one. If you’ve ever tried to visit a site on your server running Openlitespeed or Litespeed (not 100% confirmed, you might get the following output. Error: can’t open log file! Cause? Can’t Write to Log File It’s actually pretty straight forward, Openlitespeed and Litespeed can’t write to a log file. It’s strange that it’s returning a 200 error, when it should be returning a 500 error. But what log file? Check the main Openlitespeed / Litespeed log /usr/local/lsws/logs/error.log for errors # tail -f /usr/local/lsws/logs/error.log 2024-08-18 09:24:20.796796 [NOTICE] [1865589] [127.0.0.1:23046:HTTP2-1#domain.com] [STDERR] PHP Warning:…
Redis Cache Clearing Causes Redis Plugin Error
Introduction You might have had reports or experienced a time when a site showed a Redis Plugin error similar to the one below. Error establishing a Redis connection read error on connection to /var/run/redis/redis-server.sock WordPress is unable to establish a connection to Redis. This means that the connection information in your wp-config.php file are incorrect, or that the Redis server is not reachable. Is the correct Redis host and port set? Is the Redis server running? If you need help, please read the installation instructions. To disable Redis, delete the object-cache.php file in the /wp-content/ directory. Now this is a…
Debugging REST API admin-ajax.php (MySQL Queries and PHP functions)
Introduction When there are admin-ajax.php queries that take a substantial amount of time, there is no easy way to debug these requests. Debugging admin-ajax.php Options Query Monitor You’d think that installing the Query Monitor plugin would work, however this isn’t yet functional. WIP: Implement client side rendering by johnbillion · Pull Request #483 · johnbillion/query-monitor · GitHubThis starts us down the path of switching over Query Monitor’s output to client-side rendered React components. This has numerous benefits including: Better performance (no need to render a big pi…github.com Newrelic You can always install Newrelic, since it’s a PHP module it will…
LearnDash Slow Database Queries and Poor Database Design
Introduction Working on a LearnDash site for a client, I noticed some long running queries within the MySQL Slow log and PHP FPM slow log. PHP Slow Log [09-Aug-2024 16:18:04] [pool domain.com80] pid 646207 script_filename = /var/www/domain.com/htdocs/wp-admin/admin-ajax.php [0x00007f78e9c13a30] mysqli_query() /var/www/domain.com/htdocs/wp-includes/class-wpdb.php:2349 [0x00007f78e9c139c0] _do_query() /var/www/domain.com/htdocs/wp-includes/class-wpdb.php:2263 [0x00007f78e9c138e0] query() /var/www/domain.com/htdocs/wp-content/plugins/query-monitor/classes/DB.php:29 [0x00007f78e9c13820] query() /var/www/domain.com/htdocs/wp-includes/class-wpdb.php:3146 [0x00007f78e9c13730] get_results() /var/www/domain.com/htdocs/wp-content/plugins/sfwd-lms/includes/ld-reports.php:1135 [0x00007f78e9c13510] learndash_reports_get_activity() /var/www/domain.com/htdocs/wp-content/plugins/learndash-propanel/includes/class-ld-propanel-progress-chart.php:234 [0x00007f78e9c133b0] get_status_breakdown() /var/www/domain.com/htdocs/wp-content/plugins/learndash-propanel/includes/class-ld-propanel-progress-chart.php:193 [0x00007f78e9c13300] get_progress_course_data_for_chart() /var/www/domain.com/htdocs/wp-includes/class-wp-hook.php:324 [0x00007f78e9c13220] apply_filters() /var/www/domain.com/htdocs/wp-includes/class-wp-hook.php:348 [0x00007f78e9c131b0] do_action() /var/www/domain.com/htdocs/wp-includes/plugin.php:517 [0x00007f78e9c130d0] do_action() /var/www/domain.com/htdocs/wp-admin/admin-ajax.php:192 MySQL Slow Log # Time: 240807 2:20:26 # User@Host: wp_db[wp_db] @ localhost [] # Thread_id: 853 Schema: wp_db QC_hit: No # Query_time: 10.803632 Lock_time: 0.000072 Rows_sent: 2142791 Rows_examined: 4385188 #…
Protecting Your Events Calendar: Combatting Scraping Bots and Resource Drains
Introduction I’ve had numerous clients contact me about their servers having memory and CPU issues. Upon further investigation, the issue seems to be bot’s scraping the Event’s Calendar pages, and following all of the links within the page. Now, this wouldn’t be a problem for a site that has caching and regular pages, as the pages would be cached and the data returned without breaking a sweat as PHP is never involved. Unfortunately with The Events Calendar, the links being scraped contain query strings and these aren’t natively cached. Furthermore, the bot’s are going through pagination and any links they…
Over 500,000 Transients from transient_wc_product_loop and transient_timeout_wc_product_loop in wp_options table
Issue It was pretty wild to see 500,000 rows in the wp_options table, so I had to take a moment to take it all in. Then I decided to dig a bit further, and that’s when I found the following transients were taking up much of the rows in the wp_options table. transient_timeout_wc_product_loop transient_wc_product_loop Resolution After a little bit of googling, I found this issue on the WooCommerce Github project. Transient Recreating [wc_product_loop] forces crashing WC · Issue #26678 · woocommerce/woocommerce · GitHubDescription of the Bug Two transients are produced everytime a filter is clicked on the product page. I…
High Memory Usage and Swap Issues When Restarting Redis
You might receive false positives from your monitor software (monit, netdata) about about redis taking up double the amount of memory it has been configured with. Or in-general you server might be dipping into swap memory. [EST Jan 9 14:25:01] warning : ‘redis-server’ total mem amount of 3.3 GB matches resource limit [total mem amount > 1.7 GB] Looking further reveals that two redis-server processes are spawned at some point. Digging further it looks like when Redis is saving to rdb it’s spawning a second process which stays alive enough for monit to complain. 311844:M 09 Jan 2023 14:25:00.019 *…
Dealing with Redirect Loop or Wrong Site Redirect with Cloudflare
Introduction From time to time, you might find yourself in a place where you have added a new site to your server, and it’s stuck in a redirect loop or redirecting to another domain on your server. Cloudflare “SSL/TLS encryption mode” setting When adding a new domain to Cloudflare, it needs to generate an SSL Certificate and set a default method for how it will reach your new site. There is a setting for how Cloudflare will connect to your site, it’s the “SSL/TLS encryption mode” setting and will usually be set to Flexiable. As shown below Here’s the definition…
Google Cloud and Hetzner Connectivity Issues (GridPane Specifics)
Attention This article was written on 03-27-2024, the issue is now resolved. Why can’t Google Cloud reach my Hetzner Server? At this time it’s unknown, it has been suggested that this is related to a Google Cloud blacklist. It hasn’t been confirmed from Google Cloud specifically. What’s the actual issue? Traffic from Google Cloud fails to some Hetzner IP addresses fails, the following has been confirmed. Not all Hetzner IP’s are affected, only a select few within their 5.161.0.0/16 netblock. The issue was confirmed using Google Cloud network range 35.224.0.0/12 Traffic leaves Google Cloud and reaches Hetzner. Traffic from Hetzner…
Question – DNS CNAME’s, CNAME Flattening, and Cloudflare How does it work?
Question This question was on Facebook, and it’s needed a blog post 🙂 This is about CNAME flattening and references this Gridpane KB. https://gridpane.com/kb/dns-management-and-cnames/ This question is not GP specific so thought to try here instead of the GP forum. In the example given above, CNAME at the client DNS ultimately points to clientname.yourdomain.com. This makes sense and works. Now I want to set this up for a subdomain. To get a subdomain (ie.subdomain.clientdomain.com) to point to a GP server, is this the way to set things up? At client DNS, setup CNAME = subdomain and point it to clientname.yourdomain.com…
Get the size of a Single MySQL Database or All MySQL Database Sizes on a Server
Getting Single MySQL Database Size This is the command I use to get a single database size in MySQL: replace <DATABASE_NAME> with the database you wish to check. mysql -e “SELECT table_schema AS \”Database\”, ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS \”Size (MB)\” FROM information_schema.TABLES WHERE table_schema = \”<DATABASE_NAME>\” GROUP BY table_schema;” Getting Entire Server MySQL Database Size The following command will provide you with a list of databases and their sizes as well as a total. mysql -e ” SELECT * FROM ( SELECT table_schema AS ‘Database’, ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS ‘Size…