Bug #79955
closed
Warning in SessionService Length parameter must be greater than 0
Added by Georg Ringer over 7 years ago.
Updated about 7 years ago.
Sprint Focus:
Stabilization Sprint
Description
Getting the error
#1476107295: PHP Warning: fread(): Length parameter must be greater than 0 in /app/vendor/typo3/cms/typo3/sysext/install/Classes/Service/SessionService.php line 392 (More information)
however don't really know how to reproduce
- Assignee set to Timo Hund
I had a look at this issue and figured out the following:
1. The error happens when somehow :D an empty session file is generated in "typo3temp/var/InstallToolSessions/<sessionFolder>/hash_<sessionName>
I would say a fix should be to check if result of filesize is not 0 and not false:
$length = filesize($sessionFile);
if(!empty($length)) {
$content = fread($fd, $length);
}
What i currently don't understand, how this could happen. One possible reason is that for example the write method is
interrupted between "ftruncate" and "fwrite" which would result in a left empty file. If you force this by terminating the write process randomly at that point you have the desrcibed problem. Once an empty session file is there you continuesly have this error message in the install tool. By now i did not find another way to reproduce this.
Another way to force the error is to just truncate the file on the filesystem.
- Status changed from Accepted to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF