Task #78140

Disable APCu on CLI, if it was added to LocalConfiguration.php automatically while installing TYPO3

Added by Josef Glatz over 3 years ago. Updated about 1 year ago.

Status:
Under Review
Priority:
Must have
Assignee:
-
Category:
CLI
Target version:
-
Start date:
2016-10-04
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Sprint Focus:
Stabilization Sprint

Description

Problem/Description

I needed a few hours until I understood/find that a cacheConfiguration is added to LocalConfiguration (see below) if APCu is detected.

       'caching' => [
            'cacheConfigurations' => [
                'extbase_object' => [
                    'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\ApcuBackend',
                    'frontend' => 'TYPO3\\CMS\\Core\\Cache\\Frontend\\VariableFrontend',
                    'groups' => [
                        'system',
                    ],
                    'options' => [
                        'defaultLifetime' => 0,
                    ],
                ],
            ],
        ],

The big problem

There is no information or additional code added, which automatically disables APCu on CLI. If you are not deep into what APCu is or what TYPO3 do while installing the instance, you can freak out ;-)

After finishing the install wizard, the install tool DB Compare shows you

 ALTER TABLE cf_extbase_object RENAME TO zzz_deleted_cf_extbase_object
 ALTER TABLE cf_extbase_object_tags RENAME TO zzz_deleted_cf_extbase_object_tags

which could also be very confusing.


Acceptance Criteria

Possible scenario 1)

A TYPO3 integrator should get informed about what is added to LocalConfiguration automatically by the TYPO3 install process and what he has to do if he run CLI tasks/extbase command controllers.

Possible scenario 2)

An automatically added cacheConfiguration is automatically added to AdditionalConfiguration.php and wrapped into an if with a condition something like PHP_SAPI == 'cli' (or whatever is enough to fix CLI)

Possible scenario 3)

Such cache backends, which are known to not work in CLI mode must be disabled transparent.

History

#1 Updated by Gerrit Code Review over 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50089

#2 Updated by Josef Glatz over 3 years ago

  • Description updated (diff)

#3 Updated by Josef Glatz about 3 years ago

  • Description updated (diff)
  • Target version set to 8 LTS
  • Sprint Focus set to Stabilization Sprint

#4 Updated by Benni Mack almost 3 years ago

  • Target version changed from 8 LTS to Candidate for Major Version

#5 Updated by David Henninger almost 3 years ago

Once the APCu backend is enabled, the scheduler no longer works when called by PHP CLI, as Typo3 tries to use APCu, which is not available with CLI, causing the following error:

The APCu backend cannot be used because apcu is disabled on CLI.

apc.enabled does not enable APCu for CLI and there isn't a documented option to enable it either: https://secure.php.net/manual/en/apcu.configuration.php
However, the old option of its ancestor (apc.enable_cli) still works, however it is not recommend according to the old documentation: https://secure.php.net/manual/en/apc.configuration.php#ini.apc.enable-cli

Typo3 should not rely on APCu with PHP CLI as the parser.

#6 Updated by Josef Glatz almost 3 years ago

Any updates or thoughts about this problem?

#7 Updated by Josef Glatz almost 2 years ago

  • Target version deleted (Candidate for Major Version)
  • TYPO3 Version changed from 8 to 9

Problem still exists in 9.2-dev

#8 Updated by Gerrit Code Review almost 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50089

#9 Updated by Gerrit Code Review about 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50089

#10 Updated by Dirk Wenzel about 1 year ago

IMHO this solution should be available as bugfix for TYPO3 8 too.

see: https://forge.typo3.org/issues/82621

Also available in: Atom PDF