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

OCC Setting an array Configuration Value fails #22131

Closed
sporokh opened this issue Feb 4, 2016 · 15 comments
Closed

OCC Setting an array Configuration Value fails #22131

sporokh opened this issue Feb 4, 2016 · 15 comments
Assignees

Comments

@sporokh
Copy link

sporokh commented Feb 4, 2016

From the official document:
https://doc.owncloud.org/server/8.2/admin_manual/configuration_server/occ_command.html

Some configurations (e.g. the trusted domain setting) are an array of data. In order to set (and also get) the value of one key, you can specify multiple config names separated by spaces:
$ sudo -u www-data php occ config:system:get trusted_domains
localhost
owncloud.local
sample.tld

To replace sample.tld with example.com trusted_domains => 2 needs to be set:
$ sudo -u www-data php occ config:system:set trusted_domains 2 --value=example.com
System config value trusted_domains => 2 set to string example.com

I got owncloud server 'version' => '8.2.2.2' up and runing. But when I try to replace trusted domains, I got this kind of exception:
sudo -u www-data php occ config:system:set trusted_domains 1 --value=example.com

[RuntimeException] Too many arguments.

@karlitschek
Copy link
Contributor

@LukasReschke can you have a look please?

@LukasReschke
Copy link
Member

Documentation lies, this has been merged with owncloud-archive/documentation#2092 and is 9.0 only.

@carlaschroder You merged this with owncloud-archive/documentation@222e44b into stable8.2. Can you double check? THX.

@LukasReschke
Copy link
Member

@sporokh This command is only available with the upcoming master release. Sorry.

See #18444

@sporokh
Copy link
Author

sporokh commented Feb 4, 2016

@LukasReschke Thanks a lot with the fast response

@carlaschroder
Copy link

Sorry, but these commands are on 8.2.2:

config
 config:app:delete                    Delete an app config value
 config:app:get                       Get an app config value
 config:app:set                       Set an app config value
 config:import                        Import a list of configs
 config:list                          List all configs
 config:system:delete                 Delete a system config value
 config:system:get                    Get a system config value
 config:system:set                    Set a system config value

It appears to be a syntax problem:

$ sudo -u www-data php occ config:system:get trusted_domains
localhost

$ sudo -u www-data php occ config:system:set trusted_domains 1 --value=example.com                       
  [RuntimeException]   
 Too many arguments.  

$ sudo -u www-data php occ config:system:set trusted_domains  --value=example.com
System config value trusted_domains set to example.com
$ sudo -u www-data php occ config:system:get trusted_domains example.com

So, who knows the correct syntax?

@sporokh
Copy link
Author

sporokh commented Feb 4, 2016

@carlaschroder
When you doing this
sudo -u www-data php occ config:system:set trusted_domains --value=example.com
you inserting trusted_domains like a string, not like an array. Just to point it out.
So how to insert array argument correctly?

@LukasReschke
Copy link
Member

Sorry, but these commands are on 8.2.2:

The commands itself: Yes. But only for strings, any other data type modification is only available in master.

So "Setting an array Configuration Value" is only applicable for 9.0

@LukasReschke
Copy link
Member

The syntax itself will be correct on 9.0:

➜ master git:(master) ✗ ./occ config:system:set trusted_domains 1 --value=example.com
System config value trusted_domains => 1 set to string example.com

@carlaschroder
Copy link

Thanks @LukasReschke

@carlaschroder
Copy link

Is there any chance of adding a helpful error or help message to 8.2? The commands are there, with no indication that they're not going to work as expected.

@carlaschroder
Copy link

Of course I will add a doc note.

@carlaschroder
Copy link

This is getting weirder. When I run config:system:set for trusted_domains or maintenance, and then try to open the Web GUI, I get errors. When I manually correct config.php I get the same errors. Does config:system:set write to some secret config file that overrides config.php? I'm opening a separate issue for all this.

@carlaschroder
Copy link

Allrightythen, fixed in docs. config:system:set does not write to config.php with correct syntax, and does not give error messages when you use wrong config values. I'll follow it in 9.0 & report any 9.0 issues that I find.

@carlaschroder
Copy link

Thanks for reporting this, @sporokh

@lock
Copy link

lock bot commented Aug 6, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants