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

ZendSearch runtime exception. Cannot delete file #3847

Closed
joeworkman opened this issue Feb 1, 2020 · 4 comments
Closed

ZendSearch runtime exception. Cannot delete file #3847

joeworkman opened this issue Feb 1, 2020 · 4 comments

Comments

@joeworkman
Copy link

What steps will reproduce the problem?

When trying to reindex the search database, I am getting the below errors. I posted on the community and was asked to post the full error here. I have tried to run the index from commandline as well with the same results.

What is the expected result?

I would expect it to run without error.

What do you get instead?

ZendSearch\Lucene\Exception\RuntimeException: Can't delete file: unlink(/home/joeworkman/websites/community.weavers.space/protected/runtime/searchdb/_bzo.fdx): No such file or directory in /home/joeworkman/websites/community.weavers.space/protected/vendor/nqxcode/zendsearch/library/ZendSearch/Lucene/Storage/Directory/Filesystem.php:202 Stack trace: #0 /home/joeworkman/websites/community.weavers.space/protected/vendor/nqxcode/zendsearch/library/ZendSearch/Lucene/Index/SegmentWriter/AbstractSegmentWriter.php(601): ZendSearch\Lucene\Storage\Directory\Filesystem->deleteFile() #1 /home/joeworkman/websites/community.weavers.space/protected/vendor/nqxcode/zendsearch/library/ZendSearch/Lucene/Index/SegmentWriter/StreamWriter.php(68): ZendSearch\Lucene\Index\SegmentWriter\AbstractSegmentWriter->_generateCFS() #2 /home/joeworkman/websites/community.weavers.space/protected/vendor/nqxcode/zendsearch/library/ZendSearch/Lucene/Index/SegmentMerger.php(117): ZendSearch\Lucene\Index\SegmentWriter\StreamWriter->close() #3 /home/joeworkman/websites/community.weavers.space/protected/vendor/nqxcode/zendsearch/library/ZendSearch/Lucene/Index/Writer.php(370): ZendSearch\Lucene\Index\SegmentMerger->merge() #4 /home/joeworkman/websites/community.weavers.space/protected/vendor/nqxcode/zendsearch/library/ZendSearch/Lucene/Index/Writer.php(790): ZendSearch\Lucene\Index\Writer->_mergeSegments() #5 /home/joeworkman/websites/community.weavers.space/protected/vendor/nqxcode/zendsearch/library/ZendSearch/Lucene/Index.php(1178): ZendSearch\Lucene\Index\Writer->optimize() #6 /home/joeworkman/websites/community.weavers.space/protected/humhub/modules/search/engine/ZendLuceneSearch.php(333): ZendSearch\Lucene\Index->optimize() #7 /home/joeworkman/websites/community.weavers.space/protected/humhub/modules/search/Events.php(35): humhub\modules\search\engine\ZendLuceneSearch->optimize() #8 [internal function]: humhub\modules\search\Events::onHourlyCron() #9 /home/joeworkman/websites/community.weavers.space/protected/vendor/yiisoft/yii2/base/Event.php(310): call_user_func() #10 /home/joeworkman/websites/community.weavers.space/protected/vendor/yiisoft/yii2/base/Component.php(636): yii\base\Event::trigger() #11 /home/joeworkman/websites/community.weavers.space/protected/humhub/commands/CronController.php(102): yii\base\Component->trigger() #12 /home/joeworkman/websites/community.weavers.space/protected/humhub/commands/CronController.php(54): humhub\commands\CronController->runHourly() #13 [internal function]: humhub\commands\CronController->actionRun() #14 /home/joeworkman/websites/community.weavers.space/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array() #15 /home/joeworkman/websites/community.weavers.space/protected/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams() #16 /home/joeworkman/websites/community.weavers.space/protected/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction() #17 /home/joeworkman/websites/community.weavers.space/protected/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction() #18 /home/joeworkman/websites/community.weavers.space/protected/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction() #19 /home/joeworkman/websites/community.weavers.space/protected/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction() #20 /home/joeworkman/websites/community.weavers.space/protected/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest() #21 /home/joeworkman/websites/community.weavers.space/protected/yii(29): yii\base\Application->run() #22 {main}

Additional info

Q A
HumHub version 1.3.20
PHP version 7.4
Operating system Ubuntu 19
@buddh4
Copy link
Contributor

buddh4 commented Feb 2, 2020

So you are running php yii search/rebuild? The error above is thrown by the hourly cron (which calls ZendLuceneSearch->optimize()), which probably interfers your index rebuild. Any idea @luke- ?
Perhaps we need to lock the index somehow?

@marc-farre
Copy link
Collaborator

I had the same problem, and disabling the cron while rebuilding solves the problem.
I think we should write in the documentation to temporary disable the cron while executing php yii search/rebuild

@luke-
Copy link
Contributor

luke- commented Nov 2, 2021

@funkycram Thanks for the info. I'll close this issue. Should we add some additional info to the docs?

@luke- luke- closed this as completed Nov 2, 2021
@marc-farre
Copy link
Collaborator

@luke- Yes. In https://github.com/humhub/documentation/blob/master/docs/admin/search.md#index-rebuilding we should advise to disable cron before index rebuilding are re-enabling cron again just after.

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

4 participants