Roots Discourse

Bedrock + Sage Error 500 referencing WooCommerce

Hi guys,

Some urls of my website returns error 500 it’s a very strange behavior why error is about woocommerce but the url’s i’m trying to access is posts.

See the logs please:

2021/01/21 19:18:23 [error] 11665#11665: *596 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Argument 1 passed to App\wc_template_loader() must be of the type string, null given, called in /var/www/dev/releases/23/web/wp/wp-includes/class-wp-hook.php on line 287 in /var/www/dev/releases/23/web/app/themes/frc2020/vendor/roots/sage-woocommerce/src/woocommerce.php:13
Stack trace:
#0 /var/www/dev/releases/23/web/wp/wp-includes/class-wp-hook.php(287): App\wc_template_loader(NULL)
#1 /var/www/dev/releases/23/web/wp/wp-includes/plugin.php(212): WP_Hook->apply_filters(NULL, Array)
#2 /var/www/dev/releases/23/web/wp/wp-includes/comment-template.php(1551): apply_filters('comments_templa...', '/var/www/dev/re...')
#3 /var/www/uploads/cache/7d66ed6370f3f86aea0cd9a544729244f9cd6075.php(20): comments_template()
#4 /var/www/dev/releases/23/web/app/themes/frc2020/vendor/illuminate/view/Engines/PhpEngine.php(43): include('/var/www/upload...')
#5 /var/www/dev/releases/23/web/app/themes/frc2020/vendor/illuminate/view/Engi" while reading response header from upstream, client: 45.167.152.154, server: dev.fraternidaderosacruz.com.br, request: "GET /poesia-para-alem-do-si/ HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "dev.fraternidaderosacruz.com.br", referrer: "http://dev.fraternidaderosacruz.com.br/"

Thank’s for any help

It’s permission issue with your server. You have to look into your server configuration.

Which hosting service are you using?

I am using digital ocean my dev/ folder have recursively permission 755

You have to configure your server file with some additional file/folder access permissions,
/etc/[nginx | apache2]/sites-available/domain

Additionally you can check this document.

The true problem was comments_template() in partials/content-single.blade.php

I commented this line because I use disqus and problem is gone

Thank you for your help