Status code should be 500 on error #6893
Copy link
Copy link
Closed
Labels
buggood first issueSmall tasks with clear documentation about how and in which place you need to fix things in.Small tasks with clear documentation about how and in which place you need to fix things in.
Milestone
Description
Steps to reproduce
- Make config file write protected
- Visit Nextcloud main page
Expected behaviour
The server should return status code 500 to alert standard monitoring systems. (Or ignore, that the config is not writeable)
Actual behaviour
The server returns status code 200
Server configuration
Operating system:
Debian
Web server:
Apache 2
Database:
Postgresql
PHP version:
5.6
Nextcloud version: (see Nextcloud admin page)
12
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
buggood first issueSmall tasks with clear documentation about how and in which place you need to fix things in.Small tasks with clear documentation about how and in which place you need to fix things in.
Activity
Morikko commentedon Oct 27, 2017
I can take this issue.
Morikko commentedon Oct 27, 2017
The function OC_Util::checkServer that arrives after checkConfig also tracks if config is writable.
Is it necessary to have those two checks ?
Should I do a unit test for checking the header status ? If yes, in which test file should I add it ?
sophie-h commentedon Oct 31, 2017
I think it is completely sufficient to have an error when changing the configuration fails. I don't know if a proper handling in this case already exists.
Having php files non-writable is a sane security decision for me. However, if writable config files are recommended, this information would fit into the "Admin" –> "Security & setup warnings" section.
tflidd commentedon Nov 5, 2017
There is even an option for the config file in case the config file is read only:
https://github.com/nextcloud/server/blob/master/config/config.sample.php#L648-L658
I would prefer this option as well. Tell user to either set the option "read-only" in the config file or make it writable. Most people are quite responsive to messages in
Security & setup warnings. A 500 status code error will trigger many users to end up with a broken setup and they will complain that the update procedure broke their system.Morikko commentedon Nov 17, 2017
Notes:
Questions:
Change status code when config is write protected
Change status code when config is write protected
MorrisJobke commentedon Jun 26, 2018
This one is fixed in #9995 - inspired by @Morikko
And @Morikko's PR was in #7205 - rebased as #9996