Exception during scan: opendir('dir'): Failed to open directory: Permission denied

I synced my files locally on my external hard drive, i changed permissions (chgrp, chown -R www-data /mnt/cloud/esmailelbob/files) to help nextcloud to read them but i still get problems about permissions and i’m not sure what else i can do

whenever i run sudo docker-compose exec --user www-data app php occ files:scan --all to sync my local files i get:

Exception during scan: opendir(/var/www/html/data/esmailelbob/files/MY FILES/GAMES/STEAM/steamapps/common/Proton 6.3/dist/share/default_pfx/dosdevices/z:/proc/tty/driver): Failed to open directory: Permission denied
#0 [internal function]: OCA\Files\Command\Scan->exceptionErrorHandler(2, 'opendir(/var/ww...', '/var/www/html/l...', 135)
#1 /var/www/html/lib/private/Files/Storage/Local.php(135): opendir('/var/www/html/d...')
#2 /var/www/html/lib/private/Files/Storage/Common.php(879): OC\Files\Storage\Local->opendir('files/MY FILES/...')
#3 [internal function]: OC\Files\Storage\Common->getDirectoryContent('files/MY FILES/...')
#4 /var/www/html/lib/private/Files/Cache/Scanner.php(408): iterator_to_array(Object(Generator))
#5 /var/www/html/lib/private/Files/Cache/Scanner.php(388): OC\Files\Cache\Scanner->handleChildren('files/MY FILES/...', true, 3, 1026558, true, 0)
#6 /var/www/html/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren('files/MY FILES/...', true, 3, 1026558, true)
#7 /var/www/html/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren('files/MY FILES/...', true, 3, 1025246, true)
#8 /var/www/html/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren('files/MY FILES/...', true, 3, 1025217, true)
#9 /var/www/html/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren('files/MY FILES/...', true, 3, 1022898, true)
#10 /var/www/html/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren('files/MY FILES/...', true, 3, 1022893, true)
#11 /var/www/html/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren('files/MY FILES/...', true, 3, 1019240, true)
#12 /var/www/html/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren('files/MY FILES/...', true, 3, 1018017, true)
#13 /var/www/html/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren('files/MY FILES/...', true, 3, 1018006, true)
#14 /var/www/html/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren('files/MY FILES/...', true, 3, 1017734, true)
#15 /var/www/html/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren('files/MY FILES/...', true, 3, 1017721, true)
#16 /var/www/html/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren('files/MY FILES/...', true, 3, 1017718, true)
#17 /var/www/html/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren('files/MY FILES/...', true, 3, 6668, true)
#18 /var/www/html/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren('files/MY FILES/...', true, 3, 6373, true)
#19 /var/www/html/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren('files/MY FILES', true, 3, 596, true)
#20 /var/www/html/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren('files', true, 3, 5, true)
#21 /var/www/html/lib/private/Files/Cache/Scanner.php(340): OC\Files\Cache\Scanner->scanChildren('', true, 3, 4, true)
#22 /var/www/html/lib/private/Files/Utils/Scanner.php(259): OC\Files\Cache\Scanner->scan('', true, 3)
#23 /var/www/html/apps/files/lib/Command/Scan.php(156): OC\Files\Utils\Scanner->scan('/esmailelbob', true, NULL)
#24 /var/www/html/apps/files/lib/Command/Scan.php(212): OCA\Files\Command\Scan->scanFiles('esmailelbob', '/esmailelbob', Object(Symfony\Component\Console\Output\ConsoleOutput), false, true, false)
#25 /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))
#26 /var/www/html/core/Command/Base.php(168): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /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))
#28 /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))
#29 /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))
#30 /var/www/html/lib/private/Console/Application.php(209): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#31 /var/www/html/console.php(99): OC\Console\Application->run()
#32 /var/www/html/occ(11): require_once('/var/www/html/c...')
#33 {main}

and after some trial and error i noticed i get permissions problem inside .wine and in soft links about wine