Skip to content

All files are missing after pulling and updating nextcloud (version 19.0.1.1 to 19.0.2.2) #1233

Description

@baschi29

After running

docker-compose stop
docker-compose pull
docker-compose up -d

all files seem to have gone missing and it's no longer possible to upload files to nextcloud. When checking the user directories (in my case nextdata/name of user) only the cache directory is still there, everything else seems to have been deleted.

Manually recreating the file directory and running occ files:scan "fixes" the problem as in that nextcloud is usable again and recreation from backup is possible.

Calendar and everything database related works as usual. Trying to open files through the nextcloud interface throws an error: - for example:

172.18.0.2 - - [01/Sep/2020:18:12:32 +0000] "GET /core/preview?fileId=25652&c=d6a2601d4a5e929f1a272c65ad31f249&x=250&y=250&forceIcon=0 HTTP/1.1" 404 729 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0"

This happened the second time after pulling the latest nextcloud image. When not pulling I can stop and remove the container and the data is persistent. I hope somebody can help me out with this. I can reproduce this bug (or maybe misconfiguration on my site) as well to provide further logs.

My docker-compose file:

version: '3.8'

volumes:
n_vhost:
n_html:
n_dhparam:
n_certs:
p_db:
nextcloud:
redis:

networks:
nextcloud_network:

services:

nginx-proxy:
image: jwilder/nginx-proxy
container_name: nginx-proxy
restart: always
ports:
- "80:80"
- "443:443"
networks:
- nextcloud_network
volumes:
- /etc/nginx/conf.d:/etc/nginx/conf.d
- n_vhost:/etc/nginx/vhost.d
- n_html:/usr/share/nginx/html
- n_dhparam:/etc/nginx/dhparam
- n_certs:/etc/nginx/certs:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
labels:
- "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy"

letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: nginx-proxy-le
restart: unless-stopped
networks:
- nextcloud_network
volumes:
- /etc/nginx/conf.d:/etc/nginx/conf.d
- n_vhost:/etc/nginx/vhost.d
- n_html:/usr/share/nginx/html
- n_dhparam:/etc/nginx/dhparam
- n_certs:/etc/nginx/certs:rw
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- DEFAULT_EMAIL=email@example.com
depends_on:
- nginx-proxy

db:
image: postgres
container_name: db
restart: always
networks:
- nextcloud_network
volumes:
- p_db:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=password
- POSTGRES_USER=user
- POSTGRES_DB=db

nextcloud:
image: nextcloud
container_name: nextcloud
restart: always
networks:
- nextcloud_network
volumes:
- nextcloud:/var/www/html
environment:
- POSTGRES_DB=db
- POSTGRES_USER=user
- POSTGRES_PASSWORD=pasword
- POSTGRES_HOST=db
- REDIS_HOST=redis
- NEXTCLOUD_ADMIN_USER=admin
- NEXTCLOUD_ADMIN_PASSWORD=adminpasword
- NEXTCLOUD_DATA_DIR=/var/www/html/nextdata
- VIRTUAL_HOST=domain.com
- LETSENCRYPT_HOST=domain.com
- NEXTCLOUD_TRUSTED_DOMAINS= domain.com nginx-proxy
- REDIS_HOST_PASSWORD=redispasword
depends_on:
- db
- nginx-proxy
- letsencrypt
- redis

smtp:
image: namshi/smtp
container_name: smtp
restart: always
networks:
- nextcloud_network
environment:
- MAILNAME=example.com

redis:
image: redis
container_name: redis
restart: always
command: redis-server --appendonly yes --requirepass redispasword
networks:
- nextcloud_network
volumes:
- redis:/data

The nextcloud log outputs the following after the first start:

