Error: t.$permissions id null on docker with nginx

I am setting up a Dockerized installation of Kirby 3 with Nginx and PHP-FPM (7.3). I can access the site and I could set up a user account but got this error afterwards:

Every time I try to access the /panel now, I am getting this error. But when I launch Kriby with the PHP’s built-in server, everything works as expected. As this is a rather non-descriptive error, I am a bit stuck.

On the built-in PHP server, while visiting /panel, the output is the following:

On nginx, while visiting /panel:

So, clearly Kirby is blocking the request somehow. Can anybody give me some pointers on how to get around this issue?

Thanks!

Is there any more information in your browser console?

Yes, in fact there is:

FWIW, here is my docker-compose recipe. It is fairly simple, so you can test for yourself:

# docker-compose.yml
version: "3"

services:
  web:
    image: nginx:latest
    ports:
      - "3141:3141"
    volumes:
      - .:/app
      - ./nginx.conf:/etc/nginx/conf.d/default.conf
  php:
    image: php:7.3-fpm
    volumes:
      - .:/app
      - ./log.conf:/usr/local/etc/php-fpm.d/zzz-log.conf

The Nginx configuration file:

# nginx.conf
server {
  listen 3141;
  index index.php index.html;
  server_name localhost;
  error_log  /var/log/nginx/error.log;
  access_log /var/log/nginx/access.log;
  root /app;

  location / {
    try_files $uri $uri/ /index.php;
  }

  location ~ \.php$ {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass php:9000;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
  }
}

And the logger configuration:

# log.conf
php_admin_flag[log_errors] = on
php_flag[display_errors] = off

Just create those files inside the Kirby app directory and run sudo docker-compose up.

Hm, I can’t really help with this. Let’s wait and see if someone with Docker/Nginx experience has an idea.

I had the same issue on Apache, so I suppose it is Docker+Kirby related.

@wout Have you found a way to solve this issue?

@texnixe Thanks for the follow-up. I have yet to dig deeper into the issue. I will have to do some reverse engineering to get to the bottom of it. Probably next week I can make some time and I will report back with my findings.

I have been working on this project running on the built-in PHP server. Just now, I tried the docker setup again and I am getting different errors:

image

All those errors are coming from panel/dist/js/app.js:

This is all in Firefox. When using Brave (based on Chrome), the following errors show up:

I am starting to get the feeling Kirby is not playing nice with the docker proxy. All errors seem to be related to API calls coming from Vue.js.