tsuyopon / webpagetest

Automatically exported from code.google.com/p/webpagetest
0 stars 0 forks source link

04-16 22:38:15.203: W/BZ-Pcap2Har(1885): Failed to get har file from pcap [Status code:400] #82

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run mobitest + webpagetest
2. LogCat show following error
04-16 22:38:15.203: W/BZ-Pcap2Har(1885): Failed to get har file from pcap 
[Status code:400]
04-16 22:38:15.207: I/BZ-Pcap2Har(1885): Received a response from pcap2har 
(POST http://OO.OO.OO.OO/mobile/pcap2har.php HTTP/1.1) [Status Code: 400]
04-16 22:38:15.715: I/BZ-JobManager(1885): Preparing a POST request for 
pcap2har (http://OO.OO.OO.OO/mobile/pcap2har.php)
04-16 22:38:16.184: D/dalvikvm(1885): GC_FOR_MALLOC freed 1278K, 61% free 
3364K/8455K, external 4552K/4792K, paused 141ms
04-16 22:38:30.598: I/BZ-AsyncRequest(1885): Writing output to passed output 
stream/sdcard/blaze/120416_GP_2H_1_1.har
04-16 22:38:30.613: I/BZ-AsyncRequest(1885): Wrote data to output stream, total 
bytes: 251
04-16 22:38:30.617: W/BZ-Pcap2Har(1885): Failed to get har file from pcap 
[Status code:400]
04-16 22:38:30.617: I/BZ-Pcap2Har(1885): Received a response from pcap2har 
(POST http://OO.OO.OO.OO/mobile/pcap2har.php HTTP/1.1) [Status Code: 400]
04-16 22:38:31.258: D/dalvikvm(1885): GC_EXTERNAL_ALLOC freed 302K, 63% free 
3193K/8455K, external 3837K/4792K, paused 65ms
04-16 22:38:31.289: I/BZAgent(1885): Packaging up results for job: 120416_GP_2H
04-16 22:38:31.309: E/BZ-Run(1885): Could not read JSON
04-16 22:38:31.309: E/BZ-Run(1885): org.json.JSONException: Value Ret of type 
java.lang.String cannot be converted to JSONObject
04-16 22:38:31.309: E/BZ-Run(1885):     at 
org.json.JSON.typeMismatch(JSON.java:107)
04-16 22:38:31.309: E/BZ-Run(1885):     at 
org.json.JSONObject.<init>(JSONObject.java:158)
04-16 22:38:31.309: E/BZ-Run(1885):     at 
org.json.JSONObject.<init>(JSONObject.java:171)
04-16 22:38:31.309: E/BZ-Run(1885):     at 
com.blaze.android.agent.model.Run.readJSON(Run.java:197)
04-16 22:38:31.309: E/BZ-Run(1885):     at 
com.blaze.android.agent.model.JobResult.getJsonRepresentation(JobResult.java:109
)
04-16 22:38:31.309: E/BZ-Run(1885):     at 
com.blaze.android.agent.AgentActivity$7.run(AgentActivity.java:383)

3. What is the expected output? What do you see instead?
nomal har file result

What version of the product are you using? On what operating system?
wpt 2.6 + mobitest latest

Please provide any additional information below.

pcap file was created but when pcap2har.php called by mobitest, apache show 
error 
[Mon Apr 16 22:21:28 2012] [error] [client OO.OO.OO.OO] PHP Warning:  
file_get_contents(/tmp/1979794360/1979794360.har) [<a 
href='function.file-get-contents'>function.file-get-contents</a>]: failed to 
open stream: No such file or directory in /var/www/www/mobile/pcap2har.php on 
line 53
[Mon Apr 16 22:21:33 2012] [error] [client OO.OO.OO.OO] PHP Warning:  
file_get_contents(/tmp/2065827412/2065827412.har) [<a 
href='function.file-get-contents'>function.file-get-contents</a>]: failed to 
open stream: No such file or directory in /var/www/www/mobile/pcap2har.php on 
line 53
[Mon Apr 16 22:28:39 2012] [error] [client OO.OO.OO.OO] PHP Warning:  
file_get_contents(/tmp/781054697/781054697.har) [<a 
href='function.file-get-contents'>function.file-get-contents</a>]: failed to 
open stream: No such file or directory in /var/www/www/mobile/pcap2har.php on 
line 53
[Mon Apr 16 22:28:54 2012] [error] [client OO.OO.OO.OO] PHP Warning:  
file_get_contents(/tmp/1589127768/1589127768.har) [<a 
href='function.file-get-contents'>function.file-get-contents</a>]: failed to 
open stream: No such file or directory in /var/www/www/mobile/pcap2har.php on 
line 53

please help me.

Original issue reported on code.google.com by kyungor...@gmail.com on 16 Apr 2012 at 1:58

GoogleCodeExporter commented 9 years ago
Looking at the server code, I see that a 400 response happens when the server 
side pcap2har conversion script returns an error code.  This could be due to an 
invalid pcap file, a problem with your python setup, etc.

I added some code to make it clear what is going wrong.  Please sync your copy 
of webpagetest to r1198 or higher.  In the file 
www/webpagetest/mobile/pcap2har.php, find the following lines:

// Debugging flags.  Set to false by default.
define('FORCE_LOGGING_OF_PCAP2HAR_ERRORS', false);
define('RETAIN_PCAP_FILE_ON_ERROR', false);

Set both defines to true.  Now on errors, logs describing the problem will be 
written to www/webpagetest/mobile/log.txt .  Add that log to the bug, and I 
will have a better idea of what is going wrong.

Original comment by sker...@google.com on 18 Apr 2012 at 5:08

GoogleCodeExporter commented 9 years ago
Thanks It's python version problem. I update python version 2.7.2 then pcap2har 
step work well. but another problem occurred.

I attached screenshot of wpt waterfall. 

I think water fall start at ( 6. www.google.com - / )
I don't know why request 1 ~ 6 are there.

Original comment by kyungor...@gmail.com on 20 Apr 2012 at 2:21

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by PatMee...@gmail.com on 4 Jul 2013 at 5:39