Pulling my hair out with a strange issue in a Sage 9.0.9 theme deployed (I know, I know!) to WPE. I have several other sites running Sage themes in WPE, but none of them are running a newer version of Sage than 9.0.4. No response at all from WP… I’m at a loss to troubleshoot further.
No errors in either the WPE interface or uploads/debug.log
My CI pipeline is appears to be running exactly as intended. Compiled Blade templates end up in the root /tmp/sage-cache
Theme activates successfully, customizer options show up as I would expect
I manually loaded the vendor dir over FTP
Permissions appear fine ( templates are all rw-rw-r— )
Theme is equally busted in production and staging environments
Thanks @mmirus! I don’t think I can SSH into the staging environment to review the debug log… there’s nothing in the WPE portal error logs for staging, and nothing in the production debug log either. Yes, using php 7.2 on WPE.
I’m almost certain the hash in the compiled templates is based around an incorrect path but I can’t think of a good way to investigate.
Ah, gotcha. You can ping him on here if you think it might be related to that. Not something I’m familiar with!
Can you switch the staging site to a stock Sage 9 theme of the same version to see if that loads? I’d start with it just generating the templates on the server rather than pushing them via your CI service. If that doesn’t work, could be something different between Sage 9.0.4 and 9.0.9 (though I think I was running 9.0.9 on WPE before I migrated hosts) or a plugin. If that does work, you can add in the CI part. If it still works, it’s probably something in your theme customizations.
There are no plugins on the site at this point—I wanted to get the deployment pipeline set up before doing anything fancy, so this is pretty close to a stock 9.0.9 setup. I can absolutely test a totally untouched theme too, that’s a good idea.
CAN a Sage Theme in WPE generate templates at all? I thought there was an issue in allowing vendor scripts to write to the WPE filesystem. I just tried a quick test: I switched config/views.php to point to the normal cache location, uploads/cache. The theme does make an uploads/cache dir when I attempt to ping a URL, but it doesn’t generate any blade templates inside it. Hmm. Permissions on the uploads/cache are drwxrwxr-x, same as everything else in uploads.
Yup, I ran Sage 9 on WP Engine for a long time, and all you need to do is update the compiled path in config/view.php. Using 'compiled' => '/tmp/sage-cache' should work fine with no additional customization needed:
Once you make that change it should be able to compile your templates no problem unless something changed over the last few months since we switched.
You are absolutely right! I think my issue might have been that I was blocking the non-compiled templates in my .gitignore… once I pushed those everything snapped back to normal. When I first started using Sage9 on WPE it was impossible to load source templates at runtime but obviously that’s not the case anymore.