nextcloud / fulltextsearch

🔍 Core of the full-text search framework for Nextcloud
https://apps.nextcloud.com/apps/fulltextsearch
GNU Affero General Public License v3.0
216 stars 51 forks source link

Unhandled exception ::setUser() must implement interface OCP\IUser #399

Open truelai opened 6 years ago

truelai commented 6 years ago

NC 14.0.3 Full text search 1.0.3 Full text search - Elasticsearch Platform 1.0.1 Full text search - Files 1.0.3 Full text search - Files - Tesseract OCR 1.0.0

I don't understand what happened here.

root@nextcloud:~# sudo -u www-data php /var/www/nextcloud/occ fulltextsearch:live

Memory: 30 MB
┌─ Indexing  ────
│ Action: indexing
│ Provider: Files                Account: aakram
│ Document: 406639
│ Info: application/vnd.openxmlformats-officedocument.presentationml.presentation
│ Title: vika/PPP/Conditionals/Conditionals.pptx
│ Content size: 0
└──
┌─ Results ────
│ Result:     28/28
│ Index: files:406639
│ Status: ok
│ Message: {"_index":"nc-index-1","_type":"standard","_id":"files:406639","_version":2,"result":"updated","_shards":{"total":
│ 2,"successful":1,"failed":0},"_seq_no":32955,"_primary_term":1}
│
└──
┌─ Errors ────
│ Error:     16/16
│ Index: files:708494
│ Exception: Elasticsearch\Common\Exceptions\ServerErrorResponseException
│ Message: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: field [content] not present as part of pat
│ h [attachment.content]
│
└──
## x:first result ## c/v:prec/next result ## b:last result
## f:first error ## h/j:prec/next error ## d:delete error ## l:last error
## q:quit ## p:pause
An unhandled exception has been thrown:
TypeError: Argument 1 passed to OCA\Files_External\Service\UserGlobalStoragesService::setUser() must implement interface OCP\IUser, null given, called in /var/www/nextcloud/apps/files_external/lib/config.php on line 99 and defined in /var/www/nextcloud/apps/files_external/lib/Service/UserTrait.php:60
Stack trace:
#0 /var/www/nextcloud/apps/files_external/lib/config.php(99): OCA\Files_External\Service\UserGlobalStoragesService->setUser(NULL)
#1 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/ExternalFilesService.php(250): OC_Mount_Config::getAbsoluteMountPoints('aakram')
#2 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/ExternalFilesService.php(124): OCA\Files_FullTextSearch\Service\ExternalFilesService->getMountPoints('aakram')
#3 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(190): OCA\Files_FullTextSearch\Service\ExternalFilesService->initExternalFilesForUser('aakram')
#4 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(466): OCA\Files_FullTextSearch\Service\FilesService->initFileSystems('aakram')
#5 /var/www/nextcloud/apps/files_fulltextsearch/lib/Provider/FilesProvider.php(310): OCA\Files_FullTextSearch\Service\FilesService->updateDocument(Object(OCA\FullTextSearch\Model\ExtendedIndex))
#6 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(390): OCA\Files_FullTextSearch\Provider\FilesProvider->updateDocument(Object(OCA\FullTextSearch\Model\ExtendedIndex))
#7 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Live.php(262): OCA\FullTextSearch\Service\IndexService->updateDocument(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\Files_FullTextSearch\Provider\FilesProvider), Object(OCA\FullTextSearch\Model\ExtendedIndex))
#8 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Live.php(228): OCA\FullTextSearch\Command\Live->liveCycle()
#9 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(251): OCA\FullTextSearch\Command\Live->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/nextcloud/core/Command/Base.php(162): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /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))
#12 /var/www/nextcloud/3rdparty/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(OCA\FullTextSearch\Command\Live), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /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))
#14 /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))
#15 /var/www/nextcloud/console.php(96): OC\Console\Application->run()
#16 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#17 {main}root@nextcloud:~# 
spalinger commented 6 years ago

I also don't understand what happened here: The Account XYZ is removed. Does it have something to do with Issue 277?

admin@Nextcloud:~$ sudo -u www-data php /var/www/html/nextcloud/occ fulltextsearch:live

Memory: 38 MB
┌─ Indexing  ────
│ Action: indexing
│ Provider: Files                Account: XYZ
│ Document:
│ Info:
│ Title:
│ Content size:
└──
┌─ Results ────
│ Result:      0/0
│ Index:
│ Status:
│ Message:
│
│
└──
┌─ Errors ────
│ Error:      0/0
│ Index:
│ Exception:
│ Message:
│
│
└──
## x:first result ## c/v:prec/next result ## b:last result
## f:first error ## h/j:prec/next error ## d:delete error ## l:last error
## q:quit ## p:pause
An unhandled exception has been thrown:
TypeError: Argument 1 passed to OCA\Files_External\Service\UserGlobalStoragesService::setUser() must implement interface OCP\IUser, null given, called in /var/www/html/nextcloud/apps/files_external/lib/config.php on line 99 and defined in /var/www/html/nextcloud/apps/files_external/lib/Service/UserTrait.php:60
Stack trace:
#0 /var/www/html/nextcloud/apps/files_external/lib/config.php(99): OCA\Files_External\Service\UserGlobalStoragesService->setUser(NULL)
#1 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/ExternalFilesService.php(250): OC_Mount_Config::getAbsoluteMountPoints('XYZ')
#2 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/ExternalFilesService.php(124): OCA\Files_FullTextSearch\Service\ExternalFilesService->getMountPoints('XYZ')
#3 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(190): OCA\Files_FullTextSearch\Service\ExternalFilesService->initExternalFilesForUser('XYZ')
#4 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(466): OCA\Files_FullTextSearch\Service\FilesService->initFileSystems('XYZ')
#5 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Provider/FilesProvider.php(310): OCA\Files_FullTextSearch\Service\FilesService->updateDocument(Object(OCA\FullTextSearch\Model\ExtendedIndex))
#6 /var/www/html/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(390): OCA\Files_FullTextSearch\Provider\FilesProvider->updateDocument(Object(OCA\FullTextSearch\Model\ExtendedIndex))
#7 /var/www/html/nextcloud/apps/fulltextsearch/lib/Command/Live.php(262): OCA\FullTextSearch\Service\IndexService->updateDocument(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\Files_FullTextSearch\Provider\FilesProvider), Object(OCA\FullTextSearch\Model\ExtendedIndex))
#8 /var/www/html/nextcloud/apps/fulltextsearch/lib/Command/Live.php(228): OCA\FullTextSearch\Command\Live->liveCycle()
#9 /var/www/html/nextcloud/3rdparty/symfony/console/Command/Command.php(251): OCA\FullTextSearch\Command\Live->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/html/nextcloud/core/Command/Base.php(162): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(946): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(OCA\FullTextSearch\Command\Live), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/html/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/html/nextcloud/console.php(96): OC\Console\Application->run()
#16 /var/www/html/nextcloud/occ(11): require_once('/var/www/html/n...')
health status index          uuid                   pri rep docs.count docs.deleted store.size pri.store.size
yellow open   my_cloud_index YQfgAaz4R_mlalGjYJAe6w   5   1       3155            1     35.3mb         35.3mb
truelai commented 6 years ago

I also don't understand what happened here: The Account XYZ is removed. Does it have something to do with Issue 277?

@spalinger Maybe. I'm also running LDAP. But the user in my case, aakram, is not deleted. Additionally, the file being referred to (vika/PPP/Conditionals/Conditionals.pptx) does not belong to this user.

truelai commented 6 years ago

I also have this error happening when indexing approaches a corrupted pdf.

agross commented 5 years ago

Happened to me as well today after removing a (non-LDAP) user. NC 15.0.2, fts 1.2.3

ArtificialOwl commented 5 years ago

anyone with this issue willing to test this patch: https://github.com/nextcloud/files_fulltextsearch/pull/38