kirby3-janitor icon indicating copy to clipboard operation
kirby3-janitor copied to clipboard

error message "The field type "janitorButton" does not exist" on production not on local

Open vauvarin opened this issue 2 years ago • 4 comments

Hi,

I use Janitor for a website and it works well on my local server but when I deploy this website on a product server, I get an error message in the panel : "The field type "janitorButton" does not exist"

Local server:

  • Caddy Server
  • PHP 8.0.12
  • Janitor 2.13.0
  • Kirby 3.6 rc4

Product server: (I use cleavr.io to manage my product server)

  • NGINX
  • PHP 8.0.0
  • Janitor 2.13.0
  • Kirby 3.6 rc4

It's like my product website can't find Janitor. Could this be due to the NGINX config file ? Maybe a missing rewrite rule for Janitor ?

This is my NGINX config file if it can help

include /etc/nginx/cleavr-conf/lhmena.k-review.com/header/*.conf;
map $http_upgrade $connection_upgrade {
  default upgrade;
}

server {

  server_name xxxxxxxxcom;
  root /home/cleavr/xxxxxxxxx/current;
  charset utf-8;
  include cleavr-conf/xxxxxxxxx/*.conf;

  # Uncomment the following line only if you don't want to enable NGINX monitoring for this site
  # access_log off;
  # Uncomment the following line if you don't have a favicon and don't want to log 404 errors
  # location = /favicon.ico { access_log off; log_not_found off; }

  # Comment the following line if you do have a physical robots.txt file
  location = /robots.txt  { access_log off; log_not_found off; }

  error_log /var/log/nginx/error.log error;
  access_log /var/log/nginx/xxxxxxxxx-access.log;
  access_log /var/log/nginx/access.log;

  location ^~ /.well-known/acme-challenge/ {
    allow all;
  }


    index index.html index.htm index.php;

    error_page 404 /index.php;

       # Media: images, icons, video, audio, HTC
    location ~* ^/(assets|media|content)/.+.(jpe?g|gif|png|webp|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
      expires off;
      access_log off;
      add_header Cache-Control "no-cache, no-store, max-age=0";
    }


    location / {
        include cleavr-conf/xxxxxxxx/*.conf.pre;
        try_files $uri $uri/ /index.php?$query_string;
        include cleavr-conf/xxxxxxxxx/*.conf.post;
    }

    location ~* /(?:uploads|files)/.*\.php$ {
        deny all;
    }

    location ~* \.(gif|jpg|jpeg|png|css|js)$ {
        expires max;
    }

    location ~ \.php$ {
        include cleavr-conf/xxxxxxxxxxx/*.conf.pre;
        # fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.0-fpm-cleavr.sock;
        # fastcgi_index index.php;
        # include fastcgi_params;
        include cleavr-conf/xxxxxxxxx/*.conf.post;
    }

    location ~ /\.ht {
        deny all;
    }

    location ~ /\. {
        deny all;
    }
}

vauvarin avatar Nov 10 '21 12:11 vauvarin

I tested to move my website (with Janitor) on another server (Lirtespeed) and it works so I thing the problem come from my Nginx configuration (missing rewrite rules ?)

vauvarin avatar Nov 11 '21 11:11 vauvarin

kirby should take care of loading the js from plugins. if its not to much hassle could you try with v2.10.1 as well? thats when i was still using parcel and not kirby up. maybe nginx has a problem with the slightly different compiled js.

bnomei avatar Nov 19 '21 22:11 bnomei

Edit 3: so I started removing the other plugins one by one, and found four that if any of them existed, caused this issue with the janitor plugin. Here's a dropbox link to the four plugins that broke it for your review. I think three of them were my practice ones.

Edit 1 & 2: figured out how to run v2.10.1, but same issue. Weird b/c I have another site on valet with v2.13 and it works fine. Both now on Kirby 3.6.1.1

@bnomei I'm having a similar issue with valet on linux. How can I composer require bnomei/kirby3-janitor to the 2.10.1 version to test?

jklue avatar Dec 09 '21 16:12 jklue

does this issue still persist since i switched from parcel to kirbyup? i can not replicate it.

bnomei avatar Apr 06 '22 12:04 bnomei