Bug #80897

CLI typo3/sysext/core/bin/typo3 throws PHP Warning

Added by R3 H6 about 2 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
CLI
Target version:
-
Start date:
2017-04-19
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

With preset "debug" activated in Install-Tool,
calling the cli typo3/sysext/core/bin/typo3 throws:

Uncaught TYPO3 Exception #1476107295: PHP Warning: Invalid argument supplied for foreach() in /var/www/vendor/typo3/cms/typo3/sysext/core/Classes/Utility/RootlineUtility.php line 287
thrown in file /var/www/vendor/typo3/cms/typo3/sysext/core/Classes/Error/ErrorHandler.php
in line 112


Related issues

Related to TYPO3 Core - Bug #81795: New CLI API is broken with empty cache Closed 2017-07-05

Associated revisions

Revision 7d469851 (diff)
Added by Benni Mack almost 2 years ago

[BUGFIX] Populate loaded commands after ext_tables is loaded

Especially in TYPO3 v8, where TCA is not loaded at all times,
running a CLI command with an empty cache will result in
errors, but for the sake of clean structure, the commands
will be populated when executing the actual command.

Resolves: #80897
Releases: master, 8.7
Change-Id: I7ad33ca86724d94f451c44f68538d5d38e343636
Reviewed-on: https://review.typo3.org/53270
Tested-by: TYPO3com <>
Reviewed-by: Thomas Maroschik <>
Tested-by: Thomas Maroschik <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

Revision a26c128a (diff)
Added by Benni Mack almost 2 years ago

[BUGFIX] Populate loaded commands after ext_tables is loaded

Especially in TYPO3 v8, where TCA is not loaded at all times,
running a CLI command with an empty cache will result in
errors, but for the sake of clean structure, the commands
will be populated when executing the actual command.

Resolves: #80897
Releases: master, 8.7
Change-Id: I7ad33ca86724d94f451c44f68538d5d38e343636
Reviewed-on: https://review.typo3.org/53279
Tested-by: TYPO3com <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

History

#1 Updated by Benni Mack about 2 years ago

  • Status changed from New to Needs Feedback

Do you provide any arguments / specific command in the Command Line?

#2 Updated by R3 H6 almost 2 years ago

After some while I realized, it has nothing to do with the debug settings.

The error occurs on an TYPO3 installation with a custom extension which has some symfony based commands.
If I deinstall and install the extension again, the error disappears for a while, but comes back after a while.

So I guess it something related to caching.
In the configure method only setDescription, addArgument and addOption are used, not object initialization or so.

Issue can be closed, if nobody experience same problem with custom commands...

#3 Updated by Riccardo De Contardi almost 2 years ago

  • Status changed from Needs Feedback to Closed

Thank you for your feedback; I'll close this issue for now. If someone experiences the same issue and wants to add more detail , then please reopen the issue (or contact me and I will do :) )

#4 Updated by ondro no-lastname-given almost 2 years ago

R3 H6 wrote:

With preset "debug" activated in Install-Tool,
calling the cli typo3/sysext/core/bin/typo3 throws:

Uncaught TYPO3 Exception #1476107295: PHP Warning: Invalid argument supplied for foreach() in /var/www/vendor/typo3/cms/typo3/sysext/core/Classes/Utility/RootlineUtility.php line 287
thrown in file /var/www/vendor/typo3/cms/typo3/sysext/core/Classes/Error/ErrorHandler.php
in line 112

Can confirm, same behaviour for typo3 v8.7.1

When I set debug = false, console works with no problems
Setting back debug to true console works until I clear caches

#5 Updated by Thomas Maroschik almost 2 years ago

  • Status changed from Closed to Needs Feedback

Ok, here's how to reproduce the issue in 8.7.1:

  • Clear cache via install tool
  • One shouldn't be logged in in the BE, because background AJAX requests populate TCA cache
  • Call on the commandline vendor/bin/typo3 help
  • See the warning the issue author already described

The change https://review.typo3.org/#/c/52753/ fixes that problem. But it isn't solved in 8.7.

I would suggest to backport the behavior from master, or move TCA loading from the handleRequest method in the \TYPO3\CMS\Core\Console\CommandRequestHandler to it's __construct method. This way CLI works under every condition and eID is left untouched.

#6 Updated by Gerrit Code Review almost 2 years ago

  • Status changed from Needs Feedback 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/53270

#7 Updated by Gerrit Code Review almost 2 years ago

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

#8 Updated by Gerrit Code Review almost 2 years ago

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

#9 Updated by Benni Mack almost 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#10 Updated by Christian Kuhn almost 2 years ago

  • Related to Bug #81795: New CLI API is broken with empty cache added

#11 Updated by Benni Mack 7 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF