Can't see zray in my application

General discussion forum for the Zend Server
Post Reply
ragtek
Posts: 13
Joined: Mon Jul 27, 2009 9:07 am

Can't see zray in my application

Post by ragtek » Tue Jan 26, 2016 9:38 am

I have installed zend server yesterday and z-ray worked for around 1h. Then it just disappeared.
Z-Ray is enabled global but i can't see it in my application. I've also created a simple phpinfo file inside my applications directory and there z-ray works.
http://take.ms/QUVaw7


Some of the recent logfiles:
monitor.ui.log

Code: Select all

[Monitor UI 25.01.2016 22:14:43 p5352/t4988 NOTICE] Successfully established connection to the database 
[Monitor UI 25.01.2016 22:14:43 p5352/t4988 NOTICE] Old event cleanup completed. deleted 0 issues in 0 seconds 
[Monitor UI 26.01.2016 09:18:25 p10568/t5716 NOTICE] Successfully established connection to the database 
[Monitor UI 26.01.2016 09:27:14 p5132/t4436 NOTICE] Successfully established connection to the database 
[Monitor UI 26.01.2016 09:27:16 p6584/t13144 NOTICE] Successfully established connection to the database 
[Monitor UI 26.01.2016 09:28:00 p10892/t8836 NOTICE] Successfully established connection to the database 
[Monitor UI 26.01.2016 09:28:02 p4040/t5580 NOTICE] Successfully established connection to the database 
[Monitor UI 26.01.2016 09:28:04 p11572/t9312 NOTICE] Successfully established connection to the database 
[Monitor UI 26.01.2016 09:28:06 p13796/t15320 NOTICE] Successfully established connection to the database 
[Monitor UI 26.01.2016 09:28:10 p12052/t14440 NOTICE] Successfully established connection to the database 
[Monitor UI 26.01.2016 09:28:33 p9688/t11372 NOTICE] Successfully established connection to the database 
zs_maintenance.log

Code: Select all

[01/26/16 09:28:34] NOTICE: DELETE FROM devbar_superglobals_data WHERE NOT EXISTS (SELECT 1 FROM devbar_requests WHERE devbar_requests.id = devbar_superglobals_data.request_id)
[01/26/16 09:28:34] NOTICE: Deleted 0 rows from devbar_superglobals_data
[01/26/16 09:28:34] NOTICE: DELETE FROM devbar_exceptions WHERE NOT EXISTS (SELECT 1 FROM devbar_requests WHERE devbar_requests.id = devbar_exceptions.request_id)
[01/26/16 09:28:34] NOTICE: Deleted 0 rows from devbar_exceptions
[01/26/16 09:28:34] NOTICE: DELETE FROM devbar_user_data WHERE NOT EXISTS (SELECT 1 FROM devbar_requests WHERE devbar_requests.id = devbar_user_data.request_id)
[01/26/16 09:28:34] NOTICE: Deleted 0 rows from devbar_user_data
[01/26/16 09:28:34] NOTICE: DELETE FROM devbar_extension_metadata WHERE NOT EXISTS (SELECT 1 FROM devbar_requests WHERE devbar_requests.id = devbar_extension_metadata.request_id)
[01/26/16 09:28:34] NOTICE: Deleted 0 rows from devbar_extension_metadata
[01/26/16 09:28:34] NOTICE: Deleted 0 rows from devbar_requests_urls
[01/26/16 09:28:34] NOTICE: Deleted 0 rows from devbar_sql_statements
[01/26/16 09:28:34] NOTICE: Deleted 221 rows from devbar_backtrace
[01/26/16 09:28:34] NOTICE: 1163 Zrays left in db
[01/26/16 09:28:34] NOTICE: Finished Z-Ray cleanup
and only entry in zray.log is from yesterday where it also didn't work

Code: Select all

[Statistics Extension 25.01.2016 20:02:10 p4124/t5100 ERROR] DevbarMySqliHandler::onMySqliPrepare - Cannot find db object for 'prepare' in http://localhost:80/ipsdev/admin/?adsess=suujmjiea8trd84bfspm0fjla2&app=core&module=applications&controller=developer&appKey=devtools&tab=hooks&do=editHook&hook=14 
[Statistics Extension 25.01.2016 20:02:10 p4124/t5100 ERROR] Cannot find statement for object in 'bindValue' 

User avatar
zvika
Zend Global Support
Posts: 997
Joined: Sun Dec 14, 2008 9:48 am
Contact:

Re: Can't see zray in my application

Post by zvika » Tue Jan 26, 2016 11:14 am

Hello
Do you have any errors on the Javascript console?

Can you repeat the error by loading the URL one time or multiple?
"http://localhost:80/ipsdev/admin/?adses ... ok&hook=14"

Please raise verbosity of statistics+zray and trigger / wait for the problem to happen,
after that, please open a support ticket with all the details and support tool output archive - we would like to check further into the configuration, logs and the application flow.
Zvika Dror
Zend Support Team

stij2324
Posts: 55
Joined: Fri Nov 06, 2015 11:42 pm

Re: Can't see zray in my application

Post by stij2324 » Wed Jan 27, 2016 9:57 am

Have you been playing with the user agent iof you browser by acident?
I have found out that when i change my user agent to an unknown one (VNC-1 for example the bar is shown).

ragtek
Posts: 13
Joined: Mon Jul 27, 2009 9:07 am

Re: Can't see zray in my application

Post by ragtek » Thu Jan 28, 2016 11:02 am

No, i use the default useragent.

The strange thing is, that if i use

Code: Select all

die('foo');
in my application to output some debugvalues(quick and dirty way:D ) i see the zray bar

Will create a ticket with all the logs

User avatar
zvika
Zend Global Support
Posts: 997
Joined: Sun Dec 14, 2008 9:48 am
Contact:

Re: Can't see zray in my application

Post by zvika » Thu Jan 28, 2016 11:57 am

Hello
Does it matter where the exit/die statement is placed? Beginning? End? Include file?
This can help you find the code which breaks Z-Ray presentation and we can have a reproduction which is easier to map and resolve.
Zvika Dror
Zend Support Team

ragtek
Posts: 13
Joined: Mon Jul 27, 2009 9:07 am

Re: Can't see zray in my application

Post by ragtek » Thu Jan 28, 2016 12:49 pm

Hello,

thank you very much for the hint.

It's indeed this part:

Code: Select all

		/* Send content-length header, but only if not using zlib.output_compression, because in that case the length we send in the header
			will not match the length of the actual content sent to the browser, breaking things (particularly json) */
		if( (bool) ini_get('zlib.output_compression') === false )
		{
			$size = ob_get_length();
			$this->sendHeader( "Content-Length: {$size}" ); // Makes sure the connection closes after sending output so that tasks etc aren't holding it open
		}
when i remove this, the z-ray bar is shown.

User avatar
zvika
Zend Global Support
Posts: 997
Joined: Sun Dec 14, 2008 9:48 am
Contact:

Re: Can't see zray in my application

Post by zvika » Thu Jan 28, 2016 2:37 pm

Hi
Is it possible that content-length is 0 (false on $size without output buffer) ?
what do you get from var_dump(ob_get_length()) ?
Zvika Dror
Zend Support Team

ragtek
Posts: 13
Joined: Mon Jul 27, 2009 9:07 am

Re: Can't see zray in my application

Post by ragtek » Thu Jan 28, 2016 10:21 pm

Nop, the content length is valid ( 70364 )
So to sum it up: It seems to be because of the content-length header, but i don't know why. Anyway i'm happy with the compromises that enabling zlib.output_compression fixed the issue for me.

chen3141
Posts: 4
Joined: Sat Apr 16, 2016 11:09 am
Contact:

Re: Can't see zray in my application

Post by chen3141 » Sun Apr 17, 2016 6:37 pm

thank you for the hint ;-)

User avatar
zvika
Zend Global Support
Posts: 997
Joined: Sun Dec 14, 2008 9:48 am
Contact:

Re: Can't see zray in my application

Post by zvika » Mon Apr 18, 2016 7:39 pm

Hi ragtek,
I tried to reproduce but it works as expected when I send Content-Length of the OB buffer, Z-Ray is in iFrame or not, and zlib.output_compression is On or Off.
There might be something else here - if you can reproduce or send us your request headers, we can further check. Please open a support ticket for any information you can provide about the request and outcome.

I have 3 Content-Length headers, probably overrides each other, and everything is OK.

Code: Select all

Content-Length: 17014
Content-Length: 33958
Content-Length: 70
Content-type: text/html; charset=UTF-8
Set-Cookie: ZDEDebuggerPresent=php,phtml,php3; path=/
X-UA-Compatible: "IE=edge"
ZRay-ID: 1@12208@1460973820@1
Extra-Header: SOMETHING
BTW - cookies might also be involved, perhaps you turned on debugging / debug all pages / next page etc, which made Z-Ray go away in debug mode?
Zvika Dror
Zend Support Team

Post Reply