cedaro / satispress

Expose installed WordPress plugins and themes as Composer packages.
500 stars 48 forks source link

Fatal error: Uncaught SatisPress\Exception\HttpException: Forbidden resource requested #132

Closed juliennicouleaud closed 3 years ago

juliennicouleaud commented 3 years ago

Hi,

I have a fatal error, can't find where it's coming from... It worked fine locally though :(

When requesting this page : https://mywebsite/?satispress_route=composer (I've disabled the "nice" permalinks temporarily while debugging) I get this error : `Fatal error: Uncaught SatisPress\Exception\HttpException: Forbidden resource requested; User: 0; URI: /?satispress_route=composer in /var/www/satispress/wp-content/plugins/satispress/src/Exception/HttpException.php:71 Stack trace: #0 /var/www/satispress/wp-content/plugins/satispress/src/Route/Composer.php(67): SatisPress\Exception\HttpException::forForbiddenResource() #1 /var/www/satispress/wp-content/plugins/satispress/src/Provider/RequestHandler.php(90): SatisPress\Route\Composer->handle(Object(SatisPress\HTTP\Request)) #2 /var/www/satispress/wp-includes/class-wp-hook.php(287): SatisPress\Provider\RequestHandler->dispatch(Object(WP)) #3 /var/www/satispress/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array) #4 /var/www/satispress/wp-includes/plugin.php(544): WP_Hook->do_action(Array) #5 /var/www/satispress/wp-includes/class-wp.php(388): do_action_ref_array('parse_request', Array) #6 /var/www/satispress in /var/www/satispress/wp-content/plugins/satispress/src/Exception/HttpException.php on line 71

There has been a critical error on your website.`

I have PHP 7.3 on both environments, the same apache modules enabled, and the same list of plugins installed. I've checked the permissions, and they should be fine: sudo find . -type d -exec chmod 755 {} \; sudo find . -type f -exec chmod 644 {} \;

Anyone has an idea where the problem comes from?

Thank you !

patrick-leb commented 3 years ago

Just a bit of rubber duck debugging, you don't have a firewall rule in place that might prevent the 2 from communicating?

juliennicouleaud commented 3 years ago

I'll check it out, thanks!

bradyvercher commented 3 years ago

@juliennicouleaud If you haven't worked this out, I think what may happening is that you're logged in as a user that doesn't have permission to view packages, you didn't provide an API key, and you have WP_DEBUG enabled.

If you disabled WP_DEBUG, you should see an error messages saying that you don't have permission to view that resource. Otherwise, if you have permission or provide a valid API key, you'll see the listing.

Let me know if that doesn't help or if you found a different way to resolve it.