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

Too many arguments (occ) #212

Closed
stavros-k opened this issue Dec 10, 2020 · 11 comments
Closed

Too many arguments (occ) #212

stavros-k opened this issue Dec 10, 2020 · 11 comments

Comments

@stavros-k
Copy link

stavros-k commented Dec 10, 2020

When running occ config:app:set --value="32 64 1024" previewgenerator squareSizes i get error Too many arguments
When i try to run it with only one value eg occ config:app:set --value="32" previewgenerator squareSizes It works.

occ config:app:set previewgenerator widthSizes  --value="256 384"

                                                                  
  Too many arguments, expected arguments "command" "app" "name".  
                                                                  

config:app:set [--output [OUTPUT]] [--value VALUE] [--update-only] [--] <app> <name>

Running Preview Generator 3.0.1
Nextcloud 20.0.3

@strugee
Copy link
Member

strugee commented Dec 16, 2020

Try --value "256 384" (without the =) as the help output says.

@stavros-k
Copy link
Author

Try --value "256 384" (without the =) as the help output says.

occ config:app:set --value "256 384" previewgenerator squareSizes

                                                                  
  Too many arguments, expected arguments "command" "app" "name".  
                                                                  

config:app:set [--output [OUTPUT]] [--value VALUE] [--update-only] [--] <app> <name>

Same thing :/

@gillesF78
Copy link

Same problem for me :
`root@nextcloudpi:/home/pi# occ config:app:set previewgenerator squareSizes --value '32 256'

Too many arguments, expected arguments "command" "app" "name".

config:app:set [--output [OUTPUT]] [--value VALUE] [--update-only] [--]
`

@stavros-k
Copy link
Author

Bumping.. Is this really a bug, or we doing something wrong?

@TGreeneIII
Copy link

I've been getting the same errors. When I add a comma between the values, e.g. --value="256,384", the command runs successfully. However, I don't know for sure if it's parsed correctly by the previewgenerator.

@stavros-k
Copy link
Author

I've been getting the same errors. When I add a comma between the values, e.g. --value="256,384", the command runs successfully. However, I don't know for sure if it's parsed correctly by the previewgenerator.

Tried it and after generating previews, seems to generate too many.

PS. Also have the same problem on
NC: 21b7
PrevGen: 3.1.0

@stavros-k
Copy link
Author

I'm closing this issue, seems to be a linuxserver docker specific problem, On official docker works as it should. Found a temporary solution. More info in linuxserver/docker-nextcloud#179

@yawicz
Copy link

yawicz commented Jan 29, 2021

Sorry but I actually don't think this issue is resolved. I still had the very same problem today not running on docker or linuxserver, so the suggested solution did not change anything for me.

My setup:
Raspberry Pi 4B 8GB
Ubuntu 20.10 x64
Nextcloud 20.0.5
Previewgenerator 3.1.1

Same error message as above when for example running:
sudo -u www-data ./occ config:app:set previewgenerator widthSizes --value="256 384"

Results in:
Too many arguments, expected arguments "command" "app" "name".

I also tried many suggested variants, like removing the = after value, adding a comma in between, etc.
Adding a comma for example changes the way the values are stored, thats probably why it did not work for you either, @stavros-k (and maybe double-check also on your machine, @TGreeneIII). If you run sudo -u www-data ./occ config:list afterwards, you will see that the values are then actually stored like this: "squareSizes": "32,256",, so the app will probably just ignore them / can't read them.

The solution I found (the classic):
Using single quotes instead of double quotes works. Double quotes still work for single values after the value= part. But as soon as you want to set more than one value at once, it only works with single quotes, at least for me.

So this is the working way to do it as of now for me:
sudo -u www-data ./occ config:app:set previewgenerator widthSizes --value='256 384'

Results in:
Config value widthSizes for app previewgenerator set to 256 384

So I'm not sure what exactly is the problem or what changed recently, but there must have changed something somewhere in the backend, either of Nextcloud or the Previewgenerator app.
So either this change should be reverted, or the documentation of Previewgenerator here should be updated, IMO.

Anyways, thanks for the great app and I hope I could be of help to someone who might have the same error. ;-)

EDIT Short update:
I just found out that this issue somehow did not occur on the very same machine and setup, when logging in via Putty SSH from a Windows computer. When this issue occured before and I had to use ' ' instead of " ", I was logged in via SSH in a Terminal on Mac OS.
Not fully sure how and if this is really related, but when I was using Putty passing the values worked fine using " ".

@robertpenz
Copy link

robertpenz commented Oct 31, 2021

With a shell open from a Linux system, the call works only this way

# occ config:app:set previewgenerator squareSizes --value=\"32 256\"
Config value squareSizes for app previewgenerator set to 32 256

@alexisindesign
Copy link

alexisindesign commented Feb 9, 2022

Working command:

docker exec -u root nextcloud-app runuser -u www-data -- php occ --no-warnings config:app:set --value="32 64 1024" previewgenerator squareSizes

@keesfluitman
Copy link

With a shell open from a Linux system, the call works only this way

# occ config:app:set previewgenerator squareSizes --value=\"32 256\"
Config value squareSizes for app previewgenerator set to 32 256

Why are the \ necessary? It used to work for me, but this seemed to do the trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants