nextcloud / nextcloud/fulltextsearch
occ fulltextsearch:index throws exception: Error: Cannot use object of type stdClass as array in /var/www/html/nextcloud/3rdparty/phpseclib/phpseclib/phpseclib/Net/SFTP.php:1215
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 234
- Forks
- 64
- Avg merge
- 6h 18m
- Merged PRs (30d)
- 10
Description
Hi,
I run Nextcloud 16.0.6 with Fulltextsearch 1.3.6. When executing occ fulltextsearch:index for the first time to build an index, I fail with index completion as an exception is thrown during building the index.
When I repeat fulltextsearch:index, the exception is thrown exactly at the same file. When I run occ files:scan --all, I can successfully process all files. As a result, I fail to build an index.
This is the last output from building the index:
root@nextcloud:~# sudo -u www-data php /var/www/html/nextcloud/occ fulltextsearch:index
Options: []
Memory: 1375 MB
┌─ Indexing ────
│ Action: compareWithCurrentIndex
│ Provider: Files Account: person
│ Document: 8657689
│ Info: /
│ Title:
│ Content size:
│ Chunk: 18/43
│ Progress: 51000/51622
└──
┌─ Results ────
│ Result: 9801/9801
│ Index: files:8657689
│ Status: ok
│ Message: {"_index":"nextcloud","_type":"standard","_id":"files:8657689","_version":2,"result":"noop","_shards":
│ {"total":0,"successful":0,"failed":0}}
│
└──
┌─ Errors ────
│ Error: 4609/4609
│ Index: files:9201
│ Exception: Elasticsearch\Common\Exceptions\ServerErrorResponseException
│ Message: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: field [content] not present as
│ part of path [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:
Error: Cannot use object of type stdClass as array in /var/www/html/nextcloud/3rdparty/phpseclib/phpseclib/phpseclib/Net/SFTP.php:1215
Stack trace:
#0 /var/www/html/nextcloud/3rdparty/phpseclib/phpseclib/phpseclib/Net/SFTP.php(1244): phpseclib\Net\SFTP->_query_stat_cache('/share/Person/...')
#1 /var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/SFTP.php(453): phpseclib\Net\SFTP->stat('/share/Person/...')
#2 /var/www/html/nextcloud/lib/private/Files/Storage/Common.php(185): OCA\Files_External\Lib\Storage\SFTP->stat('/Universit\xC3\xA4t/R...')
#3 /var/www/html/nextcloud/lib/private/Files/Storage/Common.php(327): OC\Files\Storage\Common->filemtime('/Universit\xC3\xA4t/R...')
#4 /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(379): OC\Files\Storage\Common->hasUpdated('/Universit\xC3\xA4t/R...', 1531747974)
#5 /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php(381): OC\Files\Storage\Wrapper\Wrapper->hasUpdated('/Universit\xC3\xA4t/R...', 1531747974)
#6 /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(379): OC\Files\Storage\Wrapper\Availability->hasUpdated('/Universit\xC3\xA4t/R...', 1531747974)
#7 /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(379): OC\Files\Storage\Wrapper\Wrapper->hasUpdated('/Universit\xC3\xA4t/R...', 1531747974)
#8 /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Jail.php(392): OC\Files\Storage\Wrapper\Wrapper->hasUpdated('/Universit\xC3\xA4t/R...', 1531747974)
#9 /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(379): OC\Files\Storage\Wrapper\Jail->hasUpdated('.@__thumb', 1531747974)
#10 /var/www/html/nextcloud/lib/private/Files/Cache/Watcher.php(126): OC\Files\Storage\Wrapper\Wrapper->hasUpdated('.@__thumb', 1531747974)
#11 /var/www/html/nextcloud/lib/private/Files/View.php(1340): OC\Files\Cache\Watcher->needsUpdate('.@__thumb', Object(OC\Files\Cache\CacheEntry))
#12 /var/www/html/nextcloud/lib/private/Files/View.php(1382): OC\Files\View->getCacheEntry(Object(OCA\Files_Trashbin\Storage), '.@__thumb', '/person/...')
#13 /var/www/html/nextcloud/lib/private/Files/Node/Root.php(198): OC\Files\View->getFileInfo('/person/...')
#14 /var/www/html/nextcloud/lib/private/Files/Node/Folder.php(134): OC\Files\Node\Root->get('/person/...')
#15 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(256): OC\Files\Node\Folder->get('/person/...')
#16 /var/www/html/nextcloud/apps/files_fulltextsearch/lib/Provider/FilesProvider.php(254): OCA\Files_FullTextSearch\Service\FilesService->getFilesFromUser('person', '/person/...')
#17 /var/www/html/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(193): OCA\Files_FullTextSearch\Provider\FilesProvider->generateIndexableDocuments('person', '/person/...')
#18 /var/www/html/nextcloud/apps/fulltextsearch/lib/Command/Index.php(409): OCA\FullTextSearch\Service\IndexService->indexProviderContentFromUser(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\Files_FullTextSearch\Provider\FilesProvider), 'person', Object(OCA\FullTextSearch\Model\IndexOptions))
#19 /var/www/html/nextcloud/apps/fulltextsearch/lib/Command/Index.php(273): OCA\FullTextSearch\Command\Index->indexProvider(Object(OCA\Files_FullTextSearch\Provider\FilesProvider), Object(OCA\FullTextSearch\Model\IndexOptions))
#20 /var/www/html/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))
#21 /var/www/html/nextcloud/core/Command/Base.php(166): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(901): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 /var/www/html/nextcloud/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))
#24 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#25 /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))
#26 /var/www/html/nextcloud/console.php(97): OC\Console\Application->run()
#27 /var/www/html/nextcloud/occ(11): require_once('/var/www/html/n...')
#28 {main}You have new mail in /var/mail/root
root@nextcloud:~#
Thanks for your your support!
Best regards,
Peter
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with phpseclib/phpseclib/Net/SFTP.php at line 1215 and follow the stat call from apps/files_external/lib/Lib/Storage/SFTP.php line 453 through FilesService.php line 256. Reproduce the failure with occ fulltextsearch:index using the reported setup and trace the affected file path. Done means indexing completes without the stdClass-as-array exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elasticsearch, php
- Domain
- backend, search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100