Skip to content
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

Not Found (#404): Unable to find debug data tagged with '55ede6f2ba13e'. #9632

Closed
njitram opened this issue Sep 7, 2015 · 19 comments
Closed

Comments

@njitram
Copy link

njitram commented Sep 7, 2015

Im keep getting the same error on every page, even after clearing the runtime and the asset folder. The debugbar is also delayed (5 seconds), when it appears the message is: "Not Found (#404): Unable to find debug data tagged with '55ede6f2ba13e'.".

2015-09-07 21:35:15 [127.0.0.1][1][..][warning][yii\log\Dispatcher::dispatch] Unable to send log via yii\debug\LogTarget: Exception 'Exception' with message 'Serialization of 'Closure' is not allowed' 

in C:\xampp\htdocs\uhce\vendor\yiisoft\yii2-debug\LogTarget.php:58

Stack trace:
#0 C:\xampp\htdocs\uhce\vendor\yiisoft\yii2-debug\LogTarget.php(58): serialize(Array)
#1 C:\xampp\htdocs\uhce\vendor\yiisoft\yii2-debug\LogTarget.php(112): yii\debug\LogTarget->export()
#2 C:\xampp\htdocs\uhce\vendor\yiisoft\yii2\log\Dispatcher.php(183): yii\debug\LogTarget->collect(Array, true)
#3 C:\xampp\htdocs\uhce\vendor\yiisoft\yii2\log\Logger.php(173): yii\log\Dispatcher->dispatch(Array, true)
#4 [internal function]: yii\log\Logger->flush(true)
#5 {main}
2015-09-07 21:35:14 [127.0.0.1][1][..][info][application] $_GET..
@samdark
Copy link
Member

samdark commented Sep 7, 2015

'Serialization of 'Closure' is not allowed'

means you have something with anonymous function which is logged.

First of all, try code from master branch.

@njitram
Copy link
Author

njitram commented Sep 7, 2015

Ok, i found the problem, this is just an example to reproduce the same error for the debugger:

class Pages extends UrlRule
{
    public function parseRequest($manager, $request)
    {
        $page = new Page();
        return [$this->route, ['page'=>$page]];
    }
}

and in your controller:

class SiteController extends Controller
{
    /**
     * Load website
     *
     * @param Page $page_id
     * @return string
     */
    public function actionIndex( Page $page )
    {
        return $this->render('index');
    }
}

btw, i had the latest from the m.b.

@samdark
Copy link
Member

samdark commented Sep 7, 2015

I don't see any anonymous functions there...

@njitram
Copy link
Author

njitram commented Sep 7, 2015

No ofcourse, Page is an active record with behaviors and it contains a function:

    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            [
                'class' => AttributeBehavior::className(),
                'attributes' => [
                    ActiveRecord::EVENT_BEFORE_VALIDATE => 'column1',
                ],
                'value' => function ($event) {
                    return 'test';
                },
            ],
        ];
    }

@kathysledge
Copy link
Contributor

There are ways around this by using a filter and a controller variable $page. Otherwise Page must be serializable. This should also be a stipulation of any service injected via #9565.

@njitram
Copy link
Author

njitram commented Sep 8, 2015

Tryed to make it serializable, no success, same results.
I passed the ID of the page to make it happen.

@samdark
Copy link
Member

samdark commented Sep 8, 2015

We should adopt superclosure one day...

@samdark
Copy link
Member

samdark commented Sep 8, 2015

?

@lynicidn
Copy link
Contributor

lynicidn commented Sep 8, 2015

https://3v4l.org/sM2Ob

@samdark
Copy link
Member

samdark commented Sep 8, 2015

@njitram something contains anonymous function. You need to figure out what it is.

@njitram
Copy link
Author

njitram commented Sep 8, 2015

it was the 'value'=>function(){}. It is solved. Thank you.

@njitram njitram closed this as completed Sep 8, 2015
@njitram
Copy link
Author

njitram commented Oct 10, 2015

Is there any possibility to use anonymous functions inside your code without making the debugger crash?

@njitram njitram reopened this Oct 10, 2015
@samdark
Copy link
Member

samdark commented Oct 10, 2015

Yes. This thing should be able to handle it via some cool tricks: https://github.com/jeremeamia/super_closure

@FedericoBenedetti1976
Copy link

Hi all, i don't know if this issue is still open, but i have the same error.
I put a Yii::info($dataProvider,'inv_dataprovider'); into my model search in this point:
`public function search($params)
{
$query = Inventario::find();
// add conditions that should always apply here
$query->joinWith(['idArticolo']);
$query->orderBy(['art.desc' => SORT_ASC]);

    $dataProvider = new ActiveDataProvider([
        'query' => $query,
    ]);
    Yii::info($dataProvider,'DATAPROVIDER');

    $dataProvider->sort->attributes['art_des'] = [
        'asc' => ['art.desc' => SORT_ASC],
        'desc' => ['art.desc' => SORT_DESC],
        'default' => SORT_ASC
    ];
    $dataProvider->sort->attributes['art_spe'] = [
        'asc' => ['art.spec' => SORT_ASC],
        'desc' => ['art.spec' => SORT_DESC],
    ];
    $this->load($params);
    ....`

And i have this error: Not Found (#404): Unable to find debug data tagged with '564ce404f17ac'.

Debugging with Firefox->Firebug i have:
http://my.site/debug/default/toolbar?tag=564ce41faa51c with error 404

if i delete Yii::info the debug bar works fine.

@aliechti
Copy link
Contributor

I get this error always if an Exception is thrown in a controller action like:

throw new NotFoundHttpException();

This makes it impossible for me to debug a page which throws such an exception.

@samdark
Copy link
Member

samdark commented Jul 4, 2016

All the current issues are either solved or caused by closure usage. It becomes a meta issue so closing.

@samdark samdark closed this as completed Jul 4, 2016
@pareekbhagu
Copy link

delete all folders from frontend/runtime/ ( or basic/runtime/* in basic applicatin template) ..

@bibeklekhak
Copy link
Contributor

@pareekbhagu Thanks. That worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants