Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't Seem to Work on Nextcloud 23 on Local Storage / Nextcloud 24 on External Storage #2

Closed
janusn opened this issue Sep 13, 2022 · 15 comments

Comments

@janusn
Copy link

janusn commented Sep 13, 2022

Synopsis:

Folders from external storage acquired with local method is not excluded. I am not sure whether the non-external folders since I use it mainly on external storage.

Procedures performed:

  • files_excludedirs was chown'ed and chmod'ed
  • app installed and enabled
  • Settings (sorry for the ugly syntax. It is required to run inside the container)
    # sudo -u abc -s /bin/bash -c "php7 /config/www/nextcloud/occ config:app:set files_excludedirs exclude --value '[\"@eaDir\",\"#snapshot\",\".*\"]'"
    Config value exclude for app files_excludedirs set to ["@eaDir","#snapshot",".*"]
  • clean up the table oc_filecache with
    DELETE FROM oc_filecache WHERE oc_filecache.path = '@eaDir';
    DELETE FROM oc_filecache WHERE oc_filecache.path = '#snapshot';
    DELETE FROM oc_filecache WHERE oc_filecache.path LIKE '._%';

Expected result:

No folder with the name "@eadir" or "#snapshot" shows up.

Actual result:

Folders with the name "@eadir" or "#snapshot" are still visible.

Environment:

@janusn janusn changed the title It doesn't seems to work on external storage It doesn't seem to work on external storage Sep 13, 2022
@wonx
Copy link

wonx commented Sep 14, 2022

My previous test that I mentioned in nextcloud/server#26651 (comment) was also applied to an external storage and didn't work, the folders were scanned to the database.

@GuyPaddock
Copy link

@wonx Thanks for filing this! I'll do more testing on NC v24. We are also using it almost exclusively with external storage and it's working for us in v23, so I'll have to see if I can identify what's different.

@GuyPaddock
Copy link

GuyPaddock commented Oct 8, 2022

@wonx The work item for this finally came up in my sprint queue so I could take another look at this. I can confirm that this does not appear to work in NC 24 even with local storage. I am looking to see what changed between 23 and 24 here.

@GuyPaddock GuyPaddock changed the title It doesn't seem to work on external storage Doesn't Work on Nextcloud 24 Oct 8, 2022
@GuyPaddock GuyPaddock changed the title Doesn't Work on Nextcloud 24 Doesn't Seem to Work on Nextcloud 23 on Local Storage / Nextcloud 24 on External Storage Oct 8, 2022
@GuyPaddock
Copy link

I'm able to reproduce this issue on local storage in NC 23, even though it was working for me with SMB-mounted external storage in NC 23 previously.

GuyPaddock pushed a commit that referenced this issue Oct 9, 2022
This seems to be more reliable than previous ways to filter paths.
@GuyPaddock
Copy link

@janusn @wonx Can you try this new release? https://github.com/Inveniem/nextcloud-files-excludedirs/releases/tag/v1.0.1-beta

Again, this will only affect new files not files that NC already knows about, so just bear that in mind.

@wonx
Copy link

wonx commented Oct 11, 2022

I did a quick test and seems to ignore the specified folder, so, so far so good! I'll write back if I find any issues.

@janusn
Copy link
Author

janusn commented Oct 11, 2022

@GuyPaddock
I would love to help.
A question though. In case of a problem arise, could I uninstall it simply by removing the app directory to restore Nextcloud?

Thanks in advance.

@GuyPaddock
Copy link

@janusn I would recommend disabling it through the occ app:disable CLI command first, if you can.

@janusn
Copy link
Author

janusn commented Oct 12, 2022

@GuyPaddock

Sorry for the late reply. My NAS was a bit funky and it took me quite a while to get it back to work.

I can say the v.1.0.1 beta does not crash my NextCloud setup. I can log on it without an error. I cannot confirm the functionality yet as I am still cleaning up the filecache table. It takes much longer than I expect. I will report back once I have completed.

Thanks for your effort.

@wonx
Copy link

wonx commented Oct 14, 2022

From my part, it seems to be working just fine. The complete directory scan, which used to take around 45-50 minutes, lowered to less than 20 minutes after excluded a folder with tens of thousands of subfolders, so I couldn't be happier.

@janusn
Copy link
Author

janusn commented Oct 29, 2022

@GuyPaddock

Sorry for the long waiting. I have reinstalled every thing related nextcloud including swag, redis, mariadb, duckdns...

I am happy to report that after 3 days of running, the app seems to work well. Thank you.

...
A little more question though. How do I exclude any file or directory starting with a dot? I have tried "/.*" , ".*" and "*/.*" but any one of them prevented the root of docker volumes in external storage from working. strangely, the subdirectories worked fine.

for example:
with a docker-compose.yaml

version: "2.1"
services:
  nextcloud:
    image: linuxserver/nextcloud:latest
    container_name: nextcloud
    volumes:
      - /volume2/docker/nextcloud/config:/config
      - /volume2/nextcloud/data:/data
      - /volume2/Media:/mnt/media
    restart: unless-stopped

and settings of
$ php /config/www/nextcloud/occ config:app:set files_excludedirs exclude --value '["/.*"]'
The occ is located there on the container linuxserver/nextcloud image.

An external storage to /mnt/media via local method throw an error and cannot be opened on nextcloud.
But an external storage to /mnt/media/bin via local method works totally fine.

@GuyPaddock
Copy link

@janusn Wonderful!

Can you open a separate issue for your question? I'm actually not 100% sure of the answer since I did not write the original globbing support; I just fixed it up for this version. But if we have a separate issue for it someone else may be able to chime in before I find out :)

@janusn
Copy link
Author

janusn commented Nov 11, 2022

@GuyPaddock I have created #3 as requested.

Furthermore, I filed another bug #4 as well.

Thanks a ton for this wonderful app!

@rightsaidfred99
Copy link

I can confirm this bug exists still with 24.
Screenshot 2023-01-11 at 16 53 38
Screenshot 2023-01-11 at 16 53 49

@rightsaidfred99
Copy link

On new folders, @eadir pops up 100% of the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants