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

Do not stop directory listing when ACL is blocking access (local external storage) #28277

Closed
DD-githu opened this issue Aug 1, 2021 · 3 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug needs info stale Ticket or PR with no recent activity

Comments

@DD-githu
Copy link

DD-githu commented Aug 1, 2021

Same as
#26658
but not for "external storage | smb" but "external storage | local".

Details:
#26658 (comment)

Hi! So im on the 21.0.3 docker version, this fix was backported to - still having the issue with local-mounted external folders:
Running: docker exec --user www-data nc_dd_app_1 php occ files:scan --path="/Dominik/files/nas_Setups/Tools"
still getting a Permission denied exception:

Exception during scan: opendir(/mnt/nas_Setups/Tools/@eaDir): failed to open dir: Permission denied
#0 [internal function]: OCA\Files\Command\Scan->exceptionErrorHandler(2, 'opendir(/mnt/na...', '/var/www/html/l...', 135, Array)
#1 /var/www/html/lib/private/Files/Storage/Local.php(135): opendir('/mnt/nas_Setups...')
#2 /var/www/html/lib/private/Files/Storage/Common.php(878): OC\Files\Storage\Local->opendir('Tools/@eaDir')
#3 /var/www/html/lib/private/Files/Storage/Wrapper/PermissionsMask.php(158): OC\Files\Storage\Common->getDirectoryContent('Tools/@eaDir')
#4 [internal function]: OC\Files\Storage\Wrapper\PermissionsMask->getDirectoryContent('Tools/@eaDir')
#5 /var/www/html/lib/private/Files/Cache/Scanner.php(409): iterator_to_array(Object(Generator))
#6 /var/www/html/lib/private/Files/Cache/Scanner.php(389): OC\Files\Cache\Scanner->handleChildren('Tools/@eaDir', true, 3, 1046216, true, 0)
#7 /var/www/html/lib/private/Files/Cache/Scanner.php(392): OC\Files\Cache\Scanner->scanChildren('Tools/@eaDir', true, 3, 1046216, true)
#8 /var/www/html/lib/private/Files/Cache/Scanner.php(341): OC\Files\Cache\Scanner->scanChildren('Tools', true, 3, 864151, true)
#9 /var/www/html/lib/private/Files/Utils/Scanner.php(260): OC\Files\Cache\Scanner->scan('Tools', true, 3)
#10 /var/www/html/apps/files/lib/Command/Scan.php(158): OC\Files\Utils\Scanner->scan('/Dominik/files/...', true, NULL)
#11 /var/www/html/apps/files/lib/Command/Scan.php(214): OCA\Files\Command\Scan->scanFiles('Dominik', '/Dominik/files/...', Object(Symfony\Component\Console\Output\ConsoleOutput), false, true, false)
#12 /var/www/html/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/html/core/Command/Base.php(169): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/html/3rdparty/symfony/console/Application.php(1009): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/html/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/html/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/html/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /var/www/html/console.php(100): OC\Console\Application->run()
#19 /var/www/html/occ(11): require_once('/var/www/html/c...')
#20 {main}

ACL for the folder is user:nextcloud_docker:deny:rwxpdDaARWcCo:fd-- (level:0)

@DD-githu DD-githu added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Aug 1, 2021
@szaimen szaimen added 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Aug 8, 2021
@szaimen
Copy link
Contributor

szaimen commented Aug 8, 2021

I suppose this is still happening on NC21.0.4?

@ghost
Copy link

ghost commented Sep 7, 2021

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

@ghost ghost added the stale Ticket or PR with no recent activity label Sep 7, 2021
@ghost ghost closed this as completed Sep 21, 2021
@alanswanson
Copy link

Having the same problem with a local external storage provided read only to all users.

Noticed that it NC stopped updating any file additions/removals to the local external storage shortly after updating from 21.0.4 to 21.0.5 but soon after had also changed the local external storage from an ext4 filesystem mountpoint to an overlayfs lowerdirs only mountpoint (a merged JBOD with the original ext4 filesystem).

Running occ files:scan shows it flaking at a permission denied with the "lost+found" directory. Since "lost+found" directories permission have always been root 700 not sure why it started failing when it was scanning fine before. The overlayfs doesn't cause any user visible changes and I can't see anything specific in 21.0.5. Very odd...

As a workaround I've added "lost+found" to the isIgnoredDir list in lib/private/Files/Filesystem.php file but for external storage all permission failures should be a warning and carry on, not an exception and stop.

$ php occ -vvv files:scan --all
Starting scan for user 1 out of 5 (admin)
        Folder  /admin/
        Folder  /admin/cache
        Folder  /admin/files
        Folder  /admin/files/Media/
        Folder  /admin/files/Media/lost+found/
Exception during scan: opendir(/usr/local/media/lost+found): failed to open dir: Permission denied
#0 [internal function]: OCA\Files\Command\Scan->exceptionErrorHandler()
#1 /var/www/localhost/htdocs/cloud/lib/private/Files/Storage/Local.php(135): opendir()
#2 /var/www/localhost/htdocs/cloud/lib/private/Files/Storage/Common.php(878): OC\Files\Storage\Local->opendir()
#3 /var/www/localhost/htdocs/cloud/lib/private/Files/Storage/Wrapper/PermissionsMask.php(158): OC\Files\Storage\Common->getDirectoryContent()
#4 /var/www/localhost/htdocs/cloud/lib/private/Files/Storage/Wrapper/PermissionsMask.php(158): OC\Files\Storage\Wrapper\PermissionsMask->getDirectoryContent()
#5 [internal function]: OC\Files\Storage\Wrapper\PermissionsMask->getDirectoryContent()
#6 /var/www/localhost/htdocs/cloud/lib/private/Files/Cache/Scanner.php(409): iterator_to_array()
#7 /var/www/localhost/htdocs/cloud/lib/private/Files/Cache/Scanner.php(389): OC\Files\Cache\Scanner->handleChildren()
#8 /var/www/localhost/htdocs/cloud/lib/private/Files/Cache/Scanner.php(392): OC\Files\Cache\Scanner->scanChildren()
#9 /var/www/localhost/htdocs/cloud/lib/private/Files/Cache/Scanner.php(341): OC\Files\Cache\Scanner->scanChildren()
#10 /var/www/localhost/htdocs/cloud/lib/private/Files/Utils/Scanner.php(260): OC\Files\Cache\Scanner->scan()
#11 /var/www/localhost/htdocs/cloud/apps/files/lib/Command/Scan.php(158): OC\Files\Utils\Scanner->scan()
#12 /var/www/localhost/htdocs/cloud/apps/files/lib/Command/Scan.php(214): OCA\Files\Command\Scan->scanFiles()
#13 /var/www/localhost/htdocs/cloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute()
#14 /var/www/localhost/htdocs/cloud/core/Command/Base.php(169): Symfony\Component\Console\Command\Command->run()
#15 /var/www/localhost/htdocs/cloud/3rdparty/symfony/console/Application.php(1009): OC\Core\Command\Base->run()
#16 /var/www/localhost/htdocs/cloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#17 /var/www/localhost/htdocs/cloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#18 /var/www/localhost/htdocs/cloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
#19 /var/www/localhost/htdocs/cloud/console.php(100): OC\Console\Application->run()
#20 /var/www/localhost/htdocs/cloud/occ(11): require_once('/var/www/localh...')
#21 {main}

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug needs info stale Ticket or PR with no recent activity
Projects
None yet
Development

No branches or pull requests

3 participants