Forum OpenACS Development: Re: Adding file from outside FS pkg
as always, you can expect more and better answers, when you make the behavior reproduciable, by adding precise version numbers, etc. Forthermore, the right place for error reports is the issue tracker.
The error you sees comes from the indexer of the search package. When the issues does not show up for files added via the web interface of the file storage, but only files added via your custom code (that nobody can reproduce) then it seems most straightforward to compare what's different between these cases in your database.