Incorrect warning for system requirements for APCu memory

Created on 1 August 2025, 1 day ago

Problem/Motivation

CI Builds (example: https://git.drupalcode.org/project/drupal/-/jobs/6080555) are failing on docroot/core/modules/system/tests/src/Functional/System/StatusTest.php:

Status (Drupal\Tests\system\Functional\System\Status)
     ✘ Status page
       ┐
       ├ Failed asserting that true is false.
       │
       │ /builds/project/drupal/core/modules/system/tests/src/Functional/System/StatusTest.php:207
       ┴
     ✔ Error element count
     ✔ Warning element count
    
    FAILURES!
    Tests: 3, Assertions: 46, Failures: 1, PHPUnit Deprecations: 8.

Browser output shows that the failure is coming from a warning generated on APCu size:

Enabled (2.93 GB)
Depending on your configuration, Drupal can run with a 2.93 GB APCu limit. However, a 32 MB APCu limit (the default) or above is recommended, especially if your site uses additional custom or contributed modules.

This does not make much sense, since 2.93 GB is clearly much larger than 32 MB.

Relevant code is in Drupal\system\Install\Requirements\SystemRequirements:

       $memory_info = apcu_sma_info(TRUE);
        $apcu_actual_size = ByteSizeMarkup::create($memory_info['seg_size'] * $memory_info['num_seg']);
        $apcu_recommended_size = '32 MB';
        $requirements['php_apcu_enabled']['value'] = t('Enabled (@size)', ['@size' => $apcu_actual_size]);
        if (Bytes::toNumber(ini_get('apc.shm_size')) * ini_get('apc.shm_segments') < Bytes::toNumber($apcu_recommended_size)) {
          $requirements['php_apcu_enabled']['severity'] = RequirementSeverity::Warning;
          $requirements['php_apcu_enabled']['description'] = t('Depending on your configuration, Drupal can run with a @apcu_size APCu limit. However, a @apcu_default_size APCu limit (the default) or above is recommended, especially if your site uses additional custom or contributed modules.', [
            '@apcu_size' => $apcu_actual_size,
            '@apcu_default_size' => $apcu_recommended_size,
          ]);
        }

This was last changed in 🐛 APCu requirement for 32M is checking wrong value Needs review .

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

11.0 🔥

Component

system.module

Created by

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

Comments & Activities

Production build 0.71.5 2024