Reindex error: "failed to open stream: Too many open files"

2,132 views
Skip to first unread message

Vincent

unread,
Nov 23, 2009, 1:20:33 AM11/23/09
to ICA-AtoM Users
Hi there!

Now, I thought I had everything working with creating and restoring
backups, reindexing by executing "php symfony search:populate
QubitSearch" and so on...

However... now I received the following error some time after
executing the reindex statement:

-------------
Warning: Zend_Search_Lucene_Storage_Directory_Filesystem::require_once
(Zend/Search/Lucene/Storage/File/Filesystem.php): failed to open
stream: Too many open files in /path/icaatom-1.0.8.1/plugins/
sfLucenePlugin/lib/vendor/Zend/Search/Lucene/Storage/Directory/
Filesystem.php on line 183

Fatal error:
Zend_Search_Lucene_Storage_Directory_Filesystem::require_once():
Failed opening required 'Zend/Search/Lucene/Storage/File/
Filesystem.php' (include_path='/path/icaatom-1.0.8.1/plugins/
sfLucenePlugin/lib/vendor:/path/icaatom-1.0.8.1/lib/vendor/symfony/lib/
plugins/sfPropelPlugin/lib/vendor:/path/icaatom-1.0.8.1:/path/
icaatom-1.0.8.1/lib/vendor/symfony/lib:/path/icaatom-1.0.8.1/lib/
vendor/symfony/lib/plugins/sfPropelPlugin/lib/task:/usr/local/lib/
php') in /path/icaatom-1.0.8.1/plugins/sfLucenePlugin/lib/vendor/Zend/
Search/Lucene/Storage/Directory/Filesystem.php on line 183
[root@localhost icaatom-1.0.8.1]#
-------------

When I opened ICA AtoM, only 43 of the 480 archival descriptions were
visible. I have executed the statement while I had ICA AtoM open in a
browser, but closing this browser and re-run the statement did not
make any difference.

Anyone any idea how to close some files?

Jesús García Crespo

unread,
Nov 23, 2009, 12:37:29 PM11/23/09
to ica-ato...@googlegroups.com
Hi Vincent!
You can increase this limit running:

$ ulimit -n 10000
to set 10,000 as a new limit.

To get the current limit:

$ ulimit -n

Regards,

--
Jesús García Crespo

David Juhasz

unread,
Nov 23, 2009, 1:56:12 PM11/23/09
to ica-ato...@googlegroups.com
On 23-Nov-09, at 9:37 AM, Jesús García Crespo wrote:

You can increase this limit running:

$ ulimit -n 10000
to set 10,000 as a new limit.

To get the current limit:

$ ulimit -n

Please note that some systems have other ceilings that will limit the number of open files (e.g. kern.maxfiles and kern.maxfilesperproc on Mac OS X [1]).



David Juhasz,
Software Engineer, Artefactual Systems Inc.

Vincent

unread,
Nov 25, 2009, 1:19:36 AM11/25/09
to ICA-AtoM Users
Thanks, setting ulimit solved one problem, but now I hit another one.
Instead of 43 archival descriptions, there are 84 loaded. The error in
the shell:

-----
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried
to allocate 53 bytes) in /path/icaatom-1.0.8.1/lib/model/om/
BaseInformationObject.php on line 73
[root@localhost icaatom-1.0.8.1]
-----

By the way, it is about 480 archival descriptions in a backup file
with a size of 1,7 MB. I use Fedora 10. I have looked at
http://krypted.com/mac-os-x/maximum-files-in-mac-os-x/ shortly. Maybe
I have to look at it closer (and I haven't google the error yet), but
this is the situation at this moment...

Jesús García Crespo

unread,
Nov 25, 2009, 8:11:07 AM11/25/09
to ica-ato...@googlegroups.com
Hi Vincent

I am not sure if I told you this before, because I saw this problem many times in the last weeks. PHP installations normally come with a memory limit to prevent bad written scripts for eating up all available memory on a server.

Five days ago I wrote a message that will help you:

Please, tell me if you find more difficulties. Take into account that message talks about a memory_limit problem with data-load task. Of course, after you modify your PHP memory_limit, you should run rebuild index task.

Best regards,

--
Jesús García Crespo

David at Artefactual

unread,
Nov 25, 2009, 6:35:44 PM11/25/09
to ICA-AtoM Users

David at Artefactual

unread,
Nov 25, 2009, 6:38:43 PM11/25/09
to ICA-AtoM Users
Hi Vincent,

Also this issue also has more information about the file limit
problem:
http://code.google.com/p/qubit-toolkit/issues/detail?id=1054

Vincent

unread,
Nov 28, 2009, 1:59:25 PM11/28/09
to ICA-AtoM Users
Hi Jesus and David

I got the backup restored by first setting memory_limit to a higher
value, then reboot and then setting ulimit to a much higher value.
(First I left the reboot-step out, but I got the same result as
before.

Putting back the backup took at least 3 hours (maybe a bit more), but
now I have something.

Thanks for all the information!
Reply all
Reply to author
Forward
0 new messages