bnomei / kirby3-janitor

Kirby Plugin for running commands like cleaning the cache from within the Panel, PHP code, CLI or a cronjob
https://forum.getkirby.com/t/kirby3-janitor-plugin/23573
MIT License
89 stars 8 forks source link

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

Closed vauvarin closed 1 year ago

vauvarin commented 3 years ago

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:

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

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 commented 3 years ago

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 ?)

bnomei commented 3 years ago

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.

jklue commented 2 years ago

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?

bnomei commented 2 years ago

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