yiisoft / yii2

Yii 2: The Fast, Secure and Professional PHP Framework
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
14.24k stars 6.9k forks source link

Error in debugbar #4820

Closed ghost closed 9 years ago

ghost commented 10 years ago

Hi guys, I am working on a project using yii2 and I have noticed the the error in the attached screenshot occures very often screenshot from 2014-08-26 01 45 54

samdark commented 10 years ago

Can you zip contents of your runtime/debug and upload somewhere?

ghost commented 10 years ago

https://drive.google.com/file/d/0BxzPncT7AaXfdW8xMlN5OFRkMmM/edit?usp=sharing

samdark commented 10 years ago

Are you using code from master or beta downloaded from website?

samdark commented 10 years ago

Which PHP version do you have?

ghost commented 10 years ago

I am using code from master, downloaded via composer, below you can see composer.json file, PHP version - PHP Version 5.5.16-1+deb.sury.org~precise+1

{
    "name": "yiisoft/yii2-app-basic",
    "description": "Yii 2 Basic Application Template",
    "keywords": ["yii", "framework", "basic", "application template"],
    "homepage": "http://www.yiiframework.com/",
    "type": "project",
    "license": "BSD-3-Clause",
    "support": {
        "issues": "https://github.com/yiisoft/yii2/issues?state=open",
        "forum": "http://www.yiiframework.com/forum/",
        "wiki": "http://www.yiiframework.com/wiki/",
        "irc": "irc://irc.freenode.net/yii",
        "source": "https://github.com/yiisoft/yii2"
    },
    "minimum-stability": "dev",
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": "*",
        "yiisoft/yii2-swiftmailer": "*",
        "yiisoft/yii2-bootstrap": "*",
        "yiisoft/yii2-debug": "*",
        "yiisoft/yii2-gii": "*",
        "yiisoft/yii2-jui": "*",
        "phpmailer/phpmailer": "dev-master",
        "imagine/imagine": "~0.5.0",
        "phpoffice/phpexcel": "dev-develop",
        "kartik-v/yii2-widgets": "dev-master",
        "cinghie/yii2-tcpdf": "dev-master",
        "kartik-v/yii2-editable": "*",
        "kartik-v/yii2-grid": "*",
        "webvimark/grid-bulk-actions": "dev-master",
        "c006/yii2-migration-utility": "dev-master"
    },
    "scripts": {
        "post-create-project-cmd": [
            "yii\\composer\\Installer::setPermission"
        ]
    },
    "extra": {
        "writable": [
            "runtime",
            "web/assets"
        ],
        "executable": [
            "yii"
        ]
    }
}
martingeorg commented 10 years ago

Hello, i can confirm this problem, it's strange that it occurs sometimes, like once on every 6-7 page refreshes on the same page with no change in any data or parameters.

Never saw that error while we were still using the Beta and RC releases. The error shows no matter which page i am on.

I am using the now official 2.0 release with "PHP Version 5.5.9-1ubuntu4.4 on Linux martin-xubuntu 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64"

Unfortunately I cannot upload my runtime/debug folder as the project is not a personal one, and there is some data throughout the files that i can't make publicly accessible ;]

Here is composer.json

{ "name": "yiisoft/yii2-app-advanced", "description": "Yii 2 Advanced Application Template", "keywords": ["yii2", "framework", "advanced", "application template"], "homepage": "http://www.yiiframework.com/", "type": "project", "license": "BSD-3-Clause", "support": { "issues": "https://github.com/yiisoft/yii2/issues?state=open", "forum": "http://www.yiiframework.com/forum/", "wiki": "http://www.yiiframework.com/wiki/", "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, "minimum-stability": "stable", "require": { "php": ">=5.4.0", "yiisoft/yii2": "", "yiisoft/yii2-bootstrap": "", "yiisoft/yii2-swiftmailer": "", "yiisoft/yii2-imagine": "", "google/apiclient": "1.0.@beta" }, "require-dev": { "yiisoft/yii2-codeception": "", "yiisoft/yii2-debug": "", "yiisoft/yii2-gii": "", "yiisoft/yii2-faker": "*" }, "config": { "process-timeout": 1800 }, "extra": { "asset-installer-paths": { "npm-asset-library": "vendor/npm", "bower-asset-library": "vendor/bower" } } }

This is the actual HTML content of the debug DIV

yii 2 0 debug bar bug

PHP Warning 'yii\base\ErrorException' with message 'array_reverse() expects parameter 1 to be array, boolean given' 
in /var/www/html/copybook/vendor/yiisoft/yii2-debug/controllers/DefaultController.php:122
Stack trace:
#0 /var/www/html/copybook/vendor/yiisoft/yii2-debug/controllers/DefaultController.php(137): yii\debug\controllers\DefaultController->getManifest()
#1 /var/www/html/copybook/vendor/yiisoft/yii2-debug/controllers/DefaultController.php(92): yii\debug\controllers\DefaultController->loadData()
#2 /var/www/html/copybook/vendor/yiisoft/yii2/base/InlineAction.php(55): yii\debug\controllers\DefaultController->actionToolbar()
#3 /var/www/html/copybook/vendor/yiisoft/yii2/base/InlineAction.php(55): ::call_user_func_array()
#4 /var/www/html/copybook/vendor/yiisoft/yii2/base/Controller.php(151): yii\base\InlineAction->runWithParams()
#5 /var/www/html/copybook/vendor/yiisoft/yii2/base/Module.php(455): yii\base\Controller->runAction()
#6 /var/www/html/copybook/vendor/yiisoft/yii2/web/Application.php(83): yii\base\Module->runAction()
#7 /var/www/html/copybook/vendor/yiisoft/yii2/base/Application.php(375): yii\web\Application->handleRequest()
#8 /var/www/html/copybook/frontend/web/index.php(18): yii\base\Application->run()
#9 {main}
martingeorg commented 10 years ago

Hi again, we did some digging using this modified version of the getManifest method from yii2-debug/controllers/DefaultController.php for debugging purposes

protected function getManifest($forceReload = false)
{
    if ($this->_manifest === null || $forceReload) {
        if ($forceReload) {
            clearstatcache();
        }
        $indexFile = $this->module->dataPath . '/index.data';
        $fileContent = file_get_contents($indexFile);
        $unserializedData = unserialize($fileContent);
        echo '<div style="background-color:#f00; color:#fff; position:absolute; top:1px; left:1px; z-index:999999;">unserializeResultType=['.( gettype($unserializedData) )
            .'] fileExists='. file_exists($indexFile) . ' fileSize=' . filesize($indexFile) .' isFile='. is_file($indexFile) .' isReadale='. is_readable($indexFile) .' </div>';
        echo $fileContent;
        die;

        if (is_file($indexFile) && is_readable($indexFile)) {
            $this->_manifest = array_reverse(unserialize(file_get_contents($indexFile)), true);
        } else {
            $this->_manifest = [];
        }
    }

    return $this->_manifest;
}

The times when the error occurs, this is what the debug echo gives

unserializeResultType=[boolean] fileExists=1 fileSize=0 isFile=1 isReadale=1

and there is nothing in $fileContent

When the error occurs and i go to runtime/debug, the file index.data exists and actually has some serialized data in it. I'm using the die; after the echo because when i don't and the error occurs the output of the echo is gone and there only Yii's error with the message from the screenshot.

martingeorg commented 10 years ago

Going further, using this code

    protected function getManifest($forceReload = false)
    {
        if ($this->_manifest === null || $forceReload) {
            if ($forceReload) {
                clearstatcache();
            }
            $indexFile = $this->module->dataPath . '/index.data';

            do {

            $fileContent = file_get_contents($indexFile);
            file_put_contents( '/home/martin/Desktop/eventualBrokenData.txt', $fileContent );
            $unserializedData = unserialize($fileContent);
            echo '<div style="background-color:#f00; color:#fff; position:absolute; top:1px; left:1px; z-index:999999;">unserializeResultType=['.( gettype($unserializedData) )
                .'] fileExists='. file_exists($indexFile) . ' fileSize=' . filesize($indexFile) .' isFile='. is_file($indexFile) .' isReadale='. is_readable($indexFile) .' </div>';
            echo $fileContent;
            //die;
            //sleep(1);
            } while ( $unserializedData === false );

            if (is_file($indexFile) && is_readable($indexFile)) {
                $this->_manifest = array_reverse($unserializedData, true);
            } else {
                $this->_manifest = [];
            }
        }

        return $this->_manifest;
    }

Sometimes i get the error


PHP Notice 'yii\base\ErrorException' with message 'unserialize(): Error at offset 15487 of 15759 bytes' 

in /var/www/html/copybook/vendor/yiisoft/yii2-debug/controllers/DefaultController.php:127

Stack trace:
#0 /var/www/html/copybook/vendor/yiisoft/yii2-debug/controllers/DefaultController.php(151): yii\debug\controllers\DefaultController->getManifest()
#1 /var/www/html/copybook/vendor/yiisoft/yii2-debug/controllers/DefaultController.php(92): yii\debug\controllers\DefaultController->loadData()
#2 /var/www/html/copybook/vendor/yiisoft/yii2/base/InlineAction.php(55): yii\debug\controllers\DefaultController->actionToolbar()
#3 /var/www/html/copybook/vendor/yiisoft/yii2/base/InlineAction.php(55): ::call_user_func_array()
#4 /var/www/html/copybook/vendor/yiisoft/yii2/base/Controller.php(151): yii\base\InlineAction->runWithParams()
#5 /var/www/html/copybook/vendor/yiisoft/yii2/base/Module.php(455): yii\base\Controller->runAction()
#6 /var/www/html/copybook/vendor/yiisoft/yii2/web/Application.php(83): yii\base\Module->runAction()
#7 /var/www/html/copybook/vendor/yiisoft/yii2/base/Application.php(375): yii\web\Application->handleRequest()
#8 /var/www/html/copybook/frontend/web/index.php(18): yii\base\Application->run()
#9 {main}

that line 127 is now the 11th line in the method

$unserializedData = unserialize($fileContent);

The data written from my file_put_content is actually different from what the data is in index.data in runtime/debug right after the refresh of the page with the error without any other action being taken on that page. So first i'll paste the data from my file_put_content and after that the data from index.data

a:57:{s:13:"543eb13e95450";a:9:{s:3:"tag";s:13:"543eb13e95450";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/3.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13e95917";a:9:{s:3:"tag";s:13:"543eb13e95917";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/6.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13e9400a";a:9:{s:3:"tag";s:13:"543eb13e9400a";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/5.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13e958e5";a:9:{s:3:"tag";s:13:"543eb13e958e5";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/4.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13e962f1";a:9:{s:3:"tag";s:13:"543eb13e962f1";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/2.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13e9a4e7";a:9:{s:3:"tag";s:13:"543eb13e9a4e7";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/7.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13e9c2f5";a:9:{s:3:"tag";s:13:"543eb13e9c2f5";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/8.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13e9e045";a:9:{s:3:"tag";s:13:"543eb13e9e045";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/9.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13eab7a5";a:9:{s:3:"tag";s:13:"543eb13eab7a5";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/1.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13eace59";a:9:{s:3:"tag";s:13:"543eb13eace59";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/3.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13ead9e2";a:9:{s:3:"tag";s:13:"543eb13ead9e2";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/5.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13eac1b1";a:9:{s:3:"tag";s:13:"543eb13eac1b1";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/2.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13eae19c";a:9:{s:3:"tag";s:13:"543eb13eae19c";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/4.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13eae156";a:9:{s:3:"tag";s:13:"543eb13eae156";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/6.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13eb2075";a:9:{s:3:"tag";s:13:"543eb13eb2075";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/7.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13eb3882";a:9:{s:3:"tag";s:13:"543eb13eb3882";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/8.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13eb50ed";a:9:{s:3:"tag";s:13:"543eb13eb50ed";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/9.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f387fc";a:9:{s:3:"tag";s:13:"543eb13f387fc";s:3:"url";s:37:"http://copybook.bg/military/tradeshow";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:200;s:8:"sqlCount";i:16;s:9:"mailCount";i:0;}s:13:"543eb13f510ca";a:9:{s:3:"tag";s:13:"543eb13f510ca";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/1.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f51fdc";a:9:{s:3:"tag";s:13:"543eb13f51fdc";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/3.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f52889";a:9:{s:3:"tag";s:13:"543eb13f52889";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/6.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f528b9";a:9:{s:3:"tag";s:13:"543eb13f528b9";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/2.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f52bd4";a:9:{s:3:"tag";s:13:"543eb13f52bd4";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/4.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f52848";a:9:{s:3:"tag";s:13:"543eb13f52848";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/5.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f568ed";a:9:{s:3:"tag";s:13:"543eb13f568ed";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/7.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f589a2";a:9:{s:3:"tag";s:13:"543eb13f589a2";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/8.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f5b272";a:9:{s:3:"tag";s:13:"543eb13f5b272";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/9.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f6942c";a:9:{s:3:"tag";s:13:"543eb13f6942c";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/3.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f67fe9";a:9:{s:3:"tag";s:13:"543eb13f67fe9";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/2.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f6add8";a:9:{s:3:"tag";s:13:"543eb13f6add8";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/4.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f6beb3";a:9:{s:3:"tag";s:13:"543eb13f6beb3";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/5.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f6823c";a:9:{s:3:"tag";s:13:"543eb13f6823c";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/1.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f6d887";a:9:{s:3:"tag";s:13:"543eb13f6d887";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/6.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f6f4ca";a:9:{s:3:"tag";s:13:"543eb13f6f4ca";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/7.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f6feeb";a:9:{s:3:"tag";s:13:"543eb13f6feeb";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/8.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f7113c";a:9:{s:3:"tag";s:13:"543eb13f7113c";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/9.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13ff3ee1";a:9:{s:3:"tag";s:13:"543eb13ff3ee1";s:3:"url";s:37:"http://copybook.bg/military/tradeshow";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:200;s:8:"sqlCount";i:16;s:9:"mailCount";i:0;}s:13:"543eb14020939";a:9:{s:3:"tag";s:13:"543eb14020939";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/1.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14023647";a:9:{s:3:"tag";s:13:"543eb14023647";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/2.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb1402565f";a:9:{s:3:"tag";s:13:"543eb1402565f";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/3.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb1402532c";a:9:{s:3:"tag";s:13:"543eb1402532c";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/5.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14026790";a:9:{s:3:"tag";s:13:"543eb14026790";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/4.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14025ab4";a:9:{s:3:"tag";s:13:"543eb14025ab4";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/6.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14028b4c";a:9:{s:3:"tag";s:13:"543eb14028b4c";s:3:"url";s:37:"http://copybook.bg/military/tradeshow";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:200;s:8:"sqlCount";i:16;s:9:"mailCount";i:0;}s:13:"543eb140328ac";a:9:{s:3:"tag";s:13:"543eb140328ac";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/7.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb1403c567";a:9:{s:3:"tag";s:13:"543eb1403c567";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/1.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb140403e2";a:9:{s:3:"tag";s:13:"543eb140403e2";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/4.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb1403f80e";a:9:{s:3:"tag";s:13:"543eb1403f80e";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/2.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14040fe1";a:9:{s:3:"tag";s:13:"543eb14040fe1";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/5.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb1404030a";a:9:{s:3:"tag";s:13:"543eb1404030a";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/3.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14042ea2";a:9:{s:3:"tag";s:13:"543eb14042ea2";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/6.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb140432c9";a:9:{s:3:"tag";s:13:"543eb140432c9";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/7.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14046422";a:9:{s:3:"tag";s:13:"543eb14046422";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/8.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14048612";a:9:{s:3:"tag";s:13:"543eb14048612";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/9.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14057909";a:9:{s:3:"tag";s:13:"543eb14057909";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/2.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14058067";a:9:{s:3:"tag";s:13:"543eb14058067";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/4.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14058322";a:9:{s:3:"tag";s:13:"543eb14058322";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/6.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14058329";a:9:{s:3:"tag";s:13:"543eb14058329";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/3.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}}

AND NOW THE DATA FROM INDEX.DATA

a:52:{s:13:"543eb13eac1b1";a:9:{s:3:"tag";s:13:"543eb13eac1b1";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/2.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13eae19c";a:9:{s:3:"tag";s:13:"543eb13eae19c";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/4.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13eae156";a:9:{s:3:"tag";s:13:"543eb13eae156";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/6.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13eb2075";a:9:{s:3:"tag";s:13:"543eb13eb2075";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/7.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13eb3882";a:9:{s:3:"tag";s:13:"543eb13eb3882";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/8.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13eb50ed";a:9:{s:3:"tag";s:13:"543eb13eb50ed";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/9.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394750;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f387fc";a:9:{s:3:"tag";s:13:"543eb13f387fc";s:3:"url";s:37:"http://copybook.bg/military/tradeshow";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:200;s:8:"sqlCount";i:16;s:9:"mailCount";i:0;}s:13:"543eb13f510ca";a:9:{s:3:"tag";s:13:"543eb13f510ca";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/1.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f51fdc";a:9:{s:3:"tag";s:13:"543eb13f51fdc";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/3.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f52889";a:9:{s:3:"tag";s:13:"543eb13f52889";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/6.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f528b9";a:9:{s:3:"tag";s:13:"543eb13f528b9";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/2.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f52bd4";a:9:{s:3:"tag";s:13:"543eb13f52bd4";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/4.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f52848";a:9:{s:3:"tag";s:13:"543eb13f52848";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/5.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f568ed";a:9:{s:3:"tag";s:13:"543eb13f568ed";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/7.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f589a2";a:9:{s:3:"tag";s:13:"543eb13f589a2";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/8.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f5b272";a:9:{s:3:"tag";s:13:"543eb13f5b272";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/9.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f6942c";a:9:{s:3:"tag";s:13:"543eb13f6942c";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/3.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f67fe9";a:9:{s:3:"tag";s:13:"543eb13f67fe9";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/2.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f6add8";a:9:{s:3:"tag";s:13:"543eb13f6add8";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/4.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f6beb3";a:9:{s:3:"tag";s:13:"543eb13f6beb3";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/5.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f6823c";a:9:{s:3:"tag";s:13:"543eb13f6823c";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/1.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f6d887";a:9:{s:3:"tag";s:13:"543eb13f6d887";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/6.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f6f4ca";a:9:{s:3:"tag";s:13:"543eb13f6f4ca";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/7.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f6feeb";a:9:{s:3:"tag";s:13:"543eb13f6feeb";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/8.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13f7113c";a:9:{s:3:"tag";s:13:"543eb13f7113c";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/9.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394751;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb13ff3ee1";a:9:{s:3:"tag";s:13:"543eb13ff3ee1";s:3:"url";s:37:"http://copybook.bg/military/tradeshow";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:200;s:8:"sqlCount";i:16;s:9:"mailCount";i:0;}s:13:"543eb14020939";a:9:{s:3:"tag";s:13:"543eb14020939";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/1.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14023647";a:9:{s:3:"tag";s:13:"543eb14023647";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/2.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb1402565f";a:9:{s:3:"tag";s:13:"543eb1402565f";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/3.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb1402532c";a:9:{s:3:"tag";s:13:"543eb1402532c";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/5.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14026790";a:9:{s:3:"tag";s:13:"543eb14026790";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/4.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14025ab4";a:9:{s:3:"tag";s:13:"543eb14025ab4";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/6.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14028b4c";a:9:{s:3:"tag";s:13:"543eb14028b4c";s:3:"url";s:37:"http://copybook.bg/military/tradeshow";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:200;s:8:"sqlCount";i:16;s:9:"mailCount";i:0;}s:13:"543eb140328ac";a:9:{s:3:"tag";s:13:"543eb140328ac";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/7.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb1403c567";a:9:{s:3:"tag";s:13:"543eb1403c567";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/1.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb140403e2";a:9:{s:3:"tag";s:13:"543eb140403e2";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/4.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb1403f80e";a:9:{s:3:"tag";s:13:"543eb1403f80e";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/2.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14040fe1";a:9:{s:3:"tag";s:13:"543eb14040fe1";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/5.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb1404030a";a:9:{s:3:"tag";s:13:"543eb1404030a";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/3.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14042ea2";a:9:{s:3:"tag";s:13:"543eb14042ea2";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/6.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb140432c9";a:9:{s:3:"tag";s:13:"543eb140432c9";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/7.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14046422";a:9:{s:3:"tag";s:13:"543eb14046422";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/8.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14048612";a:9:{s:3:"tag";s:13:"543eb14048612";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/9.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14057909";a:9:{s:3:"tag";s:13:"543eb14057909";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/2.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14058067";a:9:{s:3:"tag";s:13:"543eb14058067";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/4.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14058322";a:9:{s:3:"tag";s:13:"543eb14058322";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/6.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14058329";a:9:{s:3:"tag";s:13:"543eb14058329";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/3.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb1405a503";a:9:{s:3:"tag";s:13:"543eb1405a503";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/7.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14058e47";a:9:{s:3:"tag";s:13:"543eb14058e47";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/5.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb14065172";a:9:{s:3:"tag";s:13:"543eb14065172";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/8.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb1405acb6";a:9:{s:3:"tag";s:13:"543eb1405acb6";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/1.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}s:13:"543eb140655b6";a:9:{s:3:"tag";s:13:"543eb140655b6";s:3:"url";s:46:"http://copybook.bg/images/platform-logos/9.png";s:4:"ajax";i:0;s:6:"method";s:3:"GET";s:2:"ip";s:9:"127.0.0.1";s:4:"time";i:1413394752;s:10:"statusCode";i:404;s:8:"sqlCount";i:0;s:9:"mailCount";i:0;}}
ShNURoK42 commented 10 years ago

I have this problem too.

ghost commented 10 years ago

Having this issue too, have you guys fixed that? My problem occurs in "yiisoft/yii2-debug/controllers/DefaultController.php"

PHP Notice 'yii\base\ErrorException' with message 'unserialize(): Error at offset 8188 of 15951 bytes' 

in /Library/WebServer/Documents/cowbars/vendor/yiisoft/yii2-debug/controllers/DefaultController.php:122

Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleError(8, 'unserialize(): ...', '/Library/WebSer...', 122, Array)
#1 /Library/WebServer/Documents/cowbars/vendor/yiisoft/yii2-debug/controllers/DefaultController.php(122): unserialize('a:55:{s:13:"548...')
#2 /Library/WebServer/Documents/cowbars/vendor/yiisoft/yii2-debug/controllers/DefaultController.php(137): yii\debug\controllers\DefaultController->getManifest(false)
#3 /Library/WebServer/Documents/cowbars/vendor/yiisoft/yii2-debug/controllers/DefaultController.php(92): yii\debug\controllers\DefaultController->loadData('5480324d35188', 5)
#4 [internal function]: yii\debug\controllers\DefaultController->actionToolbar('5480324d35188')
#5 /Library/WebServer/Documents/cowbars/vendor/yiisoft/yii2/base/InlineAction.php(55): call_user_func_array(Array, Array)
#6 /Library/WebServer/Documents/cowbars/vendor/yiisoft/yii2/base/Controller.php(151): yii\base\InlineAction->runWithParams(Array)
#7 /Library/WebServer/Documents/cowbars/vendor/yiisoft/yii2/base/Module.php(455): yii\base\Controller->runAction('toolbar', Array)
#8 /Library/WebServer/Documents/cowbars/vendor/yiisoft/yii2/web/Application.php(83): yii\base\Module->runAction('debug/default/t...', Array)
#9 /Library/WebServer/Documents/cowbars/vendor/yiisoft/yii2/base/Application.php(375): yii\web\Application->handleRequest(Object(yii\web\Request))
#10 /Library/WebServer/Documents/cowbars/frontend/web/index.php(18): yii\base\Application->run()
#11 {main}
samdark commented 10 years ago

@klaudi no. We're unable to reproduce it reliably.

martingeorg commented 9 years ago

Hi again, so I've written a PhantomJS script which requests a page $n times and looks for the PRE tag with the error in the debug bar, so i could skip the endless refreshes of the page with F5 hoping that the error will occur. When only one instance of the script is run, the error does not occur. However, when i run a second instance the error starts occurring randomly, somewhat often. Here is the script

var maxTries = 4000;
var url = "url of the Yii2 page which to request";
var dieOnImpact = true; // whether the script should stop on first error occurrance

var errorsFound = 0;
var repeater = 0;
var fs = require('fs');

var checkForErrorInDebugBar = function() {
    if (repeater < maxTries) {
        repeater++;
        var page = require("webpage").create();
        page.viewportSize = {
            width: 1280,
            height: 1200
        };
        return page.open(url, function(status) {
            console.log( 'try ', repeater, ' of ', maxTries, ', found ', errorsFound, ' occurrances' );
            if (status === "success") {
                var gotTheErrorElement = page.evaluate(function() {
                    return $('#yii-debug-toolbar pre').html();
                });
                if (gotTheErrorElement !== null) {
                    console.log('FOUND AN ERROR');
                    errorsFound++;
                    var timestamp = new Date().getTime();
                    page.render("toolbarError_" + timestamp + ".png");
                    fs.write("toolbarError_" + timestamp + ".txt", gotTheErrorElement, 'w');
                    if (dieOnImpact) {
                        page.close();
                        return phantom.exit();
                    }
                }
            }
            page.close();
            return checkForErrorInDebugBar();
        });
    } else {
        return phantom.exit();
    }
};
checkForErrorInDebugBar();

The Yii2 application i am running the tests is simply a freshly created Basic app, with no database configured, just using the index page of the app.

In order to run the script just save it as a .js file, download PhantomJS from http://phantomjs.org/download.html and extract the phantomJS file in the same directory in which the .js file resides. You would need to configure the url variable in the script. Then run the script in the terminal with the following command phantomjs/bin/phantomjs savedjsfile.js

this will start one instance of the script, in order to get the error You need to start another instance by running the phantomjs/bin/phantomjs savedjsfile.js command again in another terminal. The more instances you run the better the chances are of the error popping out. When the script finds an error, it will save a screenshot from the page as well as a text file with the content of the html element containing the error, the file names of those files are timestamped.

Keep in mind that phantomjs does require some processing power. Running 4 instances of the script, my 4 core i7 processor goes to 60% on all cores.

So having this script to help me debug i've managed to find out what the problem is. From the tests i've made before i knew that the following code in the getManifest() method in vendor/yiisoft/yii2-debug/controllers/DefaultController.php received broken serialized data.

            if (is_file($indexFile) && is_readable($indexFile) && ($content = file_get_contents($indexFile)) !== false) {
                $this->_manifest = array_reverse(unserialize($content), true);
            } else {
                $this->_manifest = [];
            }

file_get_contents($indexFile) gets broken data.

The data in the index.data file, is populated in updateIndexFile() method in vendor/yiisoft/yii2-debug/LogTarget.php.

In this method , the @flock($fp, LOCK_EX); is used to lock the file until writing to it is finished and then the lock is released. So far, so good.

The problem in getManifest is that file_get_contents() does not respect that lock. As the documentation http://php.net/manual/en/function.flock.php says PHP supports a portable way of locking complete files in an advisory way (which means all accessing programs have to use the same way of locking or it will not work). By default, this function will block until the requested lock is acquired; this may be controlled (on non-Windows platforms) with the LOCK_NB option documented below.

This means that file_get_contents will read from the index.data file, no matter if writing to it is complete or not and that's how we get the broken data from time to time when it hits that moment when the content of the file is not complete. So in order to resolve the issue we need to use fopen and fread instead of file_get_contents

Having modified the getManifest method in the following way, the error stops occurring when running the phantomjs script with 8 instances, each making up to 4000 consecutive requests to the page

    // modified version of getManifest
    protected function getManifest($forceReload = false)
    {
        if ($this->_manifest === null || $forceReload) {
            if ($forceReload) {
                clearstatcache();
            }
            $indexFile = $this->module->dataPath . '/index.data';

            $content = '';
            $fp = fopen($indexFile, "r");
            if (is_resource($fp)) {
                @flock($fp, LOCK_SH);
                $content = fread($fp, filesize($indexFile));
                @flock($fp, LOCK_UN);
                fclose($fp);
            }

            if ($content!=='') {
                $this->_manifest = array_reverse(unserialize($content), true);
            } else {
                $this->_manifest = [];
            }
        }

        return $this->_manifest;
    }
    // original version of getManifest
    protected function getManifest($forceReload = false)
    {
        if ($this->_manifest === null || $forceReload) {
            if ($forceReload) {
                clearstatcache();
            }
            $indexFile = $this->module->dataPath . '/index.data';
            if (is_file($indexFile) && is_readable($indexFile) && ($content = file_get_contents($indexFile)) !== false) {
                $this->_manifest = array_reverse(unserialize($content), true);
            } else {
                $this->_manifest = [];
            }
        }

        return $this->_manifest;
    }

This way we respect the file lock and get only completely written data. That's it, problem solved :)

samdark commented 9 years ago

@martingeorg thank you for this amazing research.

samdark commented 9 years ago

The file itself wasn't corrupted. It was just not complete at the time it was read.

samdark commented 9 years ago

The code is 100% compatible in this regard.

martingeorg commented 9 years ago

@samdark I'm glad i could help.

rededit commented 9 years ago

I saw this error in yii 2 and i just deleted debug folder where in runtime. This is the corrupted file problem.