Panel login - Too many redirects

Had the same problem, the installation worked with debug: true but not debug: false.

I manually “bisected” the kirby code until I’ve found what made it work with debug: true:

Quoting https://github.com/getkirby/kirby/blob/master/kirby/registry/field.php#L40:

  public function set($name, $root, $automatic = false) {
    
    $name = strtolower($name);
    $file = $root . DS . $name . '.php';
    if(!$this->kirby->option('debug') || (is_dir($root) && is_file($file))) {
      return static::$fields[$name] = new Obj([
        'root'  => $root,
        'file'  => $file,
        'name'  => $name,
        'class' => $name . 'field',
      ]);
    } 
    if(!$automatic) throw new Exception('The field does not exist at the specified path: ' . $root);
  }

You can see there that if debug is set to false, it enters the if statement in all cases (even when (is_dir($root) && is_file($file)) evaluates to false. So I investigated my installation and found that I had an empty folder in site/fields, so kirby effectively ignored the is_dir and is_file checks and tried to load an inexisting “field”.

I guess the same would happen with empty plugin folders and similar…

PS: the problem was that someone cloned a “field” from github into the site, then tried to add and commit that field to our site repository, but obviously git ignores “repos inside other repos” and therefore just left an empty folder instead…

Usually, a correctly configured server would have the display errors option set to false in php.ini (if not, change your php.ini, so you would not need to set it to false on the production server. Rather, it would make more sense to use a local config file with debug set to ‘true’ for local development.

If anyone is still coming here with this problem; as @rasteiner said, empty folders could be a problem. I forgot to update my git submodules and the .logins file was missing from /site/accounts but no errors could be produced with debug enabled.

I just started getting this issue after setting SSL in the config.php…What do you mean by empty folders?