Tracy causing random js and css files to not load
- quasipickle
- Member | 1
Hi,
Randomly – about 50% of page loads, I see about a 5 second delay when loading a page. These delays are always on Javascript or CSS files that don't involve PHP at all. When I look at what was sent from the server in the developer tools, I see the markup for the Tracy Debug Bar, then the expected headers, then some encoded binary garbage. For example, this is the result of my browser's request for “app.js”
<!-- Tracy Debug Bar -->
<script src="?_tracy_bar=js&v=2.5.0&XDEBUG_SESSION_STOP=1" data-id="121f475336"></script>
<script>
Tracy.Debug.init("\t\t<div class=\"tracy-panel \" id=\"tracy-debug-panel-Tracy-info\" data-tracy-content=\"<style class="tracy-debug">\n\t#tracy-debug .tracy-InfoPanel td {\n\t\twhite-space: nowrap;\n\t}\n\t#tracy-debug .tracy-InfoPanel td:nth-child(2) {\n\t\tfont-weight: bold;\n\t\twidth: 30%;\n\t}\n\t#tracy-debug .tracy-InfoPanel td[colspan='2'] b {\n\t\tfloat: right;\n\t\tmargin-left: 2em;\n\t}\n<\/style>\n\n<h1>System info<\/h1>\n\n<div class="tracy-inner tracy-InfoPanel">\n<div class="tracy-inner-container">\n<table>\n<tr>\n\t<td>Execution time<\/td><td>26.1\u202fms<\/td>\n<\/tr>\n<tr>\n\t<td>CPU usage user + system<\/td><td>46\u202f% + 0\u202f%<\/td>\n<\/tr>\n<tr>\n\t<td>Peak of allocated memory<\/td><td>1.09\u202fMB<\/td>\n<\/tr>\n<tr>\n\t<td>Included files<\/td><td>52<\/td>\n<\/tr>\n<tr>\n\t<td>OPcache<\/td><td>100% cached<\/td>\n<\/tr>\n<tr>\n\t<td>Classes + interfaces + traits<\/td><td>27 + 2 + 1<\/td>\n<\/tr>\n<tr>\n\t<td>Your IP<\/td><td>142.244.29.20<\/td>\n<\/tr>\n<tr>\n\t<td>Server IP<\/td><td>142.244.26.53<\/td>\n<\/tr>\n<tr>\n\t<td>HTTP method \/ response code<\/td><td>GET \/ 200<\/td>\n<\/tr>\n<tr>\n\t<td>PHP<\/td><td>7.0.27-0+deb9u1<\/td>\n<\/tr>\n<tr>\n\t<td>Tracy<\/td><td>2.5.0<\/td>\n<\/tr>\n<tr>\n\t<td>Server<\/td><td>Apache\/2.4.25 (Debian)<\/td>\n<\/tr>\n<\/table>\n\n\t<h2><a class="tracy-toggle tracy-collapsed" data-tracy-ref="^div .tracy-InfoPanel-packages">Composer Packages (17)<\/a><\/h2>\n\n\t<div class="tracy-InfoPanel-packages tracy-collapsed">\n\t\t<table>\n\t\t\t<tr><td>doctrine\/lexer<\/td><td>v1.0.1<\/td><\/tr>\n\t\t\t<tr><td>dragonmantank\/cron-expression<\/td><td>v2.1.0<\/td><\/tr>\n\t\t\t<tr><td>egulias\/email-validator<\/td><td>2.1.3<\/td><\/tr>\n\t\t\t<tr><td>firebase\/php-jwt<\/td><td>v5.0.0<\/td><\/tr>\n\t\t\t<tr><td>google\/apiclient<\/td><td>v2.2.1<\/td><\/tr>\n\t\t\t<tr><td>google\/apiclient-services<\/td><td>v0.55<\/td><\/tr>\n\t\t\t<tr><td>google\/auth<\/td><td>v1.3.0<\/td><\/tr>\n\t\t\t<tr><td>guzzlehttp\/guzzle<\/td><td>6.3.2<\/td><\/tr>\n\t\t\t<tr><td>guzzlehttp\/promises<\/td><td>v1.3.1<\/td><\/tr>\n\t\t\t<tr><td>guzzlehttp\/psr7<\/td><td>1.4.2<\/td><\/tr>\n\t\t\t<tr><td>monolog\/monolog<\/td><td>1.23.0<\/td><\/tr>\n\t\t\t<tr><td>phpseclib\/phpseclib<\/td><td>2.0.11<\/td><\/tr>\n\t\t\t<tr><td>psr\/cache<\/td><td>1.0.1<\/td><\/tr>\n\t\t\t<tr><td>psr\/http-message<\/td><td>1.0.1<\/td><\/tr>\n\t\t\t<tr><td>psr\/log<\/td><td>1.0.2<\/td><\/tr>\n\t\t\t<tr><td>swiftmailer\/swiftmailer<\/td><td>v6.0.2<\/td><\/tr>\n\t\t\t<tr><td>tecnickcom\/tcpdf<\/td><td>6.2.17<\/td><\/tr>\n\t\t<\/table>\n\t\n\t\t<\/div>\n<\/div>\n<\/div>\n\n\n\t<div class="tracy-icons">\n\t\t<a href="#" rel="window" title="open in window">&curren;<\/a>\n\t\t<a href="#" rel="close" title="close window">&times;<\/a>\n\t<\/div>\n\"><\/div>\t\t<div class=\"tracy-panel \" id=\"tracy-debug-panel-Tracy-errors\" data-tracy-content=\"\"><\/div>\n<div id=\"tracy-debug-bar\">\n\t<ul>\n\t\t<li id=\"tracy-debug-logo\" title=\"Tracy Debugger 2.5.0 \nhttps:\/\/tracy.nette.org\">\n\t\t\t<svg viewBox=\"0 -10 1561 333\"><path fill=\"#585755\" d=\"m176 327h-57v-269h-119v-57h291v57h-115v269zm208-191h114c50 0 47-78 0-78h-114v78zm106-135c17 0 33 2 46 7 75 30 75 144 1 175-13 6-29 8-47 8h-27l132 74v68l-211-128v122h-57v-326h163zm300 57c-5 0-9 3-11 9l-56 156h135l-55-155c-2-7-6-10-13-10zm-86 222l-17 47h-61l102-285c20-56 107-56 126 0l102 285h-61l-17-47h-174zm410 47c-98 0-148-55-148-163v-2c0-107 50-161 149-161h118v57h-133c-26 0-45 8-58 25-12 17-19 44-19 81 0 71 26 106 77 106h133v57h-119zm270-145l-121-181h68l81 130 81-130h68l-121 178v148h-56v-145z\"\/><\/svg>\n\t\t<\/li>\n\t\t\t\t<li><a href=\"#\" rel=\"tracy-debug-panel-Tracy-info\"><span title=\"Execution time\">\n<svg viewBox=\"0 0 2048 2048\"><path fill=\"#86bbf0\" d=\"m640 1153.6v639.3h-256v-639.3z\"\/><path fill=\"#6ba9e6\" d=\"m1024 254.68v1538.2h-256v-1538.2z\"\/><path fill=\"#4f96dc\" d=\"m1408 897.57v894.3h-256v-894.3z\"\/><path fill=\"#3987d4\" d=\"m1792 513.08v1279.8h-256v-1279.8z\"\/>\n<\/svg><span class=\"tracy-label\">26.1\u202fms<\/span>\n<\/span><\/a><\/li>\t\t<li><a href=\"#\" rel=\"close\" title=\"close debug bar\">×<\/a><\/li>\n\t<\/ul>\n\n<\/div>", []);
</script>
HTTP/1.1 200 OK
Date: Wed, 06 Jun 2018 21:46:08 GMT
Server: Apache/2.4.25 (Debian)
Last-Modified: Tue, 15 May 2018 19:33:41 GMT
ETag: "13eb-56c43adfabcb7-gzip"
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 2232
Keep-Alive: timeout=5, max=97
Connection: Keep-Alive
Content-Type: application/javascript
[binary type characters I assume is my browser attempting to display the gzipped contents of app.js]
It looks like for some reason, random requests have Tracy inject itself before the actual content.
I'm not 100% sure this is a Tracy problem, but I don't know what else it could be.This doesn't happen every page load – so it's not a server configuration or an invalid url. It doesn't always happen on the same file – but it's always on a Javascript or CSS file that shouldn't involve Tracy at all.
I should also mention this is happening in both Firefox and Chrome – so it's not a particular browser problem either.
Last edited by quasipickle (2018-06-07 00:00)
- Ondřej Kubíček
- Member | 494
tracy should be loaded only in develop enviroment, not production where it is
disabled by default
is it production server? do you have it allowed yourself?
how do you load app.js? it is ordinary js file? there is no server script which provide this js? if not, there is no way how could be tracy “load” to this js file because tracy is invoke by nette, so you somewhere run nette