LAMP CentOS (CPanel) PHP-FPM PHP 7.3 Wordpress 6.2.2 Civi version: civicrm-5.62.1-wordpress "the_website" = redaction from the actual user + website :)
I keep running into this problem ever since we upgraded the last two times. The last time I upgraded was because of this same error. It works for a while then breaks seemingly for no reason! Can I disable this api4 security check? It's crashing the site constantly! I had upgraded the site to PHP 8.1 but CIVI was using some kind of mail tracking header for "no_reply@the_website.net" to some kind of GUID_tracker@the_website.net", so I back rev'd to PHP 7.3 and that fixed the odd email problem. Then it started crashing the site for no reason.
Error:
thrown in /home/the_website/civi.the_website.net/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php on line 232 [23-Jun-2023 06:02:15 UTC] PHP Fatal error: Uncaught CRM_Core_Exception: [unauthorized: Authorization failed
My cron is killed that does an api call to send mail and when I tried to run the flush cache command manually just to see what it does, it also fails.
[~/civi.the_website.net/wp-content/plugins/civicrm/wp-cli]# /opt/cpanel/ea-php73/root/usr/bin/php ~/civi.the_website.net/wp-content/plugins/civicrm/wp-cli/cv.phar flush --cwd=/home/the_website/civi.the_website.net/
In Kernel.php line 232:
Authorization failed
flush [-T|--triggers] [--level LEVEL] [--hostname HOSTNAME] [-t|--test] [-U|--user USER]
^ I also tried it with the "admin" user flag, same results
Again, this worked fine and dandy after yesterdays upgrade and the website became usable again. Then, after some time, perhaps with some other thing running on civi in the background, it breaks at like 6am every morning like it did on Wednesday. Can someone help me to turn off these security checks until these bugs get worked out?
Here is my cron which calls the admin user but still fails: */5 * * * * /opt/cpanel/ea-php73/root/usr/bin/php ~/civi.the_website.net/wp-content/plugins/civicrm/wp-cli/cv.phar api job.process_mailing --user=admin --cwd=/home/the_website/civi.the_website.net/ > ~/civi.the_website.net/cron.log
I'm hurt'n LOL, thanks!