Configuring Redis as session handler
Initializing nextcloud 19.0.2.2 ...
Upgrading nextcloud from 19.0.1.1 ...
Initializing finished
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Set log level to debug
Turned on maintenance mode
Updating database schema
Updated database
Checking for update of app accessibility in appstore
Checked for update of app "accessibility" in appstore
Checking for update of app activity in appstore
Checked for update of app "activity" in appstore
Checking for update of app apporder in appstore
Checked for update of app "apporder" in appstore
Checking for update of app calendar in appstore
Checked for update of app "calendar" in appstore
Checking for update of app carnet in appstore
Checked for update of app "carnet" in appstore
Checking for update of app cloud_federation_api in appstore
Checked for update of app "cloud_federation_api" in appstore
Checking for update of app comments in appstore
Checked for update of app "comments" in appstore
Checking for update of app contacts in appstore
Checked for update of app "contacts" in appstore
Checking for update of app contactsinteraction in appstore
Checked for update of app "contactsinteraction" in appstore
Checking for update of app cookbook in appstore
Checked for update of app "cookbook" in appstore
Checking for update of app dav in appstore
Checked for update of app "dav" in appstore
Checking for update of app documentserver_community in appstore
Checked for update of app "documentserver_community" in appstore
Checking for update of app federatedfilesharing in appstore
Checked for update of app "federatedfilesharing" in appstore
Checking for update of app federation in appstore
Checked for update of app "federation" in appstore
Checking for update of app files in appstore
Checked for update of app "files" in appstore
Checking for update of app files_pdfviewer in appstore
Checked for update of app "files_pdfviewer" in appstore
Checking for update of app files_rightclick in appstore
Checked for update of app "files_rightclick" in appstore
Checking for update of app files_sharing in appstore
Checked for update of app "files_sharing" in appstore
Checking for update of app files_trashbin in appstore
Checked for update of app "files_trashbin" in appstore
Checking for update of app files_versions in appstore
Checked for update of app "files_versions" in appstore
Checking for update of app files_videoplayer in appstore
Checked for update of app "files_videoplayer" in appstore
Checking for update of app firstrunwizard in appstore
Checked for update of app "firstrunwizard" in appstore
Checking for update of app logreader in appstore
Checked for update of app "logreader" in appstore
Checking for update of app lookup_server_connector in appstore
Checked for update of app "lookup_server_connector" in appstore
Checking for update of app nextcloud_announcements in appstore
Checked for update of app "nextcloud_announcements" in appstore
Checking for update of app notifications in appstore
Checked for update of app "notifications" in appstore
Checking for update of app oauth2 in appstore
Checked for update of app "oauth2" in appstore
Checking for update of app onlyoffice in appstore
Checked for update of app "onlyoffice" in appstore
Checking for update of app password_policy in appstore
Checked for update of app "password_policy" in appstore
Checking for update of app photos in appstore
Checked for update of app "photos" in appstore
Checking for update of app polls in appstore
Checked for update of app "polls" in appstore
Checking for update of app privacy in appstore
Checked for update of app "privacy" in appstore
Checking for update of app provisioning_api in appstore
Checked for update of app "provisioning_api" in appstore
Checking for update of app recommendations in appstore
Checked for update of app "recommendations" in appstore
Checking for update of app serverinfo in appstore
Checked for update of app "serverinfo" in appstore
Checking for update of app settings in appstore
Checked for update of app "settings" in appstore
Checking for update of app sharebymail in appstore
Checked for update of app "sharebymail" in appstore
Checking for update of app support in appstore
Checked for update of app "support" in appstore
Checking for update of app survey_client in appstore
Checked for update of app "survey_client" in appstore
Checking for update of app systemtags in appstore
Checked for update of app "systemtags" in appstore
Checking for update of app tasks in appstore
Checked for update of app "tasks" in appstore
Checking for update of app text in appstore
Checked for update of app "text" in appstore
Checking for update of app theming in appstore
Checked for update of app "theming" in appstore
Checking for update of app twofactor_backupcodes in appstore
Checked for update of app "twofactor_backupcodes" in appstore
Checking for update of app twofactor_totp in appstore
Checked for update of app "twofactor_totp" in appstore
Checking for update of app updatenotification in appstore
Checked for update of app "updatenotification" in appstore
Checking for update of app viewer in appstore
Checked for update of app "viewer" in appstore
Checking for update of app workflowengine in appstore
Checked for update of app "workflowengine" in appstore
Starting code integrity check...
Finished code integrity check
Update successful
Turned off maintenance mode
Reset log level
The following apps have been disabled:

Activity

  1. baschi29 commented on Sep 1, 2020

    @baschi29
    Author

    It seems like nextcloud purges all directories other than the default data directory in the HTML root by default as I was using a custom data directory which was located in /var/www/html.

    My configuration doesn't make a lot of sense, but I would still consider this a bug as nextcloud should never delete data.

    I changed my data directory back to default. If this fixes the issue, I will report back after the next update.

  2. baschi29 commented on Sep 14, 2020

    @baschi29
    Author

    After changing the custom data directory to default, updating works as expected.

    Therefore I will close this issue and create a new one in the nextcloud repository as this seems to be a general bug not specific to the docker image.

    See: nextcloud/server#22848

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions