Internal Server Error on panel reload

I can log in to the panel (version 3.0.1) without problems. Click around, change stuff, anything. But when I reload or press CMD + R in the panel, there’s an Internal Server Error. I have to open the frontend, and then open the panel again to get it to work. It even keeps me logged in.

Looking at my error logs I can see this:

Request exceeded the limit of 10 internal redirects due to probable configuration error.

If I understand it correctly, there are over 10 internal redirects which throws an error.
How can I debug this? Anyone else with a similar issue?

EDIT: Seems like it’s not because of the reload. Everytime I type something like /panel/site or /panel/users or even just /panel/ in the address bar it throws the error. It only works when going to /panel and navigating via links. Strange error.

EDIT 2: After re-uploading everything it suddenly works. No idea what went wrong.

I have the exact same issue with v3.1.3, with same error log message, even in local mode. Re-uploading everything doesn’t solve anything… Any idea? :thinking:

Hi, i’ve the same issue with Kirby 3.2.3.

Login in panel works, playing around in panel also. But a hard refresh throws this error. I’ve to change the url in the browser from https://my-domain.tld/panel/site to https://my-domain.tld/panel (without last slug and without trailing slash) to reload the panel.

Installed with composer, webserver is Apache 2.4.38 and PHP 7.2.21 with FPM.

Played around with composer.json, .htaccess, file and directory rights and index.php with no success…
I’ll install kirby and plugins not in root directory, also content and site.

My composer.json:

{
    "name": "huaba.net/feilnbacher-kaffeeschule.de",
    "description": "Webseite der Feilnbacher Kaffeeschule mit Kursen, Terminen und Anmeldung auf Basis von Kirby CMS",
    "require": {
      "getkirby/cms": "^3.0",
      "bnomei/kirby3-security-headers": "^1.1",
      "omz13/kirby3-xmlsitemap": "^1.2",
      "bnomei/kirby3-robots-txt": "^1.4",
      "pedroborges/kirby-meta-tags": "^2.0",
      "schnti/cookie": "^0.1.1"
    },
    "config": {
      "optimize-autoloader": true
    },
    "extra": {
      "kirby-cms-path": "kirby",
      "kirby-plugin-path": "plugins"
    }
}

My index.php:

<?php

include '../kirby/bootstrap.php';

$kirby = new Kirby([
    'roots' => [
        'index'   => __DIR__,
        'content' => __DIR__ . '/../content',
        'site'    => __DIR__ . '/../site',
    ],
]);

echo $kirby->render();

… and my .htaccess:

# rewrite rules
<IfModule mod_rewrite.c>

    # enable awesome urls.
    RewriteEngine on

    # set the RewriteBase to:
    RewriteBase /

    # block files and folders beginning with a dot, such as .git
    # except for the .well-known folder, which is used for Let's Encrypt and security.txt
    RewriteRule (^|/)\.(?!well-known\/) index.php [L]

    # block text files in the content folder from being accessed directly
    RewriteRule ^content/(.*)\.(txt|md|mdown)$ index.php [L]

    # block all files in the site folder from being accessed directly
    # except for requests to plugin assets files
    RewriteRule ^site/(.*) index.php [L]

    # Enable authentication header
    SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

    # block direct access to kirby and the panel sources
    RewriteRule ^kirby/(.*) index.php [L]

    # make site links work
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*) index.php [L]

</IfModule>

# compress text file responses
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE text/javascript
    AddOutputFilterByType DEFLATE application/json
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>

Any ideas? Because it’s an annoying error when developing a new site…

Greets,
Huaba

@huaba Does this also happen if you disable all plugins?

Yes, same error without any plugin.

Now i’ve tried to remove the document root from my subfolder “public” to the project directory (used this from the getkirby.com repository) and use the default .htaccess and index.php - and this works. But it would be nice to have only assets and index.php in the webserver document root.

I recreated the setup for testing with just a very basic setup and do not get this error when reloading the Panel.

Is that .htaccess file the unmodified default version?

Are you using any custom code apart from the pluguins anywhere? Link routes or something in your config?

Looks like the site runs in a subfolder of the main domain? Or is this a leftover from development in the composer file?

But if I open the final domain, there seems to be an error anyway… (“The page is currently offline due to an unexpected error”)

The .htaccess and the index.php is from https://github.com/getkirby/getkirby.com/tree/master/www

There’s no custom code in it - fresh site, started development this day.

The site runs not in the subfolder. The webserver document root points to the “public” folder in my project. “kirby” and “plugins” are in separate folders (see composer.json).

And the error is in my local development environent (ubuntu). The domain on the production server contains no actual data and is not promoted at the moment and have no content…

Your folder structure then looks quite like this, then, right?

And the frontend is working fine, and you can make changes in the Panel and save and all that stuff as long as you do not reload?

Exactly.
All works fine (frontend and panel), only hard reloading the panel (STRG-Shift-R) doesn’t work. Always have to change the url to domain.tld/panel

It seems that some redirects won’t working correctly.

Is this working in your setup?

Thx for your support.

I’m on a Mac (using Valet as my dev env) and don’t have STRG-Shift-R, but if I press the equivalent Cmd+Alt+E then 'Cmd+R`, the Panel keeps working. So I have no chance of debugging this.

Do you get any errors in your console? Does this happen in all browsers? Does this also happen with a standard setup?