Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syntax error, unexpected token ")" #85

Closed
theamnesic opened this issue Sep 21, 2022 · 9 comments
Closed

syntax error, unexpected token ")" #85

theamnesic opened this issue Sep 21, 2022 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@theamnesic
Copy link

theamnesic commented Sep 21, 2022

Hi,

With Kirby 3.5.7, php 8.0.8, Janitor 2.16.2, I've got the syntax error, unexpected token ")" error alert on this tasks :

  • cleanCache
  • flushSessions
  • render
  • thumbs
  • backupZip

flushPages works.

Switching to php 7.4 give this error : syntax error, unexpected '|', expecting variable (T_VARIABLE).

Console error : GET https://mysite.com/api/plugin-janitor/cleanCache/%24 500 (Internal Server Error)

https://mysite.com/api/plugin-janitor/cleanCache/ return {"status":"error","message":"Unauthenticated","code":403,"key":"error.permission","details":[]}

Any idea?


Edit : I'm using composer to update. When I download the files via Github instead of composer update, it's working.

@saschen
Copy link

saschen commented Sep 26, 2022

Hi,
same problem with Kirby 3.6.6.1 and PHP 8.0.23-he.0

@bnomei bnomei self-assigned this Oct 11, 2022
@bnomei bnomei added the bug Something isn't working label Oct 11, 2022
@bnomei
Copy link
Owner

bnomei commented Oct 11, 2022

i need a bit more information to debug this since i can not replicate it myself.

  1. how are you calling the janitor job? panel button or CLI?
  2. is it the browser js console you are referring to? how did the GET request get triggered? via the panel button, right?
  3. if the errors are thrown, could you turn on kirbs debugging so i can get a filename and preferable line number?
  4. whats your dev setup like? osx with mamp etc...

you can not call the endpoint manually (without the setup for a secret... see wiki) thats why the auth error is thrown in that case.

@theamnesic
Copy link
Author

Hi Bruno!

how are you calling the janitor job? panel button or CLI?

By the panel button.

Capture d’écran 2022-10-12 à 19 00 21

is it the browser js console you are referring to? how did the GET request get triggered? via the panel button, right?

Yes, the browser console, via the panel button.

if the errors are thrown, could you turn on kirbs debugging so i can get a filename and preferable line number?

Hope this can help:

Capture d’écran 2022-10-12 à 18 56 05

whats your dev setup like? osx with mamp etc...

Same behavior in my local Mamp and my web hosting.

@theamnesic
Copy link
Author

Hi,

Updated to Kirby 3.8.2 and Janitor 3.2.0 installed via .zip file, error is now Class "Kirby\CLI\CLI" not found.

@bnomei
Copy link
Owner

bnomei commented Nov 30, 2022

janitor 3 needs kirby cli which can inly be installed with composer

@theamnesic
Copy link
Author

theamnesic commented Dec 1, 2022

I've just installed with composer with composer require getkirby/cli bnomei/kirby3-janitor.

Now the error is : Undefined constant "STDOUT" in all the tasks, even the flushPages.

Same error with composer require getkirby/cli installed and Janitor 3.2.0 installed via .zip file.

@bnomei
Copy link
Owner

bnomei commented Dec 1, 2022

the core commands from the cli are aimed to print to the console.

unless you run these commands with the --quiet parameter, which was recently introduced, it tries to write to the console when there is none (calling from the panel).

i created janior:flush --name pages to allow same functionallity in the panel.

see
https://github.com/bnomei/kirby3-janitor/blob/master/commands/flush.php

@bnomei
Copy link
Owner

bnomei commented Dec 1, 2022

i had brought that issue to the teams attention, the fix is easy enough, but sadly it did not make it in the most recent update.

feel free to upvote my issue there:
getkirby/cli#21

@theamnesic
Copy link
Author

Hi @bnomei!

Any news on this since CLI 1.1.0 add the New global --quiet option to suppress the output of the command?

@bnomei bnomei closed this as completed Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants