-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error during unserialize #56
Comments
Accordingly to provided message:
I thing that cache writing fails here. Not sure why, but the malformed file should be deleted anyway by delete() call after that. But it is not, cache file is still present and unserialization failes on next calls. |
likely same error as #45 |
The code itself looks atomic to me. My idea is, that malformed cache contents cames with script interruption. Any other theory? When thinking about it in common, the only safe way is file system |
@Lumeriol Do you have any notice/warning/error with |
Yes, that's what usually called non-atomic. Atomic write requires writing to another file and renaming it after. |
IMHO not necessarily. It can be done by writing "done" byte sequence and verify validity when reading header. |
Maybe related to PHP bug 77081 fixed in 7.3RC5 |
I've got the same problem on PHP 7.1.1, OS alpine:3.6 |
Could you provide Tracy dump file? |
@mrceperka Btw, which nette/cahing version? |
Version: v2.5.8. Can't provide Tracy dump file because, there is not any...
|
@milo I think that this bug was during development of new DI for Nette 3, but I don't remember it. But today I try it again with release of 7.3.0 stable and it seems everything is okay. So this topic could be closed for this problem (that was maybe in RC versions), or stay opened until fix of @mrceperka problem :) |
Version: 3.x-dev
Bug Description
unserialize(): Error at offset 0 of 145 bytes (variable number of bytes)
File: ...\nette\caching\src\Caching\Storages\FileStorage.php:333
$variable_representation | "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00a:2:{s:2:"id";b:1;s:4:"code";b:1;}" (127)
Steps To Reproduce
Problem is with PHP 7.3 (rc3) on some pages only. After refresh page there is this problem. Cache is deleted. It seems that data is from Sessions - problem start on with this code:
$this->currency = $this->facade->getById($this->sessionSection->currency['id']);
Facade:
$data = $this->db->table($this->repository)->wherePrimary($id)->fetch();
Stack trace:
2) ...\nette\caching\src\Caching\Storages\FileStorage.php:85
$meta | array (4)
time => "0.78053500 1540276060"
serialized => true
file => "../temp/cache/_Nette.Database.83a928a729900849010020b112a30316/_6034dbe4a271e54806a0513243994932"
handle => unknown type
-- | --
Content of file: 000068a:2:{s:4:"time";s:21:"0.09111900 1540276063";s:10:"serialized";b:1;} a:0:{}
Possible Solution
There is maybe dependency with solution of nette/database#208 (comment)
The text was updated successfully, but these errors were encountered: