-
Notifications
You must be signed in to change notification settings - Fork 30
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
Argument 1 passed to OCA\Files_FullTextSearch\Service\ExternalFilesService::getExternalMountById()
must be of the type int, null given
#79
Comments
Clearly this is caused by a not properly handled exception. I'm trying a quick and dirty fix. However, this solution should be further checked because I have no idea why "$file->getMountPoint()->getMountId()" is null. Edit: NextcloudHomeFolder/custom_apps/files_fulltextsearch/lib/Service/ExternalFilesService.php Find the following function, and add the if part! /**
* @param Node $file
*
* @return MountPoint
* @throws FileIsNotIndexableException
*/
private function getMountPoint(Node $file): MountPoint {
try {
if($file->getMountPoint()->getMountId() === null){
throw new FileIsNotIndexableException('getMountId is null');
}
return $this->getExternalMountById(
$file->getMountPoint()
->getMountId()
);
} catch (ExternalMountNotFoundException $e) {
throw new FileIsNotIndexableException('issue while getMountPoint');
}
} |
@daita would you please look into this? |
Fulltextsearch continue to work again after the fix~~ Maybe I should open a pull request about this~ |
I got this error, too.
I have mounted External CIFS storage to the root ("/") of my Nextcloud folders (see nextcloud/server#3438). Maybe this is causing the issue. |
@GammaPi Thanks Gamma - saved me hours of bug finding (and probably a few more grey hairs) |
I'm wondering regarding the status. At this very moment the indexing is not working as soon a private (=> user generated) external storage is existing. @GammaPi: Of course the fix work ignoring all files having no MountId, but as a result no files from user created external storage is indexed. I'm not a PHP developer to fix it. To my understanding the problem is that private external storage are "MoveableMount" not providing the ID. |
@saniwat |
OCA\Files_FullTextSearch\Service\ExternalFilesService::getExternalMountById()
must be of the type int, null given
Fixed in #80 (and possibly elsewhere). |
Every time I call index, this message appears
#27 seems to be related
NC 16.02 Fulltext Search Plugin 1.3.6
#27 looks like a similar error
An unhandled exception has been thrown:
TypeError: Argument 1 passed to OCA\Files_FullTextSearch\Service\ExternalFilesService::getExternalMountById() must be of the type int, null given, called in /var/www/html/custom_apps/files_fulltextsearch/lib/Service/ExternalFilesService.php on line 244 and defined in /var/www/html/custom_apps/files_fulltextsearch/lib/Service/ExternalFilesService.php:258
Stack trace:
#0 /var/www/html/custom_apps/files_fulltextsearch/lib/Service/ExternalFilesService.php(244): OCA\Files_FullTextSearch\Service\ExternalFilesService->getExternalMountById(NULL)
#1 /var/www/html/custom_apps/files_fulltextsearch/lib/Service/ExternalFilesService.php(187): OCA\Files_FullTextSearch\Service\ExternalFilesService->getMountPoint(Object(OC\Files\Node\Folder))
#2 /var/www/html/custom_apps/files_fulltextsearch/lib/Service/FilesService.php(673): OCA\Files_FullTextSearch\Service\ExternalFilesService->updateDocumentAccess(Object(OCA\Files_FullTextSearch\Model\FilesDocument), Object(OC\Files\Node\Folder))
#3 /var/www/html/custom_apps/files_fulltextsearch/lib/Service/FilesService.php(650): OCA\Files_FullTextSearch\Service\FilesService->updateDocumentAccess(Object(OCA\Files_FullTextSearch\Model\FilesDocument), Object(OC\Files\Node\Folder))
#4 /var/www/html/custom_apps/files_fulltextsearch/lib/Service/FilesService.php(631): OCA\Files_FullTextSearch\Service\FilesService->updateFilesDocumentFromFile(Object(OCA\Files_FullTextSearch\Model\FilesDocument), Object(OC\Files\Node\Folder))
#5 /var/www/html/custom_apps/files_fulltextsearch/lib/Service/FilesService.php(522): OCA\Files_FullTextSearch\Service\FilesService->updateFilesDocument(Object(OCA\Files_FullTextSearch\Model\FilesDocument))
#6 /var/www/html/custom_apps/files_fulltextsearch/lib/Provider/FilesProvider.php(272): OCA\Files_FullTextSearch\Service\FilesService->generateDocument(Object(OCA\Files_FullTextSearch\Model\FilesDocument))
#7 /var/www/html/custom_apps/fulltextsearch/lib/Service/IndexService.php(314): OCA\Files_FullTextSearch\Provider\FilesProvider->fillIndexDocument(Object(OCA\Files_FullTextSearch\Model\FilesDocument))
#8 /var/www/html/custom_apps/fulltextsearch/lib/Service/IndexService.php(205): OCA\FullTextSearch\Service\IndexService->indexDocuments(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\Files_FullTextSearch\Provider\FilesProvider), Array, Object(OCA\FullTextSearch\Model\IndexOptions))
#9 /var/www/html/custom_apps/fulltextsearch/lib/Command/Index.php(409): OCA\FullTextSearch\Service\IndexService->indexProviderContentFromUser(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\Files_FullTextSearch\Provider\FilesProvider), 'tjx', Object(OCA\FullTextSearch\Model\IndexOptions))
#10 /var/www/html/custom_apps/fulltextsearch/lib/Command/Index.php(273): OCA\FullTextSearch\Command\Index->indexProvider(Object(OCA\Files_FullTextSearch\Provider\FilesProvider), Object(OCA\FullTextSearch\Model\IndexOptions))
#11 /var/www/html/3rdparty/symfony/console/Command/Command.php(255): OCA\FullTextSearch\Command\Index->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/html/core/Command/Base.php(166): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/html/3rdparty/symfony/console/Application.php(901): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/html/3rdparty/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(OCA\FullTextSearch\Command\Index), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/html/3rdparty/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/html/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/html/console.php(97): OC\Console\Application->run()
#18 /var/www/html/occ(11): require_once('/var/www/html/c...')
The text was updated successfully, but these errors were encountered: