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

Argument 1 passed to OCA\Files_FullTextSearch\Service\FilesService::e() must be an instance of Exception, instance of Error given #140

Open
DmDS opened this issue Oct 14, 2021 · 3 comments

Comments

@DmDS
Copy link

DmDS commented Oct 14, 2021

Running:
Nextcloud 22.2.0
Elastic Search 7.15 with Elasticsearch Plugin (free)

Plugins Installed:
Full text search 22.0.1
Full text search - Elasticsearch Platform 22.0.1
Full text search - Files 22.0.1

Config:
Outcome of "occ fulltextsearch:check"
Full text search 22.0.1

  • Search Platform:
    Elasticsearch 22.0.1 (Selected)
    {
    "elastic_host": [
    "http://10.10.107.8:9200"
    ],
    "elastic_index": "cloud1",
    "fields_limit": "10000",
    "es_ver_below66": "0",
    "analyzer_tokenizer": "standard"
    }

  • Content Providers:
    Files 22.0.1
    {
    "files_local": "1",
    "files_external": "2",
    "files_group_folders": "0",
    "files_encrypted": "0",
    "files_federated": "0",
    "files_size": "10",
    "files_pdf": "0",
    "files_office": "0",
    "files_image": "0",
    "files_audio": "0"

Problem:
The following error comes up when attempting to "occ fulltextsearch:index" and occurs after some time after the start of indexing (maybe 30-40 minutes) when switching to the next user. the indexing of this particular user runs without errors. almost all users are LDAP. some did not log in even once. but almost always the error occurs on different users, but after about the same time after the start of indexing.

An unhandled exception has been thrown:
TypeError: Argument 1 passed to OCA\Files_FullTextSearch\Service\FilesService::e() must be an instance of Exception, instance of Error given, called in /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php on line 209 and defined in /var/www/nextcloud/apps/fulltextsearch/vendor/artificial-owl/my-small-php-tools/lib/Traits/Nextcloud/nc22/TNC22Logger.php:98
Stack trace:

/var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(209): OCA\Files_FullTextSearch\Service\FilesService->e()
/var/www/nextcloud/apps/files_fulltextsearch/lib/Provider/FilesProvider.php(249): OCA\Files_FullTextSearch\Service\FilesService->getChunksFromUser()
/var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(182): OCA\Files_FullTextSearch\Provider\FilesProvider->generateChunks()
/var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(410): OCA\FullTextSearch\Service\IndexService->indexProviderContentFromUser()
/var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(273): OCA\FullTextSearch\Command\Index->indexProvider()
/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\FullTextSearch\Command\Index->execute()
/var/www/nextcloud/core/Command/Base.php(168): Symfony\Component\Console\Command\Command->run()
/var/www/nextcloud/3rdparty/symfony/console/Application.php(1009): OC\Core\Command\Base->run()
/var/www/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
/var/www/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
/var/www/nextcloud/lib/private/Console/Application.php(209): Symfony\Component\Console\Application->run()
/var/www/nextcloud/console.php(99): OC\Console\Application->run()
/var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
{main}root@nc:/var/www/nextcloud# 
@DmDS
Copy link
Author

DmDS commented Oct 14, 2021

I don't know if it's related or not...

in the nextcloud logs:
Exception: Home dir attribute can't be read from LDAP for uid: user1

Exception: Home dir attribute can't be read from LDAP for uid: user1

    /var/www/nextcloud/apps/user_ldap/lib/User_LDAP.php - line 422:

    OCA\User_LDAP\User\User->getHomePath()

    <<closure>>

    OCA\User_LDAP\User_LDAP->getHome()

    /var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php - line 81:

    call_user_func_array()

    /var/www/nextcloud/apps/user_ldap/lib/Proxy.php - line 168:

    OCA\User_LDAP\User_Proxy->walkBackends()

    /var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php - line 256:

    OCA\User_LDAP\Proxy->handleRequest()

    /var/www/nextcloud/lib/private/User/User.php - line 343:

    OCA\User_LDAP\User_Proxy->getHome()

    /var/www/nextcloud/lib/private/Files/Storage/Home.php - line 52:

    OC\User\User->getHome()

    /var/www/nextcloud/lib/private/Files/Mount/MountPoint.php - line 148:

    OC\Files\Storage\Home->__construct()

    /var/www/nextcloud/lib/private/Files/Mount/MountPoint.php - line 173:

    OC\Files\Mount\MountPoint->createStorage()

    /var/www/nextcloud/lib/private/Files/Mount/MountPoint.php - line 271:

    OC\Files\Mount\MountPoint->getStorage()

    /var/www/nextcloud/lib/private/Files/Filesystem.php - line 420:

    OC\Files\Mount\MountPoint->getStorageRootId()

    /var/www/nextcloud/lib/private/Files/Node/Root.php - line 378:

    OC\Files\Filesystem::initMountPoints()

    <<closure>>

    OC\Files\Node\Root->getUserFolder()

    /var/www/nextcloud/lib/private/Files/Node/LazyFolder.php - line 65:

    call_user_func_array()

    /var/www/nextcloud/lib/private/Files/Node/LazyRoot.php - line 40:

    OC\Files\Node\LazyFolder->__call()

    /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php - line 206:

    OC\Files\Node\LazyRoot->getUserFolder()

    /var/www/nextcloud/apps/files_fulltextsearch/lib/Provider/FilesProvider.php - line 249:

    OCA\Files_FullTextSearch\Service\FilesService->getChunksFromUser()

    /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php - line 182:

    OCA\Files_FullTextSearch\Provider\FilesProvider->generateChunks()

    /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php - line 410:

    OCA\FullTextSearch\Service\IndexService->indexProviderContentFromUser()

    /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php - line 273:

    OCA\FullTextSearch\Command\Index->indexProvider()

    /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php - line 255:

    OCA\FullTextSearch\Command\Index->execute()

    /var/www/nextcloud/core/Command/Base.php - line 168:

    Symfony\Component\Console\Command\Command->run()

    /var/www/nextcloud/3rdparty/symfony/console/Application.php - line 1009:

    OC\Core\Command\Base->run()

    /var/www/nextcloud/3rdparty/symfony/console/Application.php - line 273:

    Symfony\Component\Console\Application->doRunCommand()

    /var/www/nextcloud/3rdparty/symfony/console/Application.php - line 149:

    Symfony\Component\Console\Application->doRun()

    /var/www/nextcloud/lib/private/Console/Application.php - line 209:

    Symfony\Component\Console\Application->run()

    /var/www/nextcloud/console.php - line 99:

    OC\Console\Application->run()

    /var/www/nextcloud/occ - line 11:

    require_once("/var/www/ne ... p")

Error: ldap_first_entry(): supplied resource is not a valid ldap link resource at /var/www/nextcloud/apps/user_ldap/lib/LDAP.php#336

Error: ldap_first_entry(): supplied resource is not a valid ldap link resource at /var/www/nextcloud/apps/user_ldap/lib/LDAP.php#336

    <<closure>>

    OC\Log\ErrorHandler::onError()

    <<closure>>

    ldap_first_entry()

    /var/www/nextcloud/apps/user_ldap/lib/LDAP.php - line 336:

    call_user_func_array()

    /var/www/nextcloud/apps/user_ldap/lib/LDAP.php - line 158:

    OCA\User_LDAP\LDAP->invokeLDAPMethod("*** sensiti ... *")

    <<closure>>

    OCA\User_LDAP\LDAP->firstEntry()

    /var/www/nextcloud/apps/user_ldap/lib/Access.php - line 1098:

    call_user_func_array()

    /var/www/nextcloud/apps/user_ldap/lib/Access.php - line 1102:

    OCA\User_LDAP\Access->OCA\User_LDAP\{closure}("*** sensiti ... *")

    /var/www/nextcloud/apps/user_ldap/lib/Access.php - line 289:

    OCA\User_LDAP\Access->invokeLDAPMethod("*** sensiti ... *")

    /var/www/nextcloud/apps/user_ldap/lib/Access.php - line 214:

    OCA\User_LDAP\Access->executeRead()

    /var/www/nextcloud/apps/user_ldap/lib/User/User.php - line 290:

    OCA\User_LDAP\Access->readAttribute()

    /var/www/nextcloud/apps/user_ldap/lib/User_LDAP.php - line 422:

    OCA\User_LDAP\User\User->getHomePath()

    <<closure>>

    OCA\User_LDAP\User_LDAP->getHome()

    /var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php - line 81:

    call_user_func_array()

    /var/www/nextcloud/apps/user_ldap/lib/Proxy.php - line 168:

    OCA\User_LDAP\User_Proxy->walkBackends()

    /var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php - line 256:

    OCA\User_LDAP\Proxy->handleRequest()

    /var/www/nextcloud/lib/private/User/User.php - line 343:

    OCA\User_LDAP\User_Proxy->getHome()

    /var/www/nextcloud/lib/private/Files/Storage/Home.php - line 52:

    OC\User\User->getHome()

    /var/www/nextcloud/lib/private/Files/Mount/MountPoint.php - line 148:

    OC\Files\Storage\Home->__construct()

    /var/www/nextcloud/lib/private/Files/Mount/MountPoint.php - line 173:

    OC\Files\Mount\MountPoint->createStorage()

    /var/www/nextcloud/lib/private/Files/Mount/MountPoint.php - line 271:

    OC\Files\Mount\MountPoint->getStorage()

    /var/www/nextcloud/lib/private/Files/Filesystem.php - line 420:

    OC\Files\Mount\MountPoint->getStorageRootId()

    /var/www/nextcloud/lib/private/Files/Node/Root.php - line 378:

    OC\Files\Filesystem::initMountPoints()

    <<closure>>

    OC\Files\Node\Root->getUserFolder()

    /var/www/nextcloud/lib/private/Files/Node/LazyFolder.php - line 65:

    call_user_func_array()

    /var/www/nextcloud/lib/private/Files/Node/LazyRoot.php - line 40:

    OC\Files\Node\LazyFolder->__call()

    /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php - line 206:

    OC\Files\Node\LazyRoot->getUserFolder()

    /var/www/nextcloud/apps/files_fulltextsearch/lib/Provider/FilesProvider.php - line 249:

    OCA\Files_FullTextSearch\Service\FilesService->getChunksFromUser()

    /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php - line 182:

    OCA\Files_FullTextSearch\Provider\FilesProvider->generateChunks()

    /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php - line 410:

    OCA\FullTextSearch\Service\IndexService->indexProviderContentFromUser()

    /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php - line 273:

    OCA\FullTextSearch\Command\Index->indexProvider()

    /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php - line 255:

    OCA\FullTextSearch\Command\Index->execute()

    /var/www/nextcloud/core/Command/Base.php - line 168:

    Symfony\Component\Console\Command\Command->run()

    /var/www/nextcloud/3rdparty/symfony/console/Application.php - line 1009:

    OC\Core\Command\Base->run()

    /var/www/nextcloud/3rdparty/symfony/console/Application.php - line 273:

    Symfony\Component\Console\Application->doRunCommand()

    /var/www/nextcloud/3rdparty/symfony/console/Application.php - line 149:

    Symfony\Component\Console\Application->doRun()

    /var/www/nextcloud/lib/private/Console/Application.php - line 209:

    Symfony\Component\Console\Application->run()

    /var/www/nextcloud/console.php - line 99:

    OC\Console\Application->run()

    /var/www/nextcloud/occ - line 11:

    require_once("/var/www/ne ... p")

@DmDS
Copy link
Author

DmDS commented Oct 15, 2021

maybe it's related to Long running php processes: LDAP timeout

if someone has the same problem, I made a script.
it indexes each user separately

#!/bin/bash
rm users.sh
sudo -u www-data php /var/www/nextcloud/occ user:list > users.txt
sed -i 's/  - //' users.txt
sed -i 's/:.*//' users.txt
cat users.txt | while read y
do
  echo 'sudo -u www-data php ./occ fulltextsearch:index "{\"user\": \"'$y'\"}"' >> users.sh
done
rm users.txt
chmod a+x users.sh

copy "users.sh" to ./nextcloud and run

@joshtrichards
Copy link
Member

Are you still experiencing this with with updated NC Server and files_fulltextsearch installations?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants