docker icon indicating copy to clipboard operation
docker copied to clipboard

External Storage - Local Storage Disappears after Pending

Open K-MTG opened this issue 8 years ago • 5 comments

I have Nextcloud running on Docker on my Mac with this docker-compose. I made a small tweak to it so I can access my external storage (external hard drive):

  app:
    build: ./app
    restart: always
    volumes:
      - nextcloud:/var/www/html
      **- /Volumes/LaCie:/Volume**
    environment:
      - [email protected]
      - [email protected]
      - [email protected]
      - MYSQL_HOST=db
    env_file:
      - db.env
    depends_on:
      - db
      - redis
    networks:
      - proxy-tier
      - default

I was able to successfully enable local storage: screen shot 2018-08-17 at 8 43 16 pm

Immediately after setting up local storage, I am able to access all of my files and the data size states pending. However, after sometime only the files I accessed remain. Hence, if I have a TV show folder and click on the show SpongeBob and select season 1. All episodes from season 1 will load and the data size will update. However, if I don't select and open the other seasons (i.e season 2,3,4) those folders will disappear from nextcloud.

I don't think this is a permission issue as Nextcloud is able to load everything during the pending state...however after the pending state...only the folders I select (during the pending state) remain.

Also, if I create a new folder with the same name name (i.e Season 2). Nextcloud will state Season 2 already exist and the folder will show up.

Appreciate any assistance.

Thanks

K-MTG avatar Aug 18 '18 03:08 K-MTG

I think this might be an issue with Cron not scanning the files. Does anyone know how to resolve? Thanks

K-MTG avatar Aug 18 '18 04:08 K-MTG

Running the command php occ files:scan --all under the user www-data appears to have done the job...all of my external storage files are showing! However, is there a better way to implement this code somewhere? I think running this script every time will use a lot of resources...is there an alternative solution?

Thanks

screen shot 2018-08-17 at 10 17 24 pm

K-MTG avatar Aug 18 '18 05:08 K-MTG

I'm encountering the same thing running nextcloud with the provided docker-compose.yml on archlinux. I added a local path to the volumes list for app:

  app:
    build: ./app
    restart: always
    volumes:
      **- /host/path/to/data:/var/www/data/share**
    ...

All files show up when I create the "local" external share, and then shortly after, disappear unless accessed. As @K-MTG discovered, running a manual scan causes the files to reappear.

host $ docker exec -it --user www-data nextcloud_app_1 /bin/sh
/var/www/html $ php ./occ files:scan --all                                           
Starting scan for user 1 out of x                                        
+---------+-------+--------------+                                                   
| Folders | Files | Elapsed time |                                                   
+---------+-------+--------------+                                                   
| x          | y      | 00:02:43   |                                                   
+---------+-------+--------------+

daygr avatar Dec 30 '18 20:12 daygr

I had the same issue and it was because i didn't map the directory on nextcloud_cron container

  nextcloud:
    image: nextcloud:fpm-alpine
    depends_on:
      - mariadb_nextcloud
    volumes:
      - nextcloud:/var/www/html
      - /docker/data:/docker/data
...
  nextcloud_cron:
    image: nextcloud:fpm-alpine
    volumes:
      - nextcloud:/var/www/html
      - /docker/data:/docker/data **<-- missing entry
    entrypoint: /cron.sh
...

After restarting both containers deleting and creating again the external storage, it worked

boulgom avatar Mar 23 '19 08:03 boulgom

I had the same issue and it was because i didn't map the directory on nextcloud_cron container

  nextcloud:
    image: nextcloud:fpm-alpine
    depends_on:
      - mariadb_nextcloud
    volumes:
      - nextcloud:/var/www/html
      - /docker/data:/docker/data
...
  nextcloud_cron:
    image: nextcloud:fpm-alpine
    volumes:
      - nextcloud:/var/www/html
      - /docker/data:/docker/data **<-- missing entry
    entrypoint: /cron.sh
...

After restarting both containers deleting and creating again the external storage, it worked

This seems to have solved the problem!!! Thanks

K-MTG avatar Apr 06 '19 06:04 K-MTG