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

Error while indexing FileShares::addLink() must be of the type string, null given #410

Closed
amd-64 opened this issue Nov 19, 2018 · 14 comments

Comments

@amd-64
Copy link

amd-64 commented Nov 19, 2018

Please help explain this error. It occurred after upgrading to NC15 and fulltextsearch 1.2. It happens on indexing the first user after indexing 4000 files. All files are local on a VM. No external files, or federated shares. Is there a way to continue indexing after an error.

Nextcloud 15.0.0.6 ver 15 beta 2
Fulltextsearch 1.2
Elasticsearch 6.5 with ingest-attachment
PHP 7.0.28
Mysql 10.2.12 (Mariadb)

An unhandled exception has been thrown:
TypeError: Argument 1 passed to OCA\Files_FullTextSearch\Model\FileShares::addLink() must be of the type string, null given, called in /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/LocalFilesService.php on line 315 and defined in /var/www/nextcloud/apps/files_fulltextsearch/lib/Model/FileShares.php:195
Stack trace:
#0 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/LocalFilesService.php(315): OCA\Files_FullTextSearch\Model\FileShares->addLink(NULL)
#1 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/LocalFilesService.php(262): OCA\Files_FullTextSearch\Service\LocalFilesService->parseUsersLinks(Array, Object(OCA\Files_FullTextSearch\Model\FileShares))
#2 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/LocalFilesService.php(138): OCA\Files_FullTextSearch\Service\LocalFilesService->getSharesFromFile(Object(OC\Files\Node\Folder), Object(OCA\Files_FullTextSearch\Model\FileShares))
#3 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(536): OCA\Files_FullTextSearch\Service\LocalFilesService->updateDocumentAccess(Object(OCA\Files_FullTextSearch\Model\FilesDocument), Object(OC\Files\Node\Folder))
#4 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(516): OCA\Files_FullTextSearch\Service\FilesService->updateDocumentAccess(Object(OCA\Files_FullTextSearch\Model\FilesDocument), Object(OC\Files\Node\Folder))
#5 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(499): OCA\Files_FullTextSearch\Service\FilesService->updateFilesDocumentFromFile(Object(OCA\Files_FullTextSearch\Model\FilesDocument), Object(OC\Files\Node\Folder))
#6 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(405): OCA\Files_FullTextSearch\Service\FilesService->updateFilesDocument(Object(OCA\Files_FullTextSearch\Model\FilesDocument))
#7 /var/www/nextcloud/apps/files_fulltextsearch/lib/Provider/FilesProvider.php(239): OCA\Files_FullTextSearch\Service\FilesService->generateDocument(Object(OCA\Files_FullTextSearch\Model\FilesDocument))
#8 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(312): OCA\Files_FullTextSearch\Provider\FilesProvider->fillIndexDocument(Object(OCA\Files_FullTextSearch\Model\FilesDocument))
#9 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(192): OCA\FullTextSearch\Service\IndexService->indexDocuments(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\Files_FullTextSearch\Provider\FilesProvider), Array, Object(OCA\FullTextSearch\Model\IndexOptions))
#10 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(407): OCA\FullTextSearch\Service\IndexService->indexProviderContentFromUser(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\Files_FullTextSearch\Provider\FilesProvider), 'User1', Object(OCA\FullTextSearch\Model\IndexOptions))
#11 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(271): OCA\FullTextSearch\Command\Index->indexProvider(Object(OCA\Files_FullTextSearch\Provider\FilesProvider), Object(OCA\FullTextSearch\Model\IndexOptions))
#12 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\FullTextSearch\Command\Index->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/nextcloud/core/Command/Base.php(166): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/nextcloud/3rdparty/symfony/console/Application.php(946): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/nextcloud/3rdparty/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(OCA\FullTextSearch\Command\Index), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/nextcloud/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /var/www/nextcloud/console.php(96): OC\Console\Application->run()
#19 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')

@amd-64
Copy link
Author

amd-64 commented Nov 19, 2018

I tracked some of the files causing the error. The files show "contentSize": 0 but their size on disk is not zero. Can this be corrected or at least made to not stop indexing.

sudo -u www-data php /var/www/nextcloud/occ fulltextsearch:document:platform files 18348
{
"document": {
"id": "18348",
"providerId": "files",
"access": {
"ownerId": "User1",
"viewerId": "",
"users": [
"User2",
"User3"
],
"groups": [],
"circles": [],
"links": []
},
"modifiedTime": 0,
"title": "path to file [REMOVED]",
"link": "",
"index": null,
"source": "",
"info": [],
"hash": "",
"contentSize": 0,
"tags": [],
"metatags": [
""
],
"subtags": [],
"more": [],
"excerpts": [],
"score": ""
}
}

@ArtificialOwl
Copy link
Member

Thanks for testing fts on NC15 !

So, the contentSize is not necesseraly the same than the size of the file, as we're talking about indexeable content. If the file is an picture/landscape, the content will be empty.

I will release a new version of files_fulltextsearch within the next few days that should fix this

@amd-64
Copy link
Author

amd-64 commented Nov 20, 2018

thank you very much @daita. I am noticing this error happen in ppt and pdf files that are not encrypted and have text that can be indexed. Picture files are processed without error.

This error appears to be new in ver. 1.2.

ArtificialOwl added a commit to nextcloud/files_fulltextsearch that referenced this issue Nov 20, 2018
ArtificialOwl added a commit to nextcloud/files_fulltextsearch that referenced this issue Nov 20, 2018
@amd-64
Copy link
Author

amd-64 commented Nov 21, 2018

Thank you. This took care of the error. However I need to do more testing because I am not seeing any search results.

EDIT: tried it again on a second NC cloud with same configuration. Indexing completed without error. Search produces no results and only responds after choosing local files, otherwise no response. If you think it is unrelated to this commit, I can move it to a new ticket.

@janLo
Copy link

janLo commented Dec 12, 2018

@daita, when will the updated app be released?

@hirschrobert
Copy link

TypeError still persists as well as no search results.

nc 15 is stable now, it happened after upgrading from nc 14. i use Full text search - Files version 1.2.0.

what is the status here?

@janLo
Copy link

janLo commented Dec 12, 2018

The fix is not yet included in a release.

@ArtificialOwl
Copy link
Member

I'll release something tomorrow !

@nthisler
Copy link

Well I await the release as I'm now also having the same issue.

@nthisler
Copy link

@daita any update on the release today?

@ArtificialOwl
Copy link
Member

Sorry, could not really find the time today.

Thanks for your patience!

@olli0815
Copy link

is there a workaround?

@horsedriver
Copy link

This is kinda funny :) @daita are you planning to get back to this issue or not? Unfortunately I'm not that good in coding, but this errors grinds my gears ))

@ArtificialOwl
Copy link
Member

@horsedriver version used ?

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

7 participants