Bug #104039
closedUncaught TYPO3 Exception: fwrite(): Argument #2 ($data) must be of type string, false given | TypeError thrown in file GeneralUtility.php in line 1604.
0%
Description
Core: Exception handler (WEB): Uncaught TYPO3 Exception: fwrite(): Argument #2 ($data) must be of type string, false given | TypeError thrown in file /../vendor/typo3/cms-core/Classes/Utility/GeneralUtility.php in line 1604.
Files
Updated by Bastian Holzem 6 months ago
- Related to Bug #101998: Argument #2 ($data) must be of type string, bool given | GeneralUtility.php in line 1587 added
Updated by Oliver Hader 6 months ago
- Status changed from New to Needs Feedback
Can you please provide the location/class that is calling \TYPO3\CMS\Core\Utility\GeneralUtility::writeFile
? Thanks!
Updated by Bastian Holzem 6 months ago
Oliver Hader wrote in #note-2:
Can you please provide the location/class that is calling
\TYPO3\CMS\Core\Utility\GeneralUtility::writeFile
? Thanks!
error occurred directly after updating TYPO3 12.4.15 to TYPO3 12.4.16
but probably only once, now it doesn't occur anymore, I'll have to check again with the next update
Updated by Georg Ringer 5 months ago
- Status changed from Needs Feedback to Closed
Hey Bastian,
as this happened only once I am closing this issue. Feel free to open a new issue if this can be reproduced on a setup and is not related to e.g. switching versions and not clearing various caches.
Updated by Felix Heller 4 months ago
I stumbled across the same problem. It always occurs once after a TYPO3 surf deployment was run for the affected project.
The reason was a missing JavaScript file that I tried to include in TypoScript:
page.includeJS.nonExistingFile = EXT:foo/Resources/Public/JavaScript/Build/config.js
TYPO3 tries to compress this file and calls GeneralUtility::getUrl
for this path. As there is no such file, the getUrl
method returns false
, but then the ResourceCompressor
tries to write false
(bool) into a file in typo3temp/assets/compressed/external-abcdefgh12345678
.
This is the call stack of PHP Xdebugger:
The solution for this problem in my case was quite simple: Don't include non-existing JavaScript files in TypoScript. 😉