Bench command error, but working


As you may have seen from my other post, I am looking at 2FA.

During the setup procedure, it is required to enter the following command…

bench --site [sitename] set-config enable_two_factor_auth true

But it yields this error …
Please specify --site sitename

It yields the error regardless of what I enter as “site” …“all” , “site-name” or …nothing.

Can someone please assist with what I am doing wrong?

Point to note… even though “bench” is complaining, it does actual insert the setting
in the site_config.json file.

My version info
ERPNext: v12.26.0 (version-12)
Frappe Framework: v12.23.0 (version-12)

you can also enable it with site config file, go to sites/my-site/site-config.json and add this key
“enable_two_factor_auth”: true

thank you @PyJumper for taking the time to assist …

Yes, you are right, I can do that. Its just that… the bench command acutally did put in the
key in the site_config .json file … but despite actually completeting the command, it gave
me an error.

So, yes, I got what I wanted … but why the error ?

glad it worked for you, about the error not sure but for my experience this happen when you dont have currentsite.txt in the sites folder and/or the default site is not written in that file

Thanks @PyJumper I shall have a look.

There a know issue in bench