Repository navigation
On upgrade: Warning: /var/www/html/config/….config.php differs from the latest version of this image at /usr/src/nextcloud/config/….config.php #2266
Copy link
Copy link
Closed as not planned
Description
When upgrading from Nextcloud 28 to Nextcloud 29 I got these warnings. As they relate to stuff inside of the image and no plugins or configs, which are thought to be adjusted, I thought this might be wrong (or it would not be a warning, would it?):
Jul 19 01:46:44 *********** nextcloud_nc_1[16123]: Initializing finished
Jul 19 01:46:44 *********** nextcloud_nc_1[16123]: Warning: /var/www/html/config/apcu.config.php differs from the latest version of this image at /usr/src/nextcloud/config/apcu.config.php
Jul 19 01:46:44 *********** nextcloud_nc_1[16123]: Warning: /var/www/html/config/apps.config.php differs from the latest version of this image at /usr/src/nextcloud/config/apps.config.php
Jul 19 01:46:44 *********** nextcloud_nc_1[16123]: Warning: /var/www/html/config/autoconfig.php differs from the latest version of this image at /usr/src/nextcloud/config/autoconfig.php
Jul 19 01:46:44 *********** nextcloud_nc_1[16123]: Warning: /var/www/html/config/redis.config.php differs from the latest version of this image at /usr/src/nextcloud/config/redis.config.php
Jul 19 01:46:44 *********** nextcloud_nc_1[16123]: Warning: /var/www/html/config/reverse-proxy.config.php differs from the latest version of this image at /usr/src/nextcloud/config/reverse-proxy.config.php
Jul 19 01:46:44 *********** nextcloud_nc_1[16123]: Warning: /var/www/html/config/s3.config.php differs from the latest version of this image at /usr/src/nextcloud/config/s3.config.php
Jul 19 01:46:44 *********** nextcloud_nc_1[16123]: Warning: /var/www/html/config/smtp.config.php differs from the latest version of this image at /usr/src/nextcloud/config/smtp.config.php
Jul 19 01:46:44 *********** nextcloud_nc_1[16123]: Warning: /var/www/html/config/swift.config.php differs from the latest version of this image at /usr/src/nextcloud/config/swift.config.php
Jul 19 01:46:44 *********** nextcloud_nc_1[16123]: Warning: /var/www/html/config/upgrade-disable-web.config.php differs from the latest version of this image at /usr/src/nextcloud/config/upgrade-disable-web.config.php
Jul 19 01:46:44 *********** nextcloud_nc_1[16123]: => Searching for scripts (*.sh) to run, located in the folder: /docker-entrypoint-hooks.d/before-starting
Compose file (with podman-compose):
version: '3.7'
services:
caddy:
image: docker.io/caddy
restart: unless-stopped
ports:
- "1001:80"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro,z
- caddy_data:/data
- caddy_config:/config
- nc_data:/var/www/html
networks:
- caddynet
depends_on:
- nc
healthcheck:
# https://stackoverflow.com/a/47722899/5008962
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost/status.php", "||", "exit", "1"]
interval: 1m30s
timeout: 30s
retries: 3
start_period: 40s
labels:
- io.containers.autoupdate=registry
nc:
image: docker.io/nextcloud:29-fpm
restart: unless-stopped
volumes: &nextcloud_volumes
- nc_data:/var/www/html
# better tmp fs for better performance, see https://github.com/nextcloud/recognize#tmp
- type: tmpfs
target: /tmp:exec
- type: bind
source: /var/mnt/external/@/nextcloud
target: /var/mnt/userdata:z
- type: bind
source: ${HOME:?HOME variable missing}/nextcloud_config
target: /var/www/html/config:z
# workaround for php-fpm issue https://github.com/nextcloud/docker/pull/1766
- type: bind
source: ./php-fpm-config/zz-prevent-servererror-onload.conf
target: /usr/local/etc/php-fpm.d/zz-prevent-servererror-onload.conf:z
networks:
- caddynet
- redisnet
- dbnet
environment: &nextcloud_environment
- REDIS_HOST=redis
- REDIS_HOST_PASSWORD=${REDIS_HOST_PASSWORD:?REDIS_HOST_PASSWORD variable missing}
- MYSQL_HOST=db
env_file: &nextcloud_env_file
- db-shared.env
depends_on: &nextcloud_depends_on
- db
- redis
expose:
- 9000
labels:
- io.containers.autoupdate=registry
redis:
image: docker.io/redis:alpine
command: redis-server --requirepass ${REDIS_HOST_PASSWORD:?REDIS_HOST_PASSWORD variable missing}
restart: unless-stopped
networks:
- redisnet
expose:
- 6379
labels:
- io.containers.autoupdate=registry
cron:
image: docker.io/nextcloud:29-fpm
restart: unless-stopped
volumes: *nextcloud_volumes
entrypoint: /cron.sh
networks:
- redisnet
- dbnet
environment: *nextcloud_environment
env_file: *nextcloud_env_file
depends_on: *nextcloud_depends_on
labels:
- io.containers.autoupdate=registry
db:
image: docker.io/mariadb:10.6
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
restart: unless-stopped
volumes:
- db_data:/var/lib/mysql
# workaround for "Too many connections"
- type: bind
source: ./mariadb-config/increase-active-connections.cnf
target: /etc/mysql/conf.d/increase-active-connections.cnf:z
networks:
- dbnet
environment:
- MARIADB_AUTO_UPGRADE=1
- MARIADB_DISABLE_UPGRADE_BACKUP=1
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:?MYSQL_ROOT_PASSWORD variable missing}
env_file:
- db-shared.env
expose:
- 3306
labels:
- io.containers.autoupdate=registry
volumes:
db_data:
nc_data:
caddy_data:
caddy_config:
networks:
caddynet:
dbnet:
redisnet:Startup command for testing is: podman-compose -p nextcloud down&&podman-compose --in-pod=0 -p nextcloud up -d
Config
{
"system": {
"memcache.local": "\\OC\\Memcache\\Redis",
"apps_paths": [
{
"path": "\/var\/www\/html\/apps",
"url": "\/apps",
"writable": false
},
{
"path": "\/var\/www\/html\/custom_apps",
"url": "\/custom_apps",
"writable": true
}
],
# ...
"app_install_overwrite": [
"ransomware_protection",
"bookmarks_fulltextsearch",
"news"
],
"maintenance_window_start": 1
}
}Images used
$ podman ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[…]
1b9b98b17158 docker.io/library/redis:alpine redis-server --re... 18 minutes ago Up 18 minutes 6379/tcp nextcloud_redis_1
e3b3df7d8cd7 docker.io/library/mariadb:10.6 --transaction-iso... 18 minutes ago Up 18 minutes 3306/tcp nextcloud_db_1
20ca0cfb875e docker.io/library/nextcloud:29-fpm php-fpm 18 minutes ago Up 18 minutes 9000/tcp nextcloud_nc_1
e91d4a1132e1 docker.io/library/nextcloud:29-fpm 18 minutes ago Up 17 minutes 9000/tcp nextcloud_cron_1
2beaab8b3406 docker.io/library/caddy:latest caddy run --confi... 17 minutes ago Up 17 minutes (healthy) 0.0.0.0:1001->80/tcp, 80/tcp, 443/udp, 443/tcp, 2019/tcp nextcloud_caddy_1
$ podman inspect nextcloud_nc_1
[
{
"Id": "20ca0cfb875e2f068c24c50167b9b74ddc18c3dd400ae4ca7093b4f97c144f58",
"Created": "2024-07-19T01:43:08.855975341+02:00",
"Path": "/entrypoint.sh",
"Args": [
"php-fpm"
],
"State": {
"OciVersion": "1.2.0",
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 16125,
"ConmonPid": 16123,
"ExitCode": 0,
"Error": "",
"StartedAt": "2024-07-19T01:43:20.167168212+02:00",
"FinishedAt": "0001-01-01T00:00:00Z",
"CgroupPath": "/user.slice/user-1002.slice/user@1002.service/user.slice/libpod-20ca0cfb875e2f068c24c50167b9b74ddc18c3dd400ae4ca7093b4f97c144f58.scope",
"CheckpointedAt": "0001-01-01T00:00:00Z",
"RestoredAt": "0001-01-01T00:00:00Z"
},
"Image": "ef280332235c73485674637060ffbe0154d3d60a7da345114e0424dca9da15e6",
"ImageDigest": "sha256:d2dc74b2ce5fc6b06e1bf454320bb6388817757b41314a0214af4eac278a3c42",
"ImageName": "docker.io/library/nextcloud:29-fpm",
[…]System
$ podman --version
podman version 5.1.1
$ podman-compose --version
podman-compose version 1.2.0
podman version 5.1.1
$ rpm-ostree status -b
[…]
● fedora:fedora/x86_64/coreos/stable
Version: 40.20240701.3.0 (2024-07-16T16:03:29Z)
BaseCommit: 45982eca152d020f23a547813538939e9bfdcfefc8c059e88970d1bbf4ada0bb
GPGSignature: Valid signature by 115DF9AEF857853EE8445D0A0727707EA15B79CC
LayeredPackages: ***Fedora CoreOS 40
Expected result
IMHO no warnings about such a file should be issued if I am using an official container image. In such an image, I expect all files to pass the validity check for obvious reasons… this warning is thus somewhat disturbing.
Current result
Warning, see above
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
ralfi commentedon Jul 19, 2024
Same here, and upgrade scripts to 29.0.4 will not work.
ralfi commentedon Jul 19, 2024
Sorry, my mistake. Not changig to the latest image tag... Now upgrade scripts are working but warnings still appears
joshtrichards commentedon Jul 19, 2024
It's referencing your configs stored on persistent storage, not something in the image.
Docs w/ explanation: https://github.com/nextcloud/docker?tab=readme-ov-file#auto-configuration-and-nextcloud-updates
Additional references:
rugk commentedon Jul 28, 2024
Ah, would be great if the error message could link to the description or so or otherwise make it clear, that one can copy the files from the target to the source to fix this.
As I've never modified the multiple files, and I actually also, as aah… as far as I see now, I never even had copied the original files. I still have only one
config.phpfile in there, how it used to be in dunno… many, many versions ago:Is there any good upgrade migration/path/recommendation on how to split the file, apparently?
Also the JSON files are apparently created by Nextcloud or by me for some extension (OnlyOffice or Nextcloud Office maybe?):
joshtrichards commentedon Jul 30, 2024
I think we did have a link in the warning at one point during development but removed it to streamline things. Oops. 🤣
You shouldn't have to split anything. Basically just add the additional files and leave your existing
config.phpin place.Those can stay in place.
Essentially anything you have is fine. The additional files are for supporting all the documented Docker auto-configuration stuff (mostly) and a few other requirements like disabling the web updater (which is never to be used with the Docker image).
rugk commentedon Jul 31, 2024
I am unsure what streamlining would mean in that context and how removing such a link helps there, but if you want then well… re-add it?
Also the Readme says:
This is not true anymore, is it? The config PHP's always read the env via
getenv, so updates should be processed? The PHP files itself are not ovrwritten/changed, after all?[-]On upgrade warnigs about PHP files differing are issued: "Warning: /var/www/html/config/….config.php differs from the latest version of this image at /usr/src/nextcloud/config/….config.php"[/-][+]On upgrade: `Warning: /var/www/html/config/….config.php differs from the latest version of this image at /usr/src/nextcloud/config/….config.php`[/+]hufhend commentedon Aug 30, 2024
The exact same thing happened to me. I run on K8s and upgraded a few months back via helm and major release. Step by step.
A bit awkward is that in the mounted repository the files are newer (today's) than in the image.
Which is weird. However, I replaced them all on the remote server with the version from the image and it didn't help.
Error:
And it doesn't load.
hufhend commentedon Aug 30, 2024
Since I have a backup, but only a one-day backup, I deleted the files mentioned above and hoped that Nextcloud would handle it somehow. Unfortunately, it didn't. So neither overwriting the files on the server nor deleting them helped.
Worse, however, is that I'm losing track of where it actually sees the files. Somehow it doesn't make sense to me:
And beware, this is on the server:
In helm chart values there is only this and nothing has changed
hufhend commentedon Aug 30, 2024
How do I revert to an older working version?
joshtrichards commentedon Sep 8, 2024
@hufhend
You're getting 500 errors - something else is going on here for you. The warnings about older config files would not cause this from just a simple image update. To figure out why you're getting those 500 errors you'd need to check your
nextcloud.log. Either way, outside the scope of this issue. Might want to try the help forum - https://help.nextcloud.comAdd example command for copying
Add example command for copying (#2327)
marco-calautti commentedon Mar 2, 2026
I do not see why this cannot be simply solved by giving special names to the config files that the container ships with, and thus avoid completelly the chance of overwriting user config files. I find very bad that I need to perform a manual upgrade of the files, when the container should manage the upgrade on its own. At least, provide an ENV var that allows to enable the automatic upgrade of the files, for those users that need it.
J0WI commentedon Mar 4, 2026
Because Nextcloud just overrides
config.php: https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/config_sample_php_parameters.html#loadingYou can prefix any config with
NC_to override it as ENV var: https://docs.nextcloud.com/server/stable/admin_manual/occ_command.html#debuggingThis works quite good for simple data types like bools, numbers and strings but it's a mess with arrays.
marco-calautti commentedon Mar 5, 2026
From what I undestand, Nextcloud overrides config.php using the *.config.php files, and in the specific case of this docker image, these files are used exclusively to override config.php via the env variable set for the container. So, I do not see what is the problem if, during the upgrade, the container just copies back the special *.config.php that this container defines in the persistent config folder.