欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

Blank Output in Chrome laravel chrome clockwork no data 控制台 一片空白 space blank 有大用

我执行了
1).env中 APP_DEBUG=true 也就是在调试模式下才能运行
2)删除了 boostrap/cache 下面的php文件(优化生成的缓存文件)
3) php artisan route:cache
4) RewriteRule ^.*__clockwork/(.*)$ /webform.int/index.php/__clockwork/$1 [L] 
就解决了问题 

laravel + Clockwork + Chrome not working 
#46

 

 
 Closed
JasonMortonNZ opened this issue on 11 Feb 2014 · 12 comments

Comments

 

 
Projects
None yet
8 participants
@JasonMortonNZ@hannesvdvreken@itsgoingd@thinksaydo@xixo1983@xalloa@trevorgehman@bcalik
@JasonMortonNZ
 

JasonMortonNZ commented on 11 Feb 2014

 

 

So after many hours of frustration here's where I'm at.

  1. Brand new installation of Laravel 4 (v4.1.21)
  2. Added "itsgoingd/clockwork": "1.*" to my composer.json file.
  3. Ran composer update and Clockwork (v1.4.4) installed.
  4. I added the 'Clockwork\Support\Laravel\ClockworkServiceProvider' to my providers array, and added 'Clockwork' => 'Clockwork\Support\Laravel\Facade', to my aliases array.
  5. I added the following to my app/filters.php file:
App::before(function($request)
{
Event::fire('clockwork.controller.start');
});


App::after(function($request, $response)
{
Event::fire('clockwork.controller.end');
});
  1. Ran a composer dump-autoload -o for good measure.
  2. Next I boot up laravel using php artisan serve and we're running on (localhost:8000).
  3. I hit localhost:8000 in chrome, check the headers and here's where things get strange :)

The headers read:

X-Clockwork-Id:1392079506.9878.449334262
X-Clockwork-Version:1.4.2

Note: Composer installed Clockwork v1.4.4 , which is weird?

This is from my composer.lock file:

    "name": "itsgoingd/clockwork",
        "version": "v1.4.4",
        "source": {
            "type": "git",
            "url": "https://github.com/itsgoingd/clockwork.git",
            "reference": "2d39c88ba507fde4bd21b11971e429762303224c"
        }

I hit the clockwork tab in Chrome (Version 32.0.1700.107) and nothing appears.

I do at this point have .json' files inapp/storage/clockwork` containing all the correct data that should be being displayed by the Chrome extension.

A few points where I feel the issue could be laying are:

  1. The use of PHP's built-in web server?
  2. Using SQLite as the database driver of choice?
  3. Chrome on Ubuntu LInux (which I am using).

I've seen other's mention that white space has been an issue for them, but this isn't the case here. I'll be interested to see if there's a solution to this.

 
@hannesvdvreken
 
Contributor

hannesvdvreken commented on 13 Feb 2014

 

 

Is the app.debug config option set to true?

 
@itsgoingd
 
Owner

itsgoingd commented on 14 Feb 2014

 

 

Hey, sorry for the many hours of frustration. :\

What happens when you access "/__clockwork/1392079506.9878.449334262" in your browser (make sure the data file exists for that id) ? If you receive the json data can you please post it here or send it to me via email (remove personal information first) ?

The version was actually reported wrong in v1.4.3 and v1.4.4, sorry. I've just released v1.5, you might try updating before trying again as well.

 
@thinksaydo
 

thinksaydo commented on 21 Feb 2014

 

 

Clockwork will not work with the internal PHP web server because by default it reads the ID with periods as a file name and fails to route into Laravel. To fix, add this to the top of your Laravel public/index.php file:

// Allow PHP Web Server requests that resemble file requests
if (file_exists(__DIR__ . $_SERVER["REQUEST_URI"])) return false;

That will allow the web server to return actual file requests while allowing Laravel to route other requests that only resemble file requests. Enjoy!

Then start the web server like:

php -S 127.0.0.1:8000 index.php

Pointing the PHP web server to a specific file makes that file act as a router for all requests.

 
@itsgoingd
 
Owner

itsgoingd commented on 24 Sep 2014

 

 

Tested with PHP web server without problems, if problem still exists in latest version please reopen.

 

 itsgoingd closed this on 24 Sep 2014

 

 
 
@xixo1983
 

xixo1983 commented on 26 Oct 2014

 

 

Issue still exists

 
@xalloa
 

xalloa commented on 12 Sep 2015

 

 

In my case it was a problem with the mod_rewrite rule. I mention that just in case.

 
@trevorgehman
 

trevorgehman commented on 22 Oct 2015

 

 

@xalloa How did you correct the mod_rewrite issue you had?

 
@xalloa
 

xalloa commented on 22 Oct 2015

 

 

@trevorgehman in my case a colleague had "installed" the web app at a subdir ( webform.int ) so I wrote a rule specific to the clockwork path like that:

RewriteRule ^.*__clockwork/(.*)$ /webform.int/index.php/__clockwork/$1 [L] 

hope this helps though it is a workaround and not the solution (i.e. I have not fixed the original rule that caused the problem since i didn't had the time to).

 
@trevorgehman
 

trevorgehman commented on 22 Oct 2015

 

 

I actually discovered my issue was I had to clear the route cache with

php artisan route:cache
 
@xalloa
 

xalloa commented on 22 Oct 2015

 

 

Nice, I'll give it a try, however or other reasons we are running on nginx now so I have left mod_rewrite alone :smile:

 
@bcalik
 

bcalik commented on 20 Nov 2015

 

 

I have the same problem.

I have several laravel websites with same nginx configuration, all is working well but one of them does not work (which was actually working well previously. A lot of development is going on this project, so I don't know what caused Clockwork to stop working.)

Interesting thing is, clockwork-cli is working well, but the chrome extension does not work for this project. It just doesn't show anything.

Edit: Screenshots attached.

screen shot 2015-11-20 at 14 04 21
screen shot 2015-11-20 at 14 04 32

Edit: Latest clockwork json file added.

{"id":"1448021374.7071.350238989","time":1448021374.6205,"method":"GET","uri":"\/","headers":{"content-type":[""],"content-length":[""],"host":["arsiv.dev"],"connection":["keep-alive"],"cache-control":["max-age=0"],"accept":["text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8"],"upgrade-insecure-requests":["1"],"user-agent":["Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/46.0.2490.86 Safari\/537.36"],"referer":["http:\/\/arsiv.dev\/inventory"],"accept-encoding":["gzip, deflate, sdch"],"accept-language":["en-US,en;q=0.8,tr;q=0.6,es;q=0.4"],"cookie":["cartalyst_sentry=eyJpdiI6Ik9pTnIwK2duXC84V1lcL244MjhIXC9PRUE9PSIsInZhbHVlIjoiSEkxTGt0RjY5RDdtUTZpc3hxSnREZHZiT1JiTWRZNm1WSzlmZEoxOTNHKzZcL2ZlcjlRUHlsZFpRaG1wZDJzNUNlVUt3NEZlVUJORzhOdUdtSHp4SFpTN3pWdkQ4eVVQRk9cL0RJNFpoTzl2REtpdUhcLzV6VElCZFhwallqeVpFVHciLCJtYWMiOiIzNTNlMzJhYjk3OTgxZjFiMDRlODNlMDAwMDNhN2IzZGRmMTgwM2U1MTY0YWVkOTQ5MWUyODEwYmJkOGNhYzBjIn0%3D; laravel_session=eyJpdiI6IjM0b1BNZVwvWTZ1Z1ZrMjM2UHNqNjhRPT0iLCJ2YWx1ZSI6IldvWUt5VFcxYUdOeFV6SklWMU9FZHAxSkt2eUdYeUJOS09lcUFXOVFIa255TkphcytmZVp2elwvQlBKM0llTnd2UlJxTkUwXC9Da3NUVzRnQ3VISkZnb0E9PSIsIm1hYyI6IjVjODhkZDMxMjk0M2Y4NjcxYjAwODVhYjVmOGM5Nzg2ZTE2MDI4N2EwOTBlODRiOWNiOWQxYWIyNWRiYjJlNTIifQ%3D%3D"]},"controller":"HomeController@getIndex","getData":[],"postData":[],"sessionData":{"_token":"cydeMdVkzhOe4DHipWlS4MAIB5vYxvHltFH4vziq","flash":{"old":[],"new":[]}},"cookies":{"cartalyst_sentry":"eyJpdiI6Ik9pTnIwK2duXC84V1lcL244MjhIXC9PRUE9PSIsInZhbHVlIjoiSEkxTGt0RjY5RDdtUTZpc3hxSnREZHZiT1JiTWRZNm1WSzlmZEoxOTNHKzZcL2ZlcjlRUHlsZFpRaG1wZDJzNUNlVUt3NEZlVUJORzhOdUdtSHp4SFpTN3pWdkQ4eVVQRk9cL0RJNFpoTzl2REtpdUhcLzV6VElCZFhwallqeVpFVHciLCJtYWMiOiIzNTNlMzJhYjk3OTgxZjFiMDRlODNlMDAwMDNhN2IzZGRmMTgwM2U1MTY0YWVkOTQ5MWUyODEwYmJkOGNhYzBjIn0=","laravel_session":"eyJpdiI6IjM0b1BNZVwvWTZ1Z1ZrMjM2UHNqNjhRPT0iLCJ2YWx1ZSI6IldvWUt5VFcxYUdOeFV6SklWMU9FZHAxSkt2eUdYeUJOS09lcUFXOVFIa255TkphcytmZVp2elwvQlBKM0llTnd2UlJxTkUwXC9Da3NUVzRnQ3VISkZnb0E9PSIsIm1hYyI6IjVjODhkZDMxMjk0M2Y4NjcxYjAwODVhYjVmOGM5Nzg2ZTE2MDI4N2EwOTBlODRiOWNiOWQxYWIyNWRiYjJlNTIifQ=="},"responseTime":1448021374.7076,"responseStatus":200,"responseDuration":87.081909179688,"databaseQueries":[{"query":"SELECT * FROM `users` WHERE `users`.`deleted_at` IS NULL and `users`.`id` = '1' LIMIT 1","duration":0.32,"connection":"mysql"},{"query":"SELECT * FROM `throttle` WHERE `user_id` = '1' LIMIT 1","duration":0.2,"connection":"mysql"},{"query":"SELECT *, COUNT(*) as count, MAX(created_at) as latest_date FROM `notifications` WHERE `user_id` = '1' and `status` = '0' GROUP BY `status`, `name` ORDER BY `created_at` DESC LIMIT 10","duration":1.32,"connection":"mysql"},{"query":"SELECT * FROM `throttle` WHERE `user_id` = '1' LIMIT 1","duration":0.23,"connection":"mysql"},{"query":"SELECT count(*) as aggregate FROM `doc_types`","duration":0.24,"connection":"mysql"},{"query":"SELECT count(*) as aggregate FROM `folder_types`","duration":0.14,"connection":"mysql"},{"query":"SELECT `groups`.*, `users_groups`.`user_id` as `pivot_user_id`, `users_groups`.`group_id` as `pivot_group_id` FROM `groups` inner join `users_groups` on `groups`.`id` = `users_groups`.`group_id` WHERE `users_groups`.`user_id` = '1'","duration":0.32,"connection":"mysql"}],"databaseDuration":2.77,"timelineData":{"total":{"start":1448021374.6205,"end":1448021374.7088,"duration":88.293075561523,"description":"Total execution time.","data":[]},"initialisation":{"start":1448021374.6205,"end":1448021374.6577,"duration":37.149906158447,"description":"Application initialisation.","data":[]},"boot":{"start":1448021374.6577,"end":1448021374.6578,"duration":0.14495849609375,"description":"Framework booting.","data":[]},"run":{"start":1448021374.6577,"end":1448021374.7088,"duration":51.140785217285,"description":"Framework running.","data":[]},"dispatch":{"start":1448021374.67,"end":1448021374.7067,"duration":36.699056625366,"description":"Router dispatch.","data":[]},"controller":{"start":1448021374.6904,"end":1448021374.7067,"duration":16.26181602478,"description":"Controller running.","data":[]}},"log":[],"routes":[],"emailsData":[],"viewsData":[],"userData":null}

@itsgoingd @JasonMortonNZ please re-open the issue.

 
@bcalik
 

bcalik commented on 20 Nov 2015

 

 

Ok I have found the issue.

I have created a singleton named 'app'. Which causes the Clockwork error like this:
`Argument 1 passed to Clockwork\Support\Laravel\Controllers\LegacyController::__construct() must be an instance of Illuminate\Foundation\Application, instance of stdClass given``

Here is the code caused the issue:

  App::singleton('app', function(){
    $app = new stdClass;
    ...
    return $app;
  });
  $app = App::make('app');
 
 

patrikkernke commented on 17 Jan 2014

Hello,
I installed Clockwork for Chrome and set the provider and alias in Laravel. I extended the Basecontroller too.

I see in the app/storage/clockwork folder json-files filling up. I read already the other closed issue "blank output". But disabling other profiler don't help me.

Trying this URL: http://my_host/__clockwork/1385391368.3305.1545016532 I get only a header, but no response:

Request URL:http://my_host/__clockwork/1385391368.3305.1545016532
Request Method:GET
Status Code:200 OK
Request Headersview source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip,deflate,sdch
Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
Cache-Control:no-cache
Connection:keep-alive
Cookie:laravel_session=eyJpdiI6IlplQ3BVbkd3dDVhcGRzb0xYaW8rWVhuMFFNTFppNFhJcThERHg5VDBZaEk9IiwidmFsdWUiOiJjSUNlZE1Nc3JMR1k2Ykw3d2JSdkpCaUdjYlIwVTBDMk9ubU5LSFdjdDNxMFRCWk1cL3ExWjkzTmVEYStwbGNNMldlYzkxc293NDgzVTFcL3R4Z21qeXNRPT0iLCJtYWMiOiJjOTcwMDFkNTBhOWFhZGQ4NGQzZDI4OWVjNGY3M2E4ZTJkODRmNDYwYWVjNjdmZTE3YTAzMzQxNmJhZWU4ZDMzIn0%3D
Host:my_host
Pragma:no-cache
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36
Response Headersview source
Connection:Keep-Alive
Content-Type:text/html
Date:Fri, 17 Jan 2014 07:56:57 GMT
Keep-Alive:timeout=5, max=100
Server:Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/0.9.8y DAV/2 PHP/5.4.4
Transfer-Encoding:chunked
X-Powered-By:PHP/5.4.4

Can you help me please? I want to use your tool!

 
@itsgoingd
 
Owner

itsgoingd commented on 17 Jan 2014

Hey, are you sure there is 1385391368.3305.1545016532.json file in your app/storage/clockwork directory? If so, can you send me a copy? (Remove any personal information first.)

 
@maximebeaudoin
 
Contributor

maximebeaudoin commented on 18 Jan 2014

I have the same issue. Clockwork seem to generate json file like this "1389975744,0047.436770512.json" instead of "1389975744.0047.436770512.json" with a dot between "1389975744" and "0047".

 
@itsgoingd
 
Owner

itsgoingd commented on 18 Jan 2014

This should already be fixed in dev-master, I forgot to tag a new version though. If you are using 1.* as composer dependency, I've tagged new 1.4.3 revision, try running composer update.

 
@maximebeaudoin
 
Contributor

maximebeaudoin commented on 18 Jan 2014

Fixed for me thank you

 
@patrikkernke

Sorry,
I looked in the app/storage/clockwork directory. There isn't a file called 1385391368.3305.1545016532.json. The files are beginning with 1389.....json.

 
@itsgoingd
 
Owner

itsgoingd commented on 22 Jan 2014

When you try to access /__clockwork/ID where ID is an actual file name from app/storage/clockwork(without the .json extension) does it still return an empty page?
I've just tagged a new version (v1.4.4), please try if updating changes anything.

 
@patrikkernke

The update aren't solving the Problem. When I try to access ```/__clockwork/1389615704.34.953869411´´´ I get the following result:

{
id: "1389615704.34.953869411",
version: 1,
time: 1389615704.31,
method: "GET",
uri: "/some/customuri",
headers: {
host: [
"myhost.dev"
],
connection: [
"keep-alive"
],
cache-control: [
"max-age=0"
],
accept: [
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
],
user-agent: [
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36"
],
accept-encoding: [
"gzip,deflate,sdch"
],
accept-language: [
"de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4"
]
},
controller: "MyController@myMethod",
getData: [ ],
postData: [ ],
sessionData: {
_token: "IPM5OtiYFu7Qab6fusi3y3zpdFQPfd5r6XBFz94C"
},
cookies: [ ],
responseTime: 1389615704.35,
responseStatus: 200,
databaseQueries: [ ],
timelineData: {
total: {
start: 1389615704.31,
end: 1389615704.35,
duration: 33.6699485779,
description: "Total execution time.",
data: [ ]
},
initialisation: {
start: 1389615704.31,
end: 1389615704.33,
duration: 19.9649333954,
description: "Application initialisation.",
data: [ ]
},
boot: {
start: 1389615704.33,
end: 1389615704.33,
duration: 1.43885612488,
description: "Framework booting.",
data: [ ]
},
run: {
start: 1389615704.33,
end: 1389615704.35,
duration: 13.6971473694,
description: "Framework running.",
data: [ ]
},
dispatch: {
start: 1389615704.33,
end: 1389615704.35,
duration: 12.1459960938,
description: "Router dispatch.",
data: [ ]
},
controller: {
start: 1389615704.34,
end: 1389615704.34,
duration: 7.4667930603,
description: "Controller running.",
data: [ ]
}
},
log: [ ],
routes: [ ],
emailsData: [ ],
viewsData: [ ],
userData: null,
responseDuration: 33.4029197693,
databaseDuration: 0
}

But the output at the Clockwork-Chrome-Extension is blank.

 
@keithwhyman

same problem, folder filling up, nothing to see in chrome, all blank under clockwork
Google Chrome 34.0.1809.0 (Official Build 247380) canary

  • laravel storage clockwork - 1391190625.7845.695916730.json

content with a debug log message
{"id":"1391190625.7845.695916730","time":1391190625.64,"method":"GET","uri":"/adults","headers":{"host":["hirtenlaravel.debian"],"connection":["keep-alive"],"cache-control":["max-age=0"],"accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8"],"user-agent":["Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1809.0 Safari/537.36"],"dnt":["1"],"accept-encoding":["gzip,deflate,sdch"],"accept-language":["en-US,en;q=0.8,de;q=0.6,fr;q=0.4"],"cookie":["__ngDebug=true; laravel_session=eyJpdiI6InFpRTNXMWJkVVNBTEhPTFFEMW1PT29iWEh5ZHNjaG9GM1wvTEtRZW9aeFc0PSIsInZhbHVlIjoiNG4rb1B6UXEzXC9XOXR5d1JiXC9uMTRPaUNyRnl5XC9CbDRjZStlNjRGdXU2c2pXYVE5cGNcL2RJMjNpSFV5VkpcLzFQT2FwNDJsR2RqOXN3a0tqQmN5NUllZz09IiwibWFjIjoiYmY0ZWViOWJjOTVmZGQ3MjFjN2Q1NDE3YWVlODdkYWUxYmQxY2JjZWQ2MjUwZmJkMGQyYWJiOGU0ZDczZThjNCJ9"]},"controller":"AdultsController@index","getData":[],"postData":[],"sessionData":{"_token":"O3g2y0cUh7pHpKrflgI0QoXQUEUfYWQpY48bRa7z","flash":{"old":[],"new":[]}},"cookies":{"__ngDebug":"true","laravel_session":"eyJpdiI6InFpRTNXMWJkVVNBTEhPTFFEMW1PT29iWEh5ZHNjaG9GM1wvTEtRZW9aeFc0PSIsInZhbHVlIjoiNG4rb1B6UXEzXC9XOXR5d1JiXC9uMTRPaUNyRnl5XC9CbDRjZStlNjRGdXU2c2pXYVE5cGNcL2RJMjNpSFV5VkpcLzFQT2FwNDJsR2RqOXN3a0tqQmN5NUllZz09IiwibWFjIjoiYmY0ZWViOWJjOTVmZGQ3MjFjN2Q1NDE3YWVlODdkYWUxYmQxY2JjZWQ2MjUwZmJkMGQyYWJiOGU0ZDczZThjNCJ9"},"responseTime":1391190625.886,"responseStatus":200,"responseDuration":246.02079391479,"databaseQueries":[{"query":"SELECT count(*) as aggregate FROM adults","duration":0.31},{"query":"SELECT * FROM adults LIMIT 20 offset 0","duration":0.67},{"query":"SELECT * FROM kids WHERE kids.adult_id in ('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20')","duration":0.73}],"databaseDuration":1.71,"timelineData":{"total":{"start":1391190625.64,"end":1391190625.8908,"duration":250.76484680176,"description":"Total execution time.","data":[]},"initialisation":{"start":1391190625.64,"end":1391190625.7027,"duration":62.660932540894,"description":"Application initialisation.","data":[]},"boot":{"start":1391190625.7027,"end":1391190625.737,"duration":34.278154373169,"description":"Framework booting.","data":[]},"run":{"start":1391190625.7027,"end":1391190625.8908,"duration":188.06004524231,"description":"Framework running.","data":[]},"dispatch":{"start":1391190625.7376,"end":1391190625.8908,"duration":153.20491790771,"description":"Router dispatch.","data":[]}},"log":[{"message":"Message text.","level":"info","time":1391190625.7855}],"routes":[],"emailsData":[],"viewsData":[],"userData":null}

ps - another question, is there some sort of garbage collection, once a day or so ?
Cos otherwise, i can see my storage clockwork folder filling up fast with a lot of files

 
@itsgoingd
 
Owner

itsgoingd commented on 1 Feb 2014

Hey, do your app responses contain the X-Clockwork-Version and X-Clockwork-Id headers?

There is an artisan command available for cleaning old Clockwork data, clockwork:clean, you can pass an optional --age argument to specify how old the request data has to be in hours.

 
@enkay
 

enkay commented on 1 Feb 2014

I had this issue and fixed it by removing a stray character before the <?php tag in one of the app files. The typo was hidden because of css but it was preventing clockwork from working properly.

 
@JasonMortonNZ

Hi, I've got the same issue too. I'm getting the X-Clockwork-Version and X-Clockwork-Id in the headers. But I'm seeing no output in the clockwork console. I've tried versions 1.4.21.4.3, and 1.4.4

 
@patrikkernke

Hello guys,
I solved the problem. The issue wasn't at clockwork but in the laravel app. In the output of my views a had a blank line before the doctype, because of an empty line before a <?php in my code.

Thanks for your help,
I love clockwork! It helps me much!

 
@shabushabu

A couple weeks ago the same thing started happening for me, actually. Did a check for empty lines and such already, but that wasn't it. I can access the individual reports and I do see the clockwork headers. Anybody else got some clues as to why Chrome doesn't output anything? Are there maybe some Chrome logs I could check?

 
@shabushabu

Actually, turns out that it was the large_client_header_buffers directive in the http block in /etc/nginx/nginx.conf. Once I set it to 4 32k Clockwork started working again.

 

 itsgoingd closed this on 24 Sep 2014

 
 

普通分类: