fulltextsearch_elasticsearch icon indicating copy to clipboard operation
fulltextsearch_elasticsearch copied to clipboard

NC 24.0.1 / EC 7.17.3: Error: Call to a member function getUID() on null in /var/www/html/custom_apps/files_fulltextsearch/lib/Service/FilesService.php:449

Open ralfi opened this issue 2 years ago • 8 comments

Hi,

fulltextsearch indexing breaks with stack trace. It seems to be it could be related to LDAP user who are integrated because the stacktrace tell me...

#0 /var/www/html/custom_apps/files_fulltextsearch/lib/Service/FilesService.php(324): OCA\Files_FullTextSearch\Service\FilesService->generateFilesDocumentFromFile('0044CAF4-FC64-4...', Object(OC\Files\Node\File)) #1 /var/www/html/custom_apps/files_fulltextsearch/lib/Provider/FilesProvider.php(269): OCA\Files_FullTextSearch\Service\FilesService->getFilesFromUser('0044CAF4-FC64-4...', '/Pressespiegel/...') #2 /var/www/html/custom_apps/fulltextsearch/lib/Service/IndexService.php(183): OCA\Files_FullTextSearch\Provider\FilesProvider->generateIndexableDocuments('0044CAF4-FC64-4...', '/Pressespiegel/...') #3 /var/www/html/custom_apps/fulltextsearch/lib/Command/Index.php(416): OCA\FullTextSearch\Service\IndexService->indexProviderContentFromUser(Object(OCA\FullTextSearch_Elasticsearch\Platform\ElasticSearchPlatform), Object(OCA\Files_FullTextSearch\Provider\FilesProvider), '0044CAF4-FC64-4...', Object(OCA\FullTextSearch\Model\IndexOptions)) #4 /var/www/html/custom_apps/fulltextsearch/lib/Command/Index.php(279): OCA\FullTextSearch\Command\Index->indexProvider(Object(OCA\Files_FullTextSearch\Provider\FilesProvider), Object(OCA\FullTextSearch\Model\IndexOptions)) #5 /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)) #6 /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)) #7 /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)) #8 /var/www/html/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(OCA\FullTextSearch\Command\Index), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #9 /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)) #10 /var/www/html/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #11 /var/www/html/console.php(99): OC\Console\Application->run() #12 /var/www/html/occ(11): require_once('/var/www/html/c...') Generic NC user are not affected.

ralfi avatar Jun 03 '22 11:06 ralfi

playing around this issue this is not related to external storage as i guess first. But is this the correct place here or shoukld this moved to nextcloud/fulltextsearch? I dont know.

ralfi avatar Jun 03 '22 12:06 ralfi

I have it too.

Ubuntu 20.04 + NC 24.0.1 + EL 7.17.4 + ingest-attachments plugin + Kibana

Currently there are only local files, neither external storage nor group folders.

occ fulltextsearch:stop
occ fulltextsearch:reset
occ fulltextsearch:check
occ fulltextsearch:test

are OK and the index will be created:

tail -f /var/log/elasticsearch/elasticsearch.log
[2022-06-09T06:20:20,339][INFO ][o.e.c.m.MetadataDeleteIndexService] [localhost.localdomain] [nextcloud/vZRe9LRyQGS_Pj0c0ZodDg] deleting index
[2022-06-09T06:20:29,776][INFO ][o.e.c.m.MetadataCreateIndexService] [localhost.localdomain] [nextcloud] creating index, cause [api], templates [], shards [1]/[1]

But

occ fulltextsearch:index

does not work.

Options: []
Memory: 37 MB
┌─ Indexing  ────
│ Action: generateIndexFiles
│ Provider: Files                Account: admin
│ Document: 
│ Info: 
│ Title: 
│ Content size: 
│ Chunk:      1/1
│ Progress:      0/0
└──
┌─ 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:
Error: Call to a member function getUID() on null in /var/www/clients/client1/web2/web/apps/files_fulltextsearch/lib/Service/FilesService.php:449
Stack trace:
#0 /var/www/clients/client1/web2/web/apps/files_fulltextsearch/lib/Service/FilesService.php(421): OCA\Files_FullTextSearch\Service\FilesService->generateFilesDocumentFromFile()
#1 /var/www/clients/client1/web2/web/apps/files_fulltextsearch/lib/Service/FilesService.php(318): OCA\Files_FullTextSearch\Service\FilesService->generateFilesDocumentFromParent()
#2 /var/www/clients/client1/web2/web/apps/files_fulltextsearch/lib/Provider/FilesProvider.php(269): OCA\Files_FullTextSearch\Service\FilesService->getFilesFromUser()
#3 /var/www/clients/client1/web2/web/apps/fulltextsearch/lib/Service/IndexService.php(183): OCA\Files_FullTextSearch\Provider\FilesProvider->generateIndexableDocuments()
#4 /var/www/clients/client1/web2/web/apps/fulltextsearch/lib/Command/Index.php(416): OCA\FullTextSearch\Service\IndexService->indexProviderContentFromUser()
#5 /var/www/clients/client1/web2/web/apps/fulltextsearch/lib/Command/Index.php(279): OCA\FullTextSearch\Command\Index->indexProvider()
#6 /var/www/clients/client1/web2/web/3rdparty/symfony/console/Command/Command.php(255): OCA\FullTextSearch\Command\Index->execute()
#7 /var/www/clients/client1/web2/web/core/Command/Base.php(168): Symfony\Component\Console\Command\Command->run()
#8 /var/www/clients/client1/web2/web/3rdparty/symfony/console/Application.php(1009): OC\Core\Command\Base->run()
#9 /var/www/clients/client1/web2/web/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#10 /var/www/clients/client1/web2/web/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#11 /var/www/clients/client1/web2/web/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run()
#12 /var/www/clients/client1/web2/web/console.php(99): OC\Console\Application->run()
#13 /var/www/clients/client1/web2/web/occ(11): require_once('/var/www/client...')

Sanookmakmak avatar Jun 09 '22 04:06 Sanookmakmak

Hi,

do you have LDAP users?

ralfi avatar Jun 09 '22 06:06 ralfi

this might fix it: https://github.com/nextcloud/files_fulltextsearch/pull/170

ArtificialOwl avatar Jun 09 '22 08:06 ArtificialOwl

The error occurred after WebDAV was added as external storage with an invalid certificate. The filenames were displayed on the NC UI but could not be opened and the external memory was incorrectly marked as "green" on the settings page of NC.

Therefore the error in the NC log file

{
  "reqId": "BYWRtLvtsH6basECZu6W",
  "level": 2,
  "time": "June 09, 2022 11:54:08",
  "remoteAddr": "192.168.0.2",
  "user": "admin",
  "app": "no app in context",
  "method": "GET",
  "url": "/remote.php/webdav/Data/file.txt",
  "message": "Host 192.168.0.9 was not connected to because it violates local access rules",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:101.0) Gecko/20100101 Firefox/101.0",
  "version": "24.0.1.1"
}

after doing

occ fulltextsearch:index

Sanookmakmak avatar Jun 09 '22 16:06 Sanookmakmak

this might fix it: nextcloud/files_fulltextsearch#170

it appears to work, thank you.

Sanookmakmak avatar Jun 09 '22 19:06 Sanookmakmak

Worked for me too! Thanks

hendrik1120 avatar Jun 10 '22 15:06 hendrik1120

Worked also for me, thank you very much!

ralfi avatar Jun 14 '22 07:06 ralfi

Fixed in nextcloud/files_fulltextsearch#170

joshtrichards avatar Mar 01 '24 20:03 joshtrichards