nextcloud / nextcloud/server

`Cannot write into 'config' directory` misleading when an upgrade is needed

Open
#29,583 4 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop 25-feedback bug feature: install and update good first issue
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

How to use GitHub
  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.
Steps to reproduce
  1. Set up NextCloud with a read-only configuration file
  2. Set 'config_is_read_only' to true
  3. Upgrade NextCloud
Expected behaviour

The upgrade should be successful when no changes to the configuration file are necessary. Otherwise, there should be a message stating that the upgrade cannot be performed with a read-only configuration.

Actual behaviour

Currently, the message shown is

Cannot write into "config" directory! This can usually be fixed by giving the webserver write access to the config directory.
But, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it.

However, config_is_read_only is already set to true which makes the message rather confusing. The responsible line is this condition: https://github.com/nextcloud/server/blob/v22.2.0/lib/base.php#L248

Server configuration

Operating system: Debian Buster

Web server: nginx

Database: PostgreSQL

PHP version: 7.3

Nextcloud version: currently 20.0.13, but the issue is still present in newer versions

Updated from an older Nextcloud/ownCloud or fresh install: Updated

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the condition in lib/base.php around v22.2.0 line 248 and reproduce the upgrade with config_is_read_only set to true. Trace when configuration changes are actually required; done means upgrades needing no configuration change succeed, while required changes produce a message explaining the read-only limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.