Project

General

Profile

Actions

Bug #104039

closed

Uncaught TYPO3 Exception: fwrite(): Argument #2 ($data) must be of type string, false given | TypeError thrown in file GeneralUtility.php in line 1604.

Added by Bastian Holzem 5 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2024-06-11
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

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


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Bug #101998: Argument #2 ($data) must be of type string, bool given | GeneralUtility.php in line 1587Accepted2023-09-21

Actions
Actions #1

Updated by Bastian Holzem 5 months ago

  • Related to Bug #101998: Argument #2 ($data) must be of type string, bool given | GeneralUtility.php in line 1587 added
Actions #2

Updated by Oliver Hader 5 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!

Actions #3

Updated by Bastian Holzem 5 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

Actions #4

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.

Actions #5

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. 😉

Actions

Also available in: Atom PDF