Fatal error - memory exhausted

Created on 10 March 2025, 26 days ago

Problem/Motivation

When running drush queue-run search_api_attachments, we get the following error:

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 173770576 bytes) in /var/www/html/docroot/modules/contrib/search_api_attachments/src/Plugin/search_api_attachments/SolrExtractor.php on line 88

Steps to reproduce

1. Install the module on a site with existing documents
2. Run the queue

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

9.0

Component

Code

Created by

🇬🇧United Kingdom malcomio

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @malcomio
  • Pipeline finished with Success
    26 days ago
    Total: 199s
    #444615
  • First commit to issue fork.
  • Pipeline finished with Success
    25 days ago
    Total: 147s
    #445485
  • Pipeline finished with Success
    25 days ago
    Total: 151s
    #445561
  • 🇬🇧United Kingdom malcomio

    Possibly related to the following issues on older branches:

    #2474849: Ignore attachments based on uri, filesize or file extension
    🐛 Request Entity Too Large Closed: cannot reproduce

    Perhaps the way forward would be to limit extraction by file size.

    There is a config option in the schema, and this is configurable via the Search API processors form.

    We saw the error with the following config:

      file_attachments:
        excluded_extensions: 'aif art avi bmp gif ico mov oga ogv png psd ra ram rgb flv'
        number_indexed: 0
        number_first_bytes: '1 MB'
        max_filesize: '0'
        excluded_private: 1
        excluded_mimes: 'audio/x-aiff image/x-jg video/x-msvideo image/x-ms-bmp image/gif image/vnd.microsoft.icon video/quicktime audio/ogg video/ogg image/png image/x-photoshop audio/x-realaudio audio/x-pn-realaudio image/x-rgb video/x-flv'
     

    Perhaps we need to try changing these settings?

  • 🇬🇧United Kingdom malcomio

    It may also be worth adding extra logging, similar to 📌 Introduce debug mode - do not pollute indexing output with Tika warnings Active .

    For example, if debug mode is on, the extractor could:

    1. log details of the file before it tries to do the extraction
    2. report success or failure

  • Pipeline finished with Success
    24 days ago
    Total: 145s
    #446443
  • Pipeline finished with Success
    24 days ago
    Total: 161s
    #446524
  • Pipeline finished with Success
    24 days ago
    Total: 331s
    #446583
  • Pipeline finished with Success
    24 days ago
    Total: 163s
    #446593
Production build 0.71.5 2024