18.0.4.2 - Unable to upgrade after docker-compose pull
Hi team, Please help me with the issue of updating.
I am preparing "developer-mode" environment for my Nextcloud.
For brief installed version 18.0.3.0 and initializing from scratch I got working compose file. Since I run docker-compose pull my Nextcloud cannot initialize into a newer version, additionally It was my first pull on that compose file.
Using partially this docker-compose.yml:
version: '3'
services:
nextcloud:
container_name: nextcloud
image: nextcloud:stable-fpm
restart: always
links:
- mariadb:db
user: www-data
expose:
- 'xxx'
- 'xxy'
- 'xyz'
volumes:
- ./config:/var/www/html/config
- ./data:/var/www/html/data
- ./shared:/var/www/html/shared
- app_data:/var/www/html
environment:
- TZ=${TZs}
Scenario:
docker-compose down- successdocker-compose pull- success 3a.docker-compose up- error inside Nextcloud container error (see logs below) 3b.docker-compose up --force-recreate nextcloud- error inside Nextcloud container error (see logs below)
Expected behaviour: Step Ad. 3a or 3b should be passed without internal nextcloud errors.
LOGS:
docker-compose up --force-recreate nextcloud
Recreating d-4-mariadb ... done
Recreating d-4-nextcloud ... done
Attaching to d-4-nextcloud
nextcloud | Initializing nextcloud 18.0.4.2 ...
nextcloud | Upgrading nextcloud from 18.0.3.0 ...
nextcloud | rsync: delete_file: rmdir(shared) failed: Device or resource busy (16)
nextcloud | rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1207) [sender=3.1.3]
without force flag is the same.
I want to use of www-data user because my docker is running on Debian based Linux distribution. I have also tried to: a. delete shared directory b1. chown www-data:www-data (as before pull operation) b2. chown root:root (... no comment, but tried, these catalogs are created after very first run under root priv) c. chmod 777 (... no comment, but tried) d. restart machine e. kill all docker processes f. restart docker service and socket
Every try gave me the same result. I do not know what to do to getting new updates by docker-compose pull instead fully clean, re-initialiaze firsttime entrypoint and restore db, configs... etc.
When I let shared to be inside nextcloud container, everything is fine, but I really need have this catalog isolated. If it could help I configure my docker to use memory on mounted drive, but it's mounted correctly as usual.
Docker and system without updates, hardware without issues, working as usual but this rsync.
Do You have any ideas?
hello, since 17 version we have this problem, for resolve this only check this steps:
chmod 0777 data chown root:root data try to refresh your webpage if you can see the webpage WITH errors it's normal, you need revert the permissions:
rollback to 0770 data rollback chown www-data:www-data data
let me know if you need more help.
regards
@rene-gomez
Hello
I have the permission problem 0770, when I'm uploading my container
commands
docker network create nextcloud-services
docker run -d --network nextcloud-services --name MYSQL_NEXTCLOUD -v /mnt/hdpreto/docker/nextcloud/app/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=1234567890 mysql:5.7
docker exec -it MYSQL_NEXTCLOUD bash
mysql -p
CREATE DATABASE nextcloud; CREATE USER nextcloud IDENTIFIED BY '1234567890'; GRANT ALL PRIVILEGES ON nextcloud.* TO nextcloud; FLUSH PRIVILEGES;
docker run -d --network nextcloud-services --name NEXTCLOUD --link mysql:mysql -p 8000:80 -v /mnt/hdpreto/docker/nextcloud/app/data:/var/www/html/data -v /mnt/hdpreto/docker/nextcloud/app/config:/var/www/html/config nextcloud
When i run this it gives me the permission problem 0770
When I run the command below it works normally.
docker network create nextcloud-services
docker run -d --network nextcloud-services --name MYSQL_NEXTCLOUD -v /root/mnt/hdpreto/docker/nextcloud/app/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=1234567890 mysql:5.7
docker exec -it MYSQL_NEXTCLOUD bash
mysql -p
CREATE DATABASE nextcloud; CREATE USER nextcloud IDENTIFIED BY '1234567890'; GRANT ALL PRIVILEGES ON nextcloud.* TO nextcloud; FLUSH PRIVILEGES;
docker run -d --network nextcloud-services --name NEXTCLOUD --link mysql:mysql -p 8000:80 -v /root/mnt/hdpreto/docker/nextcloud/app/data:/var/www/html/data -v /root/mnt/hdpreto/docker/nextcloud/app/config:/var/www/html/config nextcloud
However it creates a path that is not inside the external HD.
Thanks.
- ./shared:/var/www/html/shared
@kamilr - What is shared? That's not part of Nextcloud. The reason it's failing it looks like is because during an upgrade the /var/www/html directory gets cleared out... You have two options:
- add
sharedto yourupgrade.excludefile (see https://github.com/nextcloud/docker/#persistent-data for details) - move
sharedoutside of/var/www/htmlentirely