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

Debug toolbar doesn't load #5402

Closed
sjaakp opened this issue Oct 7, 2014 · 19 comments
Closed

Debug toolbar doesn't load #5402

sjaakp opened this issue Oct 7, 2014 · 19 comments
Assignees
Milestone

Comments

@sjaakp
Copy link

sjaakp commented Oct 7, 2014

In Yii2rc the debug toolbar never loads. A message 'Not Found (#404): Unable to find debug data tagged with 'xxx'.' is issued.

app.log has this warning:
[::1][][pbkoi56d5uk9etajsg9btue116][warning][yii\log\Dispatcher::dispatch] Unable to send log via yii\debug\LogTarget: Exception 'Exception' with message 'Serialization of 'Closure' is not allowed'

In Yii2beta the debug toolbar did work correctly.

@samdark
Copy link
Member

samdark commented Oct 7, 2014

Are there any hints about where this closure is?

@cebe cebe added the ext:debug label Oct 7, 2014
@cebe
Copy link
Member

cebe commented Oct 7, 2014

This is a general problem of the debugger. Whenever there is a closure somewhere in the data that is logged by the debugger it will fail completely. We should skip the part of the data that fails and display the rest instead of failing the toolbar completely.

@cebe cebe added the type:bug Bug label Oct 7, 2014
@cebe cebe added this to the 2.0.1 milestone Oct 7, 2014
@sjaakp
Copy link
Author

sjaakp commented Oct 7, 2014

No, not at all. The problem appears on every page, even on ‘empty’ ones (with nothing in the view). I’m sure it’s somewhere in the framework.


Sjaak Priester

mailto:[email protected] [email protected]

Van: Alexander Makarov [mailto:[email protected]]
Verzonden: dinsdag 7 oktober 2014 13:41
Aan: yiisoft/yii2
CC: Sjaak Priester
Onderwerp: Re: [yii2] Debug toolbar doesn't load (#5402)

Are there any hints about where this closure is?


Reply to this email directly or view it on GitHub #5402 (comment) . https://github.com/notifications/beacon/5585878__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyODMwMTI4MCwiZGF0YSI6eyJpZCI6NDUwMDY4OTR9fQ==--33c5d3126ea02bfc51a15c3d854bf28947304fc9.gif

@cebe
Copy link
Member

cebe commented Oct 7, 2014

Does this appear on a plain basic or advanced app?

@sjaakp
Copy link
Author

sjaakp commented Oct 7, 2014

Both! Basic and advanced-->frontend.


Sjaak Priester

mailto:[email protected] [email protected]

Van: Carsten Brandt [mailto:[email protected]]
Verzonden: dinsdag 7 oktober 2014 14:55
Aan: yiisoft/yii2
CC: Sjaak Priester
Onderwerp: Re: [yii2] Debug toolbar doesn't load (#5402)

Does this appear on a plain basic or advaned app?


Reply to this email directly or view it on GitHub #5402 (comment) . https://github.com/notifications/beacon/5585878__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyODMwNTcyNSwiZGF0YSI6eyJpZCI6NDUwMDY4OTR9fQ==--5c2c2291849ae4036e58688e3c994be245af2c20.gif

@cebe
Copy link
Member

cebe commented Oct 7, 2014

Which PHP Version and server are you using? Also did you make any changes to the application code?

@sjaakp
Copy link
Author

sjaakp commented Oct 7, 2014

PHP 5.5.3

MySQL 5.5.21

Windows 7, IIS 7.5

Changes to app: not really. Modified css, emptied views/site/index.php.


Sjaak Priester

mailto:[email protected] [email protected]

Van: Carsten Brandt [mailto:[email protected]]
Verzonden: dinsdag 7 oktober 2014 14:59
Aan: yiisoft/yii2
CC: Sjaak Priester
Onderwerp: Re: [yii2] Debug toolbar doesn't load (#5402)

Which PHP Version and server are you using? Also did you make any changes to the application code?


Reply to this email directly or view it on GitHub #5402 (comment) . https://github.com/notifications/beacon/5585878__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyODMwNTkzMCwiZGF0YSI6eyJpZCI6NDUwMDY4OTR9fQ==--774cc4320c4d2881ba507431c3b67a8780ea0b00.gif

@cebe
Copy link
Member

cebe commented Oct 7, 2014

Is there a stack trace with the error message?

@sjaakp
Copy link
Author

sjaakp commented Oct 7, 2014

It’s just mentioned on its own at the bottom of the page, where the toolbar should be.

app.log has a stack trace like this:

Stack trace:
#0 C:\Users\Sjaak\Documents\Websites\yii2\vendor\yiisoft\yii2-debug\LogTarget.php(58): serialize(Array)
#1 C:\Users\Sjaak\Documents\Websites\yii2\vendor\yiisoft\yii2-debug\LogTarget.php(112): yii\debug\LogTarget->export(Array)
#2 C:\Users\Sjaak\Documents\Websites\yii2\vendor\yiisoft\yii2\log\Dispatcher.php(183): yii\debug\LogTarget->collect(Array, true)
#3 C:\Users\Sjaak\Documents\Websites\yii2\vendor\yiisoft\yii2\log\Logger.php(166): yii\log\Dispatcher->dispatch(Array, true)
#4 [internal function]: yii\log\Logger->flush(true)
#5 {main}
2014-10-03 16:22:15 [::1][][d90p6f86i8tfh5vd7ebkvk6i26][info][application] $_COOKIE = [
'atlas' => '3'
'_identity' => 'd1a5e5f9c4f611a8a759b8e48c96af0b57eb20dcf0916f576c90a92a63bbf765s:46:"[1,"Qvrqr-rHIay9m_hwK9wccI9bvblzcGPJ",2592000]";'
'csrf' => '3ff966040a005f8d7a7865d5a3dce66d6d7217ce6e43773e78ae36bd8e03e01ds:32:"F1Q2BKsP2oPhtXbbS80Uycynoj4rO0o";'
]


Sjaak Priester

mailto:[email protected] [email protected]

Van: Carsten Brandt [mailto:[email protected]]
Verzonden: dinsdag 7 oktober 2014 15:13
Aan: yiisoft/yii2
CC: Sjaak Priester
Onderwerp: Re: [yii2] Debug toolbar doesn't load (#5402)

Is there a stack trace with the error message?


Reply to this email directly or view it on GitHub #5402 (comment) . https://github.com/notifications/beacon/5585878__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyODMwNjc2NywiZGF0YSI6eyJpZCI6NDUwMDY4OTR9fQ==--56015e53810147c004cb36edb4219ba20ecb3dc4.gif

@ghost
Copy link

ghost commented Oct 7, 2014

After updating the branch, I get the same problem. And I'm receiving a confirmation window with a message 'tab', everytime when I click in any tab in request page lol.

@samdark
Copy link
Member

samdark commented Oct 7, 2014

@llfm can you post a screenshot?

@ghost
Copy link

ghost commented Oct 7, 2014

Well... my problems were solved, I cleaned the assets folder. Weird. I was getting the same message as @sjaakp

@sjaakp
Copy link
Author

sjaakp commented Oct 8, 2014

I found the problem. I did something clever in an AssetBundle to load Fontawesome, involving a closure. After removing that, the debug toolbar reappeared.

It's not pretty, though, not being able to use closures.

@samdark
Copy link
Member

samdark commented Oct 8, 2014

Hmm... do you still have a way to reproduce this smart stuff? We'd like to make debug toolbar bulletproof and it would be great to have reproduceable issue.

@sjaakp
Copy link
Author

sjaakp commented Oct 8, 2014

Behold, my FontAwesomeAsset:

    class FontAwesomeAsset extends AssetBundle {
        public $sourcePath = '@vendor/fortawesome/font-awesome';

        public function init()    {
            $this->css = [ YII_DEBUG ? 'css/font-awesome.css' : 'css/font-awesome.min.css' ];

            $this->publishOptions = [
                'beforeCopy' => function($from, $to)    {
                    return (strpos($from, '\css') !== false) || (strpos($from, '\fonts') !== false);
                },
            ];
            parent::init();
        }
    }

I wanted to have just the css and fonts in the public assets-directory, not the less-stuff etc.

@samdark samdark self-assigned this Oct 19, 2014
samdark added a commit that referenced this issue Oct 19, 2014
@samdark
Copy link
Member

samdark commented Oct 19, 2014

Fixed. Now debugger is OK with closures, resources and PDO instances. It cannot display closure code and instead just lists it as \Closure.

samdark added a commit that referenced this issue Oct 19, 2014
@samdark
Copy link
Member

samdark commented Oct 19, 2014

Reverted fix based on discussion at 084d355#commitcomment-8214995 and instead replaced with much simpler one that applies to assets only.

@dbsparkle
Copy link

Was working on html. The debug toolbar stopped working. Have no idea idea why..?

screenshot1
screenshot2

@cebe
Copy link
Member

cebe commented Jan 9, 2015

@dimbs09 your issue is unlikely related to this one, also this issue is already closed, please open a new one.

@yiisoft yiisoft locked and limited conversation to collaborators Jan 9, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants