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

Search from CLI doesn't work #72

Closed
ondj opened this issue Jun 24, 2019 · 5 comments
Closed

Search from CLI doesn't work #72

ondj opened this issue Jun 24, 2019 · 5 comments

Comments

@ondj
Copy link

ondj commented Jun 24, 2019

Example:

# sudo -u nginx php /var/www/nextcloud/occ fulltextsearch:search admin help
search
An unhandled exception has been thrown:
TypeError: Argument 1 passed to OCA\Files_FullTextSearch\Service\FilesService::getFileFromId() must be of the type string, null given, called in /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/SearchService.php on line 241 and defined in /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php:432
Stack trace:
#0 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/SearchService.php(241): OCA\Files_FullTextSearch\Service\FilesService->getFileFromId(NULL, 8)
#1 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/SearchService.php(219): OCA\Files_FullTextSearch\Service\SearchService->setDocumentInfo(Object(OCA\Files_FullTextSearch\Model\FilesDocument))

App versions:

  - fulltextsearch: 1.3.4
  - fulltextsearch_elasticsearch: 1.3.3
  - files_fulltextsearch: 1.3.2
@robertschulze
Copy link

robertschulze commented Jul 29, 2019

I have the same issue

  - fulltextsearch: 1.3.6
  - fulltextsearch_elasticsearch: 1.3.5
  - files_fulltextsearch: 1.3.5
/var/www/nextcloud$ sudo -u www-data php occ fulltextsearch:search robert nextcloud
search
An unhandled exception has been thrown:
TypeError: Argument 1 passed to OCA\Files_FullTextSearch\Service\FilesService::getFileFromId() must be of the type string, null given, called in /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/SearchService.php on line 241 and defined in /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php:432
Stack trace:
#0 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/SearchService.php(241): OCA\Files_FullTextSearch\Service\FilesService->getFileFromId(NULL, 14)
#1 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/SearchService.php(219): OCA\Files_FullTextSearch\Service\SearchService->setDocumentInfo(Object(OCA\Files_FullTextSearch\Model\FilesDocument))
#2 /var/www/nextcloud/apps/files_fulltextsearch/lib/Provider/FilesProvider.php(339): OCA\Files_FullTextSearch\Service\SearchService->improveSearchResult(Object(OCA\FullTextSearch\Model\SearchResult))
#3 /var/www/nextcloud/apps/fulltextsearch/lib/Service/SearchService.php(204): OCA\Files_FullTextSearch\Provider\FilesProvider->improveSearchResult(Object(OCA\FullTextSearch\Model\SearchResult))
#4 /var/www/nextcloud/apps/fulltextsearch/lib/Service/SearchService.php(160): OCA\FullTextSearch\Service\SearchService->searchFromProviders(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Array, Object(OC\FullTextSearch\Model\DocumentAccess), Object(OCA\FullTextSearch\Model\SearchRequest))
#5 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Search.php(109): OCA\FullTextSearch\Service\SearchService->search('robert', Object(OCA\FullTextSearch\Model\SearchRequest))
#6 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\FullTextSearch\Command\Search->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /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))
#8 /var/www/nextcloud/3rdparty/symfony/console/Application.php(901): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/nextcloud/3rdparty/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(OCA\FullTextSearch\Command\Search), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
...

What can I do to identify the cause of the error?

@Happyfeet01
Copy link

i have the same Problem.

In Connection.php line 632:

{"error":{"root_cause":[{"type":"x_content_parse_exception","reason":"[1:63] [bool] failed to parse field [should]"}],"type":"x_content_parse_exception","reason":"[1:63] [bool] failed to parse field [must]"
,"caused_by":{"type":"x_content_parse_exception","reason":"[1:63] [bool] failed to parse field [should]","caused_by":{"type":"x_content_parse_exception","reason":"[1:63] [bool] failed to parse field [should
]","caused_by":{"type":"illegal_state_exception","reason":"expected value but got [START_ARRAY]"}}}},"status":400}

@TheNetStriker
Copy link

I also get the same error in Nextcloud 20 with all fultext apps on version 2.0.

mbarczak pushed a commit to mbarczak/files_fulltextsearch that referenced this issue Jan 18, 2021
This commit fixes issue nextcloud#72
mbarczak pushed a commit to mbarczak/files_fulltextsearch that referenced this issue Jan 18, 2021
Fix for  unhandled exception, when SearchService is being used by
occ fulltextsearch:search command.
We ensure, that userId member of SearchService is set properly.

This commit fixes issue nextcloud#72
mbarczak pushed a commit to mbarczak/files_fulltextsearch that referenced this issue Jan 18, 2021
Fix for  unhandled exception, when SearchService is being used by
occ fulltextsearch:search command.
We ensure, that userId member of SearchService is set properly.

This commit fixes issue nextcloud#72

Signed-off-by: Maciek Barczak <maciej.barczak@gmail.com>
ArtificialOwl added a commit that referenced this issue Apr 23, 2021
Fix for #72 - occ fulltextsearch:search throws unhandled exception
backportbot-nextcloud bot pushed a commit that referenced this issue Apr 23, 2021
Fix for  unhandled exception, when SearchService is being used by
occ fulltextsearch:search command.
We ensure, that userId member of SearchService is set properly.

This commit fixes issue #72

Signed-off-by: Maciek Barczak <maciej.barczak@gmail.com>
ArtificialOwl added a commit that referenced this issue Apr 23, 2021
[stable21] Fix for #72 - occ fulltextsearch:search throws unhandled exception
@solracsf solracsf changed the title Search from CLI doesnt work Search from CLI doesn't work Sep 15, 2021
@solracsf
Copy link
Member

Can you please confirm this still hapens with both latest versions of Nexcloud and files_fulltextsearch apps?

@joshtrichards
Copy link
Member

Fixed in #104

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

6 participants