#110021Running fluid:analyse im CI pipeline
Description
Right now, if I try to run fluid:analyse in my GitLab CI pipeline, I get a database connection error. I guess it is due to some dependency to database caches. It would be cool to have this command in pipelines, without having to bootstrap a whole TYPO3 instance just for fluid template analysis.
Reviews 2
- 14.3 96707[BUGFIX] Return a failure exit code from fluid:analyze --json
- main 96686[BUGFIX] Return a failure exit code from fluid:analyze --json
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". The changes above were merged or abandoned: read them before you start. How to create a patch
- Commit message
-
[TASK] Running fluid:analyse im CI pipeline Resolves: #110021 Releases: main
Files 1
History 5
-
Simon Praetorius commented <span data-processor="relativetime" data-value="2026-06-08T15:38:32+00:00" > 06/08/26, 15:38 </span>
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2026-06-08T21:02:39+00:00" > 06/08/26, 21:02 </span>
I tried this in my monorepo TYPO3 v15 instance, I made it point to an invalid DB connection, flushed all caches and then ran “fluid:analyse”. Which worked in my instance.
So I do think an extension seems to kick in to cause this. Is there a stacktrace available to boil this down to specific VHs or templates, Nikita?
-
Nikita Hovratov commented <span data-processor="relativetime" data-value="2026-06-09T21:57:01+00:00" > 06/09/26, 21:57 </span>
You are right, only a few custom fluid templates are affected. Most probably due to custom ViewHelper usage. If it is necessary to instantiate those VHs, then this will be tricky. Only solution would be to avoid DB-dependent VHs and move the logic into the controller.
Besides this, thanks for this wonderful command, it really helped in my last upgrade to find errors, without even checking the frontend!
-
Christian Kuhn commented <span data-processor="relativetime" data-value="2026-06-09T22:52:07+00:00" > 06/09/26, 22:52 </span>
One offender on this was PageRepository with it’s init() call through __construct() that did a query right away. This was fixed with #109716 lately.
Other than cases like that, it shouldn’t be an issue to inject ConnectionPool since the connection is created lazily on first real query.
But yeah, when VH’s actively query something in __construct() (directly or indirectly), it can an issue in such cases – and it should be changed.
-
Nikita Hovratov commented and changed attached fluid-analyse.png <span data-processor="relativetime" data-value="2026-09-15T11:07:02+00:00" > 09/15/26, 11:07 </span>
Update note: There is still an issue in PageRepository.
Now the culprit is ImportMapFactory, which is not available in Failsafe Container.
Uncaught TYPO3 Exception Too few arguments to function TYPO3\CMS\Core\Page\ImportMapFactory::__construct(), 0 passed in /var/www/html/vendor/typo3/cms-core/Classes/Utility/GeneralUtility.php on line 2905 and exactly 6 expected
thrown in file /var/www/html/vendor/typo3/cms-core/Classes/Page/ImportMapFactory.php
in line 33The ViewHelper: Backend\Link EditRecordViewHelper
TYPO3 14.3.7
Hi! I already noticed this when I created the command. The problem is that the current Fluid parser needs to resolve and instantiate all used ViewHelpers in the templates. That in itself would be suboptimal, but not an issue. However, somewhere in the dependency chain there seems to be a class that already requires a database connection. So there are two possible solutions:
1. Get rid of that database dependency (somewhere?)
2. Rewrite/replace the Fluid parser
And even if we could resolve 1. in the core, this could be re-triggered by any extension in the project. So I’d say: For now we’re stuck with it. :-(