Please specify --site sitename when running bench

These recent days, when running bench command I got this notif

Please specify --site sitename

But when adding --site sitename I got this

Usage: bench  clear-website-cache [OPTIONS]
Try "bench  clear-website-cache --help" for help.

Error: no such option: --site

But the command did executed well.

Is there any change in bench that causes this?

Are you tying to execute

bench clear-website-cache --site sitename

You should be instead using

bench --site sitename clear-website-cache

But clear-cache (and some other commands) can be used globally or site-wise.
In my bench, the notif Please specify --site sitename always showed up.
And if using --site option then the notif of Error: no such option: --site.

But maybe you’re right that I put the --site option wrong.

From --help the [OPTIONS] are at the end of the command.
But in --help for bench itself the [OPTIONS] is right after bench.

bench clear-cache --help
Usage: bench  clear-cache [OPTIONS]
bench migrate --help
Usage: bench  migrate [OPTIONS]
bench --help

How about these:

bench --site sitename set-config maintenance_mode 0


bench --site sitename set-config pause_scheduler 0

and some others are also asking for --site sitename

Maybe this has something to do with this issue?

You should be able to use

bench --site all clear-cache

Yes I know this. But it doesn’t answer my question about the warning.
Even, I tried using bench manager and the Bench Manager Command shows it failed (with the same warning), but executed well.

So I actually don’t really have to be worry about the warning but it just disturbing.

Well, thank you anyway.
I will try the new Bench 5.2 which doesn’t need sudo to setup supervisor and see what happen :slight_smile: