Class 'Zend_Search_Lucene_Exception' not found

Hi,
I upgraded my SuiteCRM version from 7.10 to 7.11.18 and now I have this error always when I’m trying to search or edit something:

**Fatal error** : Uncaught Error: Class 'Zend_Search_Lucene_Exception' not found in /home/customer/www/crm.controlink.pt/public_html/Controlink/vendor/zf1/zend-search-lucene/library/Zend/Search/Lucene/Storage/File/Filesystem.php:67 Stack trace: #0 /home/customer/www/crm.controlink.pt/public_html/Controlink/vendor/zf1/zend-search-lucene/library/Zend/Search/Lucene/Storage/Directory/Filesystem.php(361): Zend_Search_Lucene_Storage_File_Filesystem->__construct('modules/AOD_Ind...') #1 /home/customer/www/crm.controlink.pt/public_html/Controlink/vendor/zf1/zend-search-lucene/library/Zend/Search/Lucene/Index/SegmentInfo.php(780): Zend_Search_Lucene_Storage_Directory_Filesystem->getFileObject('_13ye.sti') #2 /home/customer/www/crm.controlink.pt/public_html/Controlink/vendor/zf1/zend-search-lucene/library/Zend/Search/Lucene/Index/SegmentInfo.php(829): Zend_Search_Lucene_Index_SegmentInfo->_loadDictionaryIndex() #3 /home/customer/www/crm.controlink.pt/public_html/Controlink/vendor/zf1/zend-search-lucene/library/Zend/Search/Lucene.php(117 in **/home/customer/www/crm.controlink.pt/public_html/Controlink/vendor/zf1/zend-search-lucene/library/Zend/Search/Lucene/Storage/File/Filesystem.php** on line **67**

What I can do to solve it?
I already runned composer install --no-dev and composer update
I hosted the crm in SiteGround.

Thanks,
Fairydx

composer update breaks the installation (installs versions newer than the ones tested).

You should just do the install --no-dev.

You can put the vendor directory back to normal by deleting it entirely (or renaming it, for safety, then delete later) and running composer install --no-dev

None of that should be necessary anyway, the installers take care of that directory.

It’s possible there is a bug anyway, but you need to start by getting the vendor directory right.

I did that but the error stays there…
output of composer command:

Loading composer repositories with package information
Installing dependencies from lock file
Package operations: 92 installs, 0 updates, 0 removals
  - Installing kylekatarnls/update-helper (1.2.1): Downloading (100%)
  - Installing wikimedia/composer-merge-plugin (v1.4.1): Downloading (100%)
  - Installing symfony/process (v3.4.47): Loading from cache
  - Installing symfony/finder (v3.4.47): Loading from cache
  - Installing symfony/polyfill-ctype (v1.19.0): Downloading (100%)
  - Installing symfony/filesystem (v3.4.47): Loading from cache
  - Installing symfony/event-dispatcher (v3.4.47): Loading from cache
  - Installing symfony/polyfill-mbstring (v1.19.0): Downloading (100%)
  - Installing psr/log (1.1.3): Downloading (100%)
  - Installing symfony/debug (v3.4.47): Loading from cache
  - Installing symfony/console (v3.4.47): Loading from cache
  - Installing psr/container (1.0.0): Downloading (100%)
  - Installing container-interop/container-interop (1.2.0): Downloading (100%)
  - Installing league/container (2.4.1): Downloading (100%)
  - Installing symfony/yaml (v3.4.47): Loading from cache
  - Installing dflydev/dot-access-data (v1.1.0): Downloading (100%)
  - Installing grasmash/yaml-expander (1.4.0): Downloading (100%)
  - Installing consolidation/self-update (1.2.0): Downloading (100%)
  - Installing consolidation/output-formatters (3.5.1): Downloading (100%)
  - Installing consolidation/log (1.1.1): Downloading (100%)
  - Installing grasmash/expander (1.0.0): Downloading (100%)
  - Installing consolidation/config (1.2.1): Downloading (100%)
  - Installing consolidation/annotated-command (2.12.1): Downloading (100%)
  - Installing consolidation/robo (1.4.13): Downloading (100%)
  - Installing react/promise (v2.8.0): Downloading (100%)
  - Installing guzzlehttp/streams (3.0.0): Downloading (100%)
  - Installing guzzlehttp/ringphp (1.1.1): Downloading (100%)
  - Installing elasticsearch/elasticsearch (v5.5.0): Downloading (100%)
  - Installing ezyang/htmlpurifier (v4.13.0): Downloading (100%)
  - Installing phpseclib/phpseclib (2.0.29): Downloading (100%)
  - Installing monolog/monolog (1.25.5): Downloading (100%)
  - Installing ralouphie/getallheaders (3.0.3): Downloading (100%)
  - Installing psr/http-message (1.0.1): Downloading (100%)
  - Installing guzzlehttp/psr7 (1.7.0): Downloading (100%)
  - Installing symfony/polyfill-php72 (v1.19.0): Downloading (100%)
  - Installing paragonie/random_compat (v2.0.19): Downloading (100%)
  - Installing symfony/polyfill-php70 (v1.19.0): Downloading (100%)
  - Installing symfony/polyfill-intl-normalizer (v1.19.0): Downloading (100%)
  - Installing symfony/polyfill-intl-idn (v1.19.0): Downloading (100%)
  - Installing guzzlehttp/promises (1.4.0): Downloading (100%)
  - Installing guzzlehttp/guzzle (6.5.5): Downloading (100%)
  - Installing psr/cache (1.0.1): Downloading (100%)
  - Installing firebase/php-jwt (v5.2.0): Downloading (100%)
  - Installing google/auth (v1.14.3): Downloading (100%)
  - Installing google/apiclient-services (v0.156): Loading from cache
  - Installing google/apiclient (v2.8.3): Loading from cache
  - Installing google/recaptcha (1.2.4): Downloading (100%)
  - Installing gymadarasz/ace (v1.2.3.stable): Downloading (100%)
  - Installing gymadarasz/imagesloaded (v4.1.01): Downloading (100%)
  - Installing justinrainbow/json-schema (5.2.10): Downloading (100%)
  - Installing league/event (2.2.0): Downloading (100%)
  - Installing lcobucci/jwt (3.4.1): Loading from cache
  - Installing defuse/php-encryption (v2.2.1): Downloading (100%)
  - Installing league/oauth2-server (5.1.6): Downloading (100%)
  - Installing jeremykendall/php-domain-parser (4.0.3-alpha): Downloading (100%)
  - Installing league/uri (4.2.3): Downloading (100%)
  - Installing symfony/translation (v3.4.47): Loading from cache
  - Installing nesbot/carbon (1.39.1): Downloading (100%)
  - Installing robrichards/xmlseclibs (3.1.1): Downloading (100%)
  - Installing onelogin/php-saml (3.5.1): Loading from cache
  - Installing phpmailer/phpmailer (v6.2.0): Loading from cache
  - Installing pimple/pimple (v3.2.3): Downloading (100%)
  - Installing nikic/fast-route (v1.3.0): Downloading (100%)
  - Installing slim/slim (3.12.3): Downloading (100%)
  - Installing smarty/smarty (v2.6.31): Downloading (100%)
  - Installing soundasleep/html2text (0.5.0): Downloading (100%)
  - Installing symfony/options-resolver (v3.4.47): Loading from cache
  - Installing symfony/polyfill-iconv (v1.19.0): Downloading (100%)
  - Installing symfony/validator (v3.4.47): Loading from cache
  - Installing tinymce/tinymce (4.9.11): Downloading (100%)
  - Installing tuupola/slim-jwt-auth (2.4.0): Downloading (100%)
  - Installing phpoption/phpoption (1.7.5): Downloading (100%)
  - Installing vlucas/phpdotenv (v3.6.7): Downloading (100%)
  - Installing zbateson/mb-wrapper (1.0.1): Downloading (100%)
  - Installing zbateson/stream-decorators (1.0.4): Downloading (100%)
  - Installing zbateson/mail-mime-parser (1.3.1): Loading from cache
  - Installing zf1/zend-exception (1.12.20): Downloading (100%)
  - Installing zf1/zend-cache (1.12.20): Downloading (100%)
  - Installing zf1/zend-xml (1.12.20): Downloading (100%)
  - Installing zf1/zend-version (1.12.20): Downloading (100%)
  - Installing zf1/zend-mime (1.12.20): Downloading (100%)
  - Installing zf1/zend-locale (1.12.20): Downloading (100%)
  - Installing zf1/zend-loader (1.12.20): Downloading (100%)
  - Installing zf1/zend-validate (1.12.20): Downloading (100%)
  - Installing zf1/zend-uri (1.12.20): Downloading (100%)
  - Installing zf1/zend-http (1.12.20): Downloading (100%)
  - Installing zf1/zend-gdata (1.12.20): Downloading (100%)
  - Installing zf1/zend-crypt (1.12.20): Downloading (100%)
  - Installing zf1/zend-oauth (1.12.20): Downloading (100%)
  - Installing zf1/zend-registry (1.12.20): Downloading (100%)
  - Installing zf1/zend-search (1.12.20): Downloading (100%)
  - Installing zf1/zend-search-lucene (1.12.20): Downloading (100%)
Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Package guzzlehttp/streams is abandoned, you should avoid using it. No replacement was suggested.
Package guzzlehttp/ringphp is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
Carbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
    You can run './vendor/bin/upgrade-carbon' to get help in updating carbon and other frameworks and libraries that depend on it.
Loading composer repositories with package information
Installing dependencies from lock file
Nothing to install or update
Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Package guzzlehttp/ringphp is abandoned, you should avoid using it. No replacement was suggested.
Package guzzlehttp/streams is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
Carbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
    You can run './vendor/bin/upgrade-carbon' to get help in updating carbon and other frameworks and libraries that depend on it.
> rm -Rf vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests
> mv vendor/google/apiclient-services/src/Google/Service/Calendar* vendor/google/apiclient-services/src/Google/
> rm -Rf vendor/google/apiclient-services/src/Google/Service/*
> mv vendor/google/apiclient-services/src/Google/Calendar* vendor/google/apiclient-services/src/Google/Service/
> rm -Rf vendor/elasticsearch/elasticsearch/tests/Elasticsearch/Tests
> mv vendor/google/apiclient-services/src/Google/Service/Calendar* vendor/google/apiclient-services/src/Google/
> rm -Rf vendor/google/apiclient-services/src/Google/Service/*
> mv vendor/google/apiclient-services/src/Google/Calendar* vendor/google/apiclient-services/src/Google/Service/

Did you do that after deleting the vendor directory to get a fresh start?

Yes, I renamed it to vendor.old

Please check the ownership/permissions on the entire vendor directory.

Anyway - Googling this error, I see many people have seen it before. There is likely something wrong, but I don’t know what it is… :man_shrugging:

What permission it should have?

On linux,

  sudo chown -R www-data:www-data .
  sudo chmod -R 755 .
  sudo chmod -R 775 cache custom modules themes data upload
  sudo chmod 775 config_override.php 2>/dev/null

See more info here - https://docs.suitecrm.com/admin/installation-guide/downloading-installing/

Does the error prevent you for Searching or editing? or just appear in the logs?

Its preventing me from all that uses SuiteCRM user’s and search’s

Could you send me a screenshot of what your getting on screen? If anything that is

There it is, when I disable AOD everything works fine.

This can’t be a complete stack trace, it doesn’t reference any SuiteCRM code, only Lucene code… if you had a complete stack trace (from the logs perhaps) it might help figure out where this call is coming from…

I have this on logs of php

2020-12-07 12:24:59 UTC [apache][warn-ioncube] mmap cache can't open /home/customer/www/crm.controlink.pt/public_html/Controlink/vendor/zf1/zend-search-lucene/library/Zend/Search/Lucene/Exception.php - Too many open files (pid 62609 th 671086336)
2020-12-07 12:24:59 UTC [apache][php7:error] [pid 62609] [client 85.138.176.178:12136] PHP Fatal error:  Uncaught Error: Class 'Zend_Search_Lucene_Exception' not found in /home/customer/www/crm.controlink.pt/public_html/Controlink/vendor/zf1/zend-search-lucene/library/Zend/Search/Lucene/Storage/File/Filesystem.php:67\nStack trace:\n#0 /home/customer/www/crm.controlink.pt/public_html/Controlink/vendor/zf1/zend-search-lucene/library/Zend/Search/Lucene/Storage/Directory/Filesystem.php(361): Zend_Search_Lucene_Storage_File_Filesystem->__construct('modules/AOD_Ind...')\n#1 /home/customer/www/crm.controlink.pt/public_html/Controlink/vendor/zf1/zend-search-lucene/library/Zend/Search/Lucene/Index/SegmentInfo.php(780): Zend_Search_Lucene_Storage_Directory_Filesystem->getFileObject('_13ye.sti')\n#2 /home/customer/www/crm.controlink.pt/public_html/Controlink/vendor/zf1/zend-search-lucene/library/Zend/Search/Lucene/Index/SegmentInfo.php(829): Zend_Search_Lucene_Index_S

No good, that has 2 levels of stack trace instead of the 6 above… look for the #1 #2 markers.

I made a very cool improvement to SuiteCRM logging to get us all this information easily:

but somebody forgot to merge it :slight_smile:

Getting back to your error:

If you are a developer, and I think you are, you should be able to debug this with an IDE like PHPStorm, Eclipse, etc. Use XDEBUG.

I cant add variables to php.ini on sitegroud, just change the already existing variables :confused:

But I saw that php trimmed the string at 1024 I put that to 9999999 and now there is the error:

I only find one instance of Zend_Search_Lucene_Exception in the code:

–> https://github.com/salesagility/SuiteCRM/search?q=Zend_Search_Lucene_Exception

and it’s in the tests, it really shouldn’t affect anything.

Maybe that name is some autoloading scheme that builds the class name from some convention, and that makes it more difficult to debug… except of course with a debugger.

Can I put that class on some php file?

Try going in

vendor/zf1/zend-search-lucene/library/Zend/Search/Lucene/Storage/File/Filesystem.php

The error is in line 67, which looks like this:

        if ($this->_fileHandle === false) {
            ini_set('track_errors', $trackErrors);
            // require_once 'Zend/Search/Lucene/Exception.php';
            throw new Zend_Search_Lucene_Exception($php_errormsg);
        }

Try uncommenting the require_once.

If this works, it is not a proper fix, just a workaround…

I did that and now I have this error:

    Fatal error: Uncaught Error: Call to a member function call_custom_logic() on bool in /home/customer/www/crm.controlink.pt/public_html/Controlink/data/Relationships/SugarRelationship.php:420 Stack trace: 
#0 /home/customer/www/crm.controlink.pt/public_html/Controlink/data/Relationships/One2MBeanRelationship.php(161): SugarRelationship->callBeforeDelete(false, Object(aCase)) 
#1 /home/customer/www/crm.controlink.pt/public_html/Controlink/data/Relationships/SugarRelationship.php(164): One2MBeanRelationship->remove(false, Object(aCase)) 
#2 /home/customer/www/crm.controlink.pt/public_html/Controlink/data/Link2.php(634): SugarRelationship->removeAll(Object(Link2)) 
#3 /home/customer/www/crm.controlink.pt/public_html/Controlink/data/SugarBean.php(5414): Link2->delete('1acf2b78-17d5-b...') 
#4 /home/customer/www/crm.controlink.pt/public_html/Controlink/data/SugarBean.php(5394): SugarBean->delete_linked('1acf2b78-17d5-b...') 
#5 /home/customer/www/crm.controlink.pt/public_html/Controlink/data/SugarBean.php(5220): SugarBean->mark_relationships_deleted('1acf2b78-17d5-b...') 
#6 /home/customer/www/crm.controlink.pt/public_html/Controlink/include/MassUpdate.php(286): SugarBean->mark_deleted('1acf2b78-17d5-b...') 
#7 /home/customer/www/crm.controlink.pt/public_html/Controlink/include/MVC/Controller/SugarController.php(781): MassUpdate->handleMassUpdate() 
#8 /home/customer/www/crm.controlink.pt/public_html/Controlink/include/MVC/Controller/SugarController.php(525): SugarController->action_massupdate() 
#9 /home/customer/www/crm.controlink.pt/public_html/Controlink/include/MVC/Controller/SugarController.php(494): SugarController->do_action() 
#10 /home/customer/www/crm.controlink.pt/public_html/Controlink/include/MVC/Controller/SugarController.php(468): SugarController->handle_action()
 #11 /home/customer/www/crm.controlink.pt/public_html/Controlink/include/MVC/Controller/SugarController.php(373): SugarController->process() 
#12 /home/customer/www/crm.controlink.pt/public_html/Controlink/include/MVC/SugarApplication.php(113): SugarController->execute() 
#13 /home/customer/www/crm.controlink.pt/public_html/Controlink/index.php(52): SugarApplication->execute() 
#14 {main} thrown in /home/customer/www/crm.controlink.pt/public_html/Controlink/data/Relationships/SugarRelationship.php on line 420

That surely is unrelated, no? It seems to be running form a Mass update

Do you have any custom code? Logic hooks etc?