kirby-git icon indicating copy to clipboard operation
kirby-git copied to clipboard

500 error when visiting plugin page in panel

Open ericpedia opened this issue 2 years ago • 1 comments

First off, I'm very excited about the plugin. Thank you for building it! It's so well thought out, and I can't wait to start using it.

Issue: When I visit the plugin page (/panel/git), console shows two 500 errors on the API requests, resulting in a non-working page showing an empty dialog (see screenshots).

About my installation:

  • Kirby 3.6.2
  • PHP 8.1.3
  • HTTPS: off (running on localhost)
  • Debugging: On (error also occurs when debugging is off)
  • Plugins: Only oblik/git (installed via composer)
  • No custom config settings for plugin
  • Git repo/branches set up as outlined in docs, using system git on MacOS

This is the error response when I visit the API routes directly:

{"status":"error","message":"Unauthenticated","code":403,"exception":"Kirby\\Exception\\PermissionException","key":"error.permission","file":"\/kirby\/config\/api\/authentication.php","line":14,"details":[],"route":"git\/status"}

Any advice?

image image

ericpedia avatar Mar 21 '22 23:03 ericpedia

You get the "Unauthenticated" error when you visit the routes directly because you need to pass in a CSRF token along with the request, so that's expected to not work.

I have a website running with almost the same versions:

  • Kirby 3.6.2
  • PHP 8.0.13

Maybe there was a breaking change in PHP 8.1.*? I don't have time at the moment to switch PHP versions and test.

You could use Xdebug and configure it to stop when it encounters and exception (which is what's happening, judging by your second screenshot). Maybe then, you could find where that exception is thrown.

hdodov avatar Mar 22 '22 08:03 hdodov