Project

General

Profile

Actions

Bug #81947

closed

Cannot autopublish workspaces with scheduler

Added by Xavier Perseguers over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
Start date:
2017-07-24
Due date:
% Done:

100%

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

Description

How-to reproduce

  • Create a workspace record
  • Create a scheduler task to auto-publish workspaces
  • Manually run the scheduler task

The page goes blank (no Xdebug) or shows something like:

Fatal error: Maximum function nesting level of '1200' reached, aborting! in /Users/xavier/Projects/TYPO3-Core/TYPO3_8-7/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php on line 325
Call Stack
#    Time    Memory    Function    Location
1    0.0034    366704    {main}( )    .../index.php:0
2    0.0597    370112    require( '/Users/xavier/Projects/TYPO3-Core/TYPO3_8-7/typo3/sysext/backend/Resources/Private/Php/backend.php' )    .../index.php:3
3    0.0597    370432    {closure:/Users/xavier/Projects/TYPO3-Core/TYPO3_8-7/typo3/sysext/backend/Resources/Private/Php/backend.php:21-25}( )    .../backend.php:25
4    0.1927    9858256    TYPO3\CMS\Backend\Http\Application->run( ??? )    .../backend.php:24
5    0.2004    10219288    TYPO3\CMS\Core\Core\Bootstrap->handleRequest( ??? )    .../Application.php:92
6    0.2026    10297384    TYPO3\CMS\Backend\Http\BackendModuleRequestHandler->handleRequest( ??? )    .../Bootstrap.php:310
7    0.3318    19002136    TYPO3\CMS\Backend\Http\BackendModuleRequestHandler->dispatchModule( ??? )    .../BackendModuleRequestHandler.php:89
8    0.3346    19069024    TYPO3\CMS\Core\Http\Dispatcher->dispatch( ???, ??? )    .../BackendModuleRequestHandler.php:169
9    0.4416    22320160    call_user_func_array:{/Users/xavier/Projects/TYPO3-Core/TYPO3_8-7/typo3/sysext/core/Classes/Http/Dispatcher.php:41} ( ???, ??? )    .../Dispatcher.php:41
10    0.4416    22320192    TYPO3\CMS\Scheduler\Controller\SchedulerModuleController->mainAction( ???, ??? )    .../Dispatcher.php:41
11    0.4623    22768944    TYPO3\CMS\Scheduler\Controller\SchedulerModuleController->main( )    .../SchedulerModuleController.php:314
12    0.4624    22769072    TYPO3\CMS\Scheduler\Controller\SchedulerModuleController->getModuleContent( )    .../SchedulerModuleController.php:158
13    0.4625    22769448    TYPO3\CMS\Scheduler\Controller\SchedulerModuleController->executeTasks( )    .../SchedulerModuleController.php:243
14    0.4715    23450824    TYPO3\CMS\Scheduler\Scheduler->executeTask( ??? )    .../SchedulerModuleController.php:867
15    0.4828    23450936    TYPO3\CMS\Workspaces\Task\AutoPublishTask->execute( )    .../Scheduler.php:181
16    0.4894    23468392    TYPO3\CMS\Workspaces\Service\AutoPublishService->autoPublishWorkspaces( )    .../AutoPublishTask.php:34
17    0.4922    23472728    TYPO3\CMS\Core\Database\Query\QueryBuilder->execute( )    .../AutoPublishService.php:80
18    0.4928    23474152    Doctrine\DBAL\Query\QueryBuilder->execute( )    .../QueryBuilder.php:173
19    0.4928    23474152    Doctrine\DBAL\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:206
20    0.4928    23474152    Doctrine\DBAL\Query\QueryBuilder->getSQLForSelect( )    .../QueryBuilder.php:244
21    0.4929    23474336    Doctrine\DBAL\Query\Expression\CompositeExpression->__toString( )    .../QueryBuilder.php:1113
22    0.4929    23474368    implode ( ???, ??? )    .../CompositeExpression.php:122
23    0.4929    23474456    TYPO3\CMS\Core\Database\Query\QueryBuilder->__toString( )    .../CompositeExpression.php:122
24    0.4929    23474456    TYPO3\CMS\Core\Database\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:860
25    0.4934    23475880    Doctrine\DBAL\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:199
26    0.4934    23475880    Doctrine\DBAL\Query\QueryBuilder->getSQLForSelect( )    .../QueryBuilder.php:244
27    0.4935    23476064    Doctrine\DBAL\Query\Expression\CompositeExpression->__toString( )    .../QueryBuilder.php:1113
28    0.4935    23476096    implode ( ???, ??? )    .../CompositeExpression.php:122
29    0.4935    23476200    TYPO3\CMS\Core\Database\Query\QueryBuilder->__toString( )    .../CompositeExpression.php:122
30    0.4935    23476200    TYPO3\CMS\Core\Database\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:860
31    0.4941    23477624    Doctrine\DBAL\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:199
32    0.4941    23477624    Doctrine\DBAL\Query\QueryBuilder->getSQLForSelect( )    .../QueryBuilder.php:244
33    0.4942    23477808    Doctrine\DBAL\Query\Expression\CompositeExpression->__toString( )    .../QueryBuilder.php:1113
34    0.4942    23477840    implode ( ???, ??? )    .../CompositeExpression.php:122
35    0.4942    23477960    TYPO3\CMS\Core\Database\Query\QueryBuilder->__toString( )    .../CompositeExpression.php:122
36    0.4942    23477960    TYPO3\CMS\Core\Database\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:860
37    0.4946    23479384    Doctrine\DBAL\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:199
38    0.4946    23479384    Doctrine\DBAL\Query\QueryBuilder->getSQLForSelect( )    .../QueryBuilder.php:244
39    0.4946    23479568    Doctrine\DBAL\Query\Expression\CompositeExpression->__toString( )    .../QueryBuilder.php:1113
40    0.4947    23479600    implode ( ???, ??? )    .../CompositeExpression.php:122
41    0.4947    23479736    TYPO3\CMS\Core\Database\Query\QueryBuilder->__toString( )    .../CompositeExpression.php:122
42    0.4947    23479736    TYPO3\CMS\Core\Database\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:860
43    0.4950    23481160    Doctrine\DBAL\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:199
44    0.4950    23481160    Doctrine\DBAL\Query\QueryBuilder->getSQLForSelect( )    .../QueryBuilder.php:244
45    0.4950    23481344    Doctrine\DBAL\Query\Expression\CompositeExpression->__toString( )    .../QueryBuilder.php:1113
46    0.4951    23481376    implode ( ???, ??? )    .../CompositeExpression.php:122
47    0.4951    23481528    TYPO3\CMS\Core\Database\Query\QueryBuilder->__toString( )    .../CompositeExpression.php:122
48    0.4951    23481528    TYPO3\CMS\Core\Database\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:860
49    0.4954    23482952    Doctrine\DBAL\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:199
50    0.4954    23482952    Doctrine\DBAL\Query\QueryBuilder->getSQLForSelect( )    .../QueryBuilder.php:244
51    0.4954    23483136    Doctrine\DBAL\Query\Expression\CompositeExpression->__toString( )    .../QueryBuilder.php:1113
52    0.4954    23483168    implode ( ???, ??? )    .../CompositeExpression.php:122
53    0.4954    23483336    TYPO3\CMS\Core\Database\Query\QueryBuilder->__toString( )    .../CompositeExpression.php:122
54    0.4954    23483336    TYPO3\CMS\Core\Database\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:860
55    0.4957    23485080    Doctrine\DBAL\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:199
56    0.4957    23485080    Doctrine\DBAL\Query\QueryBuilder->getSQLForSelect( )    .../QueryBuilder.php:244
57    0.4958    23485264    Doctrine\DBAL\Query\Expression\CompositeExpression->__toString( )    .../QueryBuilder.php:1113
58    0.4958    23485296    implode ( ???, ??? )    .../CompositeExpression.php:122
59    0.4958    23485496    TYPO3\CMS\Core\Database\Query\QueryBuilder->__toString( )    .../CompositeExpression.php:122
60    0.4958    23485496    TYPO3\CMS\Core\Database\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:860
61    0.4962    23487240    Doctrine\DBAL\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:199
62    0.4962    23487240    Doctrine\DBAL\Query\QueryBuilder->getSQLForSelect( )    .../QueryBuilder.php:244
63    0.4963    23487424    Doctrine\DBAL\Query\Expression\CompositeExpression->__toString( )    .../QueryBuilder.php:1113
64    0.4963    23487456    implode ( ???, ??? )    .../CompositeExpression.php:122
65    0.4963    23487656    TYPO3\CMS\Core\Database\Query\QueryBuilder->__toString( )    .../CompositeExpression.php:122
66    0.4963    23487656    TYPO3\CMS\Core\Database\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:860
67    0.4967    23489400    Doctrine\DBAL\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:199
68    0.4967    23489400    Doctrine\DBAL\Query\QueryBuilder->getSQLForSelect( )    .../QueryBuilder.php:244
69    0.4967    23489584    Doctrine\DBAL\Query\Expression\CompositeExpression->__toString( )    .../QueryBuilder.php:1113
70    0.4967    23489616    implode ( ???, ??? )    .../CompositeExpression.php:122
71    0.4967    23489848    TYPO3\CMS\Core\Database\Query\QueryBuilder->__toString( )    .../CompositeExpression.php:122
72    0.4967    23489848    TYPO3\CMS\Core\Database\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:860
73    0.4971    23491592    Doctrine\DBAL\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:199
74    0.4971    23491592    Doctrine\DBAL\Query\QueryBuilder->getSQLForSelect( )    .../QueryBuilder.php:244
75    0.4971    23491776    Doctrine\DBAL\Query\Expression\CompositeExpression->__toString( )    .../QueryBuilder.php:1113
76    0.4971    23491808    implode ( ???, ??? )    .../CompositeExpression.php:122
77    0.4971    23492040    TYPO3\CMS\Core\Database\Query\QueryBuilder->__toString( )    .../CompositeExpression.php:122
78    0.4971    23492040    TYPO3\CMS\Core\Database\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:860
79    0.4975    23493784    Doctrine\DBAL\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:199
80    0.4975    23493784    Doctrine\DBAL\Query\QueryBuilder->getSQLForSelect( )    .../QueryBuilder.php:244
81    0.4976    23493968    Doctrine\DBAL\Query\Expression\CompositeExpression->__toString( )    .../QueryBuilder.php:1113
82    0.4976    23494000    implode ( ???, ??? )    .../CompositeExpression.php:122
83    0.4976    23494264    TYPO3\CMS\Core\Database\Query\QueryBuilder->__toString( )    .../CompositeExpression.php:122
...

where "..." stands for "nested-looping" over:

140    0.5017    23521272    Doctrine\DBAL\Query\QueryBuilder->getSQLForSelect( )    .../QueryBuilder.php:244
141    0.5017    23521456    Doctrine\DBAL\Query\Expression\CompositeExpression->__toString( )    .../QueryBuilder.php:1113
142    0.5017    23521488    implode ( ???, ??? )    .../CompositeExpression.php:122
143    0.5017    23521912    TYPO3\CMS\Core\Database\Query\QueryBuilder->__toString( )    .../CompositeExpression.php:122
144    0.5017    23521912    TYPO3\CMS\Core\Database\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:860
145    0.5021    23524296    Doctrine\DBAL\Query\QueryBuilder->getSQL( )    .../QueryBuilder.php:199
146    0.5021    23524296    Doctrine\DBAL\Query\QueryBuilder->getSQLForSelect( )    .../QueryBuilder.php:244
147    0.5021    23524480    Doctrine\DBAL\Query\Expression\CompositeExpression->__toString( )    .../QueryBuilder.php:1113

Where to "debug"

This happens within \TYPO3\CMS\Workspaces\Service\AutoPublishService::autoPublishWorkspaces(), on line 45 where the list of workspaces to be published is prepared with code:

        $result = $queryBuilder
            ->select('uid', 'swap_modes', 'publish_time', 'unpublish_time')
            ->from('sys_workspace')
            ->where(
                $queryBuilder->expr()->eq(
                    'pid',
                    $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
                ),
                $queryBuilder->orWhere(
                    $queryBuilder->andWhere(
                        $queryBuilder->expr()->neq(
                            'publish_time',
                            $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
                        ),
                        $queryBuilder->expr()->lte(
                            'publish_time',
                            $queryBuilder->createNamedParameter($GLOBALS['EXEC_TIME'], \PDO::PARAM_INT)
                        )
                    ),
                    $queryBuilder->andWhere(
                        $queryBuilder->expr()->eq(
                            'publish_time',
                            $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
                        ),
                        $queryBuilder->expr()->neq(
                            'unpublish_time',
                            $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
                        ),
                        $queryBuilder->expr()->lte(
                            'unpublish_time',
                            $queryBuilder->createNamedParameter($GLOBALS['EXEC_TIME'], \PDO::PARAM_INT)
                        )
                    )
                )
            )
            ->execute();
Actions #1

Updated by Xavier Perseguers over 6 years ago

  • Description updated (diff)
Actions #2

Updated by Xavier Perseguers over 6 years ago

  • Description updated (diff)
Actions #3

Updated by Xavier Perseguers over 6 years ago

Same problem (even without any workspace record) with a vanilla TYPO3 9-dev (master branch).

Actions #4

Updated by Xavier Perseguers over 6 years ago

  • Status changed from New to Accepted
  • Assignee set to Xavier Perseguers

The creation of the complex query is completely wrong!

Actions #5

Updated by Gerrit Code Review over 6 years ago

  • Status changed from Accepted 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/53577

Actions #6

Updated by Gerrit Code Review over 6 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/53578

Actions #7

Updated by Xavier Perseguers over 6 years ago

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

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF