Mobile agents issues

I’m trying to set up mobile agents and have following issues so far. Please help. Thanks a lot!

Basically, I followed this documentation.
https://sites.google.com/a/webpagetest.org/docs/private-instances/node-js-agent/setup

  1. Android phone.
    Everything works fine except for the filmstrip and video. As per the documentation above, I installed ImageMagick and ffmpeg is included already on the host. I’m wondering if ffmpet is required on the server side or the agent side. I also tried using ffmpeg 1.1.3 and it doesn’t work. There’s no file found under /video_1/.

  2. iOS
    (1) It mentions “work in progress” still in the documentation. Is it still workable? Is there any more recent documentation?
    (2) In the 2nd step, Install OpenSSH, does it mean to create a private key under ~/.ssh/id_dsa_ios on the device and public key on the host? On the device, which path should the file be put to? I mean which user’s home directory. Is it “root”? Should the user name be the same as the one on the host?
    (3) Should the host and the device be in the same network? Does the host connect to the device via network or USB?

If you are running 2.19 or Trunk they are needed agent-side. If you are running an earlier version they can be server-side as well but agent-side scales better (and you need to pass “–processvideo yes” with the wptdriver command-line).

You can test if things are configured correctly on the agent by going into the js/lib/video directory and trying “python visualmetrics.py --check” which will check the dependencies.

It is workable and that is the most recent documentation and matches what I did bringing them online on the public instance. iOS is extremely painful though because it requires a dedicated Mac OSX host for every single device if you want to be able to do video capture.

It means on the host and you need to install the public key into the authorized_keys on the device (for root). The agent is hard-coded to ssh to the iPhone using the private key in ~/.ssh/id_dsa_ios

Network doesn’t matter. The host connects to the phone over USB.

Hi Patrick,

Thanks so much for your detailed answer.

Regarding the video processing issue, I tried and got the following issues.

Node.js - v4.3.1
Python 2.7
Pillow -2.7
ImageMagick - 6.9.3-5 Q16
FFMPEG - tried both the version 2.8.4 which is included in ImageMagick and version 1.13 and the result looks the same.

  1. Version 2.19 - Filmstrip is generated though video is not available yet. However, I’m getting “browser crashed” error as below. Then the test ended and no repeat view. The first view result looks good. Any idea on it?

On the UI, I see this error message.

First View
(Test Error: Browser Crashed)
(Error: 99995)

And On the agent command output, I see this error message:

A Feb_29_13:37:24.491 C:\webpagetest_2.19\mobile\src\wpt_client.js:699 Client.fi
nishRun_ : Failed run 1a/1 of finished job 160301_YF_A: Browser Crashed
E Feb_29_13:38:26.838 C:\webpagetest_2.19\mobile\src\wd_server.js:1401 WebDriver
Server. : Test failed: Browser Crashed

The Config check result:

ffmpeg: OK
convert: OK
compare: OK
Pillow: OK
SSIM: FAIL

  1. I also tried version 2.18. With the same installation on the same host, I don’t see the above “browser crashed” error but the filmstrip and video are not generated. The config check looks good.

ffmpeg: OK
convert: OK
compare: OK
Pillow: OK

I tried the iphone agent and got the following error. Also attached please find the console out. Any idea?
[attachment=576]

E Mar_07_04:19:28.879 process_utils.js:371 Socket. : /Users/builder/wpt/agent/js/lib/ios/video/xrecord STDERR: 2016-03-07 04:19:28.877 xrecord[1931:13883] Timed out waiting to acquire lock
E Mar_07_04:19:39.001 wd_server.js:210 WebDriverServer. : Exception from “Run test”: Error: Connect DevTools
Wait timed out after 10003ms
A Mar_07_04:19:39.916 wpt_client.js:699 Client.finishRun_ : Finished run 1a/1 of job 160307_PK_27
E Mar_07_04:22:47.325 process_utils.js:371 Socket. : /Users/builder/wpt/agent/js/lib/ios/video/xrecord STDERR: 2016-03-07 04:22:47.323 xrecord[2054:14878] Breaking existing lock
E Mar_07_04:22:50.413 process_utils.js:371 Socket. : /Users/builder/wpt/agent/js/lib/ios/video/xrecord STDERR: 2016-03-07 04:22:50.413 xrecord[2054:14878] Starting capture…
E Mar_07_04:22:50.440 process_utils.js:371 Socket. : /Users/builder/wpt/agent/js/lib/ios/video/xrecord STDERR: 2016-03-07 04:22:50.440 xrecord[2054:14878] Recording started. Hit ctrl-C to stop.
E Mar_07_04:22:50.548 process_utils.js:371 Socket. : /Users/builder/wpt/agent/js/lib/ios/idevice/Darwin x86_64/ios_webkit_debug_proxy STDERR: Could not connect to lockdownd. Exiting.: No such file or directory
Unable to attach 06717e5a2e7fde6e6f2605c4401848aaf69ef8f8 inspector
E Mar_07_04:23:00.574 wd_server.js:210 WebDriverServer. : Exception from “Run test”: Error: Connect DevTools
Wait timed out after 10025ms
E Mar_07_04:23:00.621 wd_server.js:210 WebDriverServer. : Exception from “Capture Screen Shot”: Error: ‘/Users/builder/wpt/agent/js/lib/ios/idevice/Darwin x86_64/idevicescreenshot’ -u 06717e5a2e7fde6e6f2605c4401848aaf69ef8f8 failed, code 255, stdout[86] No device found with udid 06717e5a2e7fde6e6f2605c4401848aaf69ef8f8, is it plugged in?
A Mar_07_04:23:06.036 wpt_client.js:699 Client.finishRun_ : Finished run 1b/1 of finished job 160307_PK_27

Filmstrip being available means the agent is fine. The video generation itself is a server config issue and it needs ffmpeg on the server to render the videos (sorry, forgot about that bit). If you go to http:///install does it pass the ffmpeg checks on the server?

For the iOS agent, what version of OSX are you running and are you only running one agent at a time? The xrecord lock should only come into play when multiple instances are running at the same time (or maybe if it is running on an earlier version of OSX than what has been tested).

Thanks Patrick for your reply.

For iphone, I’m using iPhone 6 on ios 9 and osx 10.10.5.

For Android, if I use the latest version 2.19, I got the browser crash error. 2.18 is working fine.

[attachment=578]

Focusing on the 2.19 browser crash for right now, can you run the agent with “-m debug” and send me the output? Feel free to email it to pmeenan@webpagetest.org if you’d rather not post it.

I don’t think 2.18 had the crash detection but it’s also possible that something is unhappy with the trace collection that is triggering the crash (I have seen the blink.user_timing trace category crash desktop chrome and I’m wondering if it is also crashing your test case). 2.18 Also didn’t have the same end condition and would not wait for network activity to stop so it may have been stopping the tests earlier.

Does it crash when you run the same URL on the public WebPageTest agents (Moto G)?

Patrick,

For the iPhone testing, do you have any suggestion? Currently, it’s okay to run without video capture. But it crashes the host frequently. Even there’s no testing running and only the node.js agent is running, the host gets restarted automatically. And if I checked “Capture Video”, the test will fail.

Here’s the output log for Android running on 2.19.
[attachment=579]

And the command line error:

[code]
C:\webpagetest_2.19\mobile>wptdriver.bat -m debug -b android:TA25804C7W -i -s h
ttp://d-shc-00436935.test.com -l M3_1_Motorola --processvideo yes >out.txt

E Mar_09_14:41:04.606 C:\webpagetest_2.19\mobile\src\wd_server.js:1401 WebDriver
Server. : Test failed: Browser Crashed
A Mar_09_14:41:09.853 C:\webpagetest_2.19\mobile\src\wpt_client.js:699 Client.fi
nishRun_ : Failed run 1a/1 of finished job 160310_PC_D: Browser Crashed
A Mar_09_14:53:24.274 C:\webpagetest_2.19\mobile\src\wpt_client.js:433 Client.on
Signal_ : Received SIGINT, exiting.
[/[/code]code]

For the crash, can you try grabbing the latest js agent from Github trunk to see if it helps? I removed one suspect thing that I’ve seen crash the browser and I re-arranged the checks at the end of the test so if the browser crashes when pulling the trace data it won’t fail the test.

For iOS, can you try running xrecord directly on the command-line? At a minimum, if the lock is causing issues I can get rid of it because it was to support multiple devices running at the same time but that ends up freaking out OSX anyway so it didn’t help. If you open quicktime, can you record video from the attached phone?

I tried the latest code and it doesn’t work.

Logs? “Doesn’t work” doesn’t help identify any issues. The latest code is running on the public WebPageTest agents for both iOS and Android.

Sorry, since the behavior looks the same as the previous version, I didn’t attach the log here. Here you can find the log: [attachment=580]. And the android is working fine with 2.18, so I’m focusing on the iphone issues.

And also the console output:

E Mar_14_15:33:35.760 c:\webpagetest-master\agent\js\src\process_utils.js:343 Ch ildProcess.<anonymous> : ./ipfw_config clear --device TA25804C7W failed with exc eption: spawn ./ipfw_config ENOENT W Mar_14_15:33:55.231 c:\webpagetest-master\agent\js\src\wd_server.js:347 WebDri verServer.onDevToolsMessage_ : DevTools message: {"method":"Network.loadingFaile d","params":{"requestId":"15171.40","timestamp":1984523.324283,"type":"Document" ,"errorText":"","canceled":true}} E Mar_14_15:34:05.105 c:\webpagetest-master\agent\js\src\wd_server.js:1445 WebDr iverServer.<anonymous> : Test failed: Browser Crashed E Mar_14_15:34:05.152 c:\webpagetest-master\agent\js\src\process_utils.js:343 Ch ildProcess.<anonymous> : ./ipfw_config clear --device TA25804C7W failed with exc eption: spawn ./ipfw_config ENOENT A Mar_14_15:34:10.230 c:\webpagetest-master\agent\js\src\wpt_client.js:699 Clien t.finishRun_ : Failed run 1a/1 of finished job 160315_SS_5: Browser Crashed

Hi! I am running private instance on Windows (Server) and Test agent as mobile and most of the sites give Timeout Error in Result. Any idea how to correct it? I can see the website loaded on my mobile but it says Timeout error after a long time. I am using pidriver.sh file to run the agent.