New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 672340 link

Starred by 2 users

Issue metadata

Status: Archived
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug-Regression



Sign in to add a comment

[wifi_endtoend] network_WiFi_ChromeEndToEnd failing with "client test did not pass." Error

Project Member Reported by aashuto...@chromium.org, Dec 8 2016

Issue description

https://wmatrix.googleplex.com/failures/unfiltered?suites=wifi_endtoend&days_back=10&releases=tot&hide_missing=true&tests=network_WiFi_ChromeEndToEnd

Started failing since 9018.0.0

Sample failure: 

11/25 10:49:35.688 DEBUG|      abstract_ssh:0348| Using Rsync.
11/25 10:49:35.689 DEBUG|        base_utils:0185| Running 'rsync -L  --timeout=1800 --rsh='/usr/bin/ssh -a -x    -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o BatchMode=yes -o ConnectTimeout=30 -o ServerAliveInterval=900 -o ServerAliveCountMax=3 -o ConnectionAttempts=4 -o Protocol=2 -l root -p 22' -az --no-o --no-g root@chromeos9-row1-cart3-host8:"/tmp/autoserv-FK7psb/sysinfo.pickle" "/tmp/tmpBKLfAT"'
11/25 10:49:36.591 WARNI|              test:0606| Autotest caught exception when running test:
Traceback (most recent call last):
  File "/usr/local/autotest/client/common_lib/test.py", line 600, in _exec
    _call_test_function(self.execute, *p_args, **p_dargs)
  File "/usr/local/autotest/client/common_lib/test.py", line 804, in _call_test_function
    return func(*args, **dargs)
  File "/usr/local/autotest/client/common_lib/test.py", line 461, in execute
    dargs)
  File "/usr/local/autotest/client/common_lib/test.py", line 347, in _call_run_once_with_retry
    postprocess_profiled_run, args, dargs)
  File "/usr/local/autotest/client/common_lib/test.py", line 376, in _call_run_once
    self.run_once(*args, **dargs)
  File "/usr/local/autotest/server/site_tests/network_WiFi_ChromeEndToEnd/network_WiFi_ChromeEndToEnd.py", line 49, in run_once
    test=test, check_client_result=True)
  File "/usr/local/autotest/server/autotest.py", line 504, in run_test
    *args, **dargs)
  File "/usr/local/autotest/server/autotest.py", line 495, in run_timed_test
    self._check_client_test_result(host, test_name)
  File "/usr/local/autotest/server/autotest.py", line 473, in _check_client_test_result
    raise error.TestFail('%s client test did not pass.' % test_name)
TestFail: network_ChromeWifiEndToEnd client test did not pass.
 
Owner: steve...@chromium.org
Looks like the getEnabledNetworkTypes API is deprecated. https://developer.chrome.com/extensions/networkingPrivate#method-getEnabledNetworkTypes
We'll need to use getDeviceStates instead to get the network type.


Here is the error:

12/07 17:01:15.193 DEBUG|inspector_websocke:0097| sent [{
  "id": 7, 
  "method": "Runtime.evaluate", 
  "params": {
    "expression": "chromeTesting.networking.getEnabledNetworkDevices();; 0;", 
    "returnByValue": true
  }
}]
12/07 17:01:15.201 DEBUG|inspector_websocke:0164| got [{
  "id": 7, 
  "result": {
    "exceptionDetails": {
      "columnNumber": 26, 
      "exception": {
        "className": "TypeError", 
        "description": "TypeError: Cannot read property 'getEnabledNetworkTypes' of undefined\n    at Networking.getEnabledNetworkDevices (chrome-extension://agpdecomabdkdcjhchiibnloonmiipmj/background.js:49:27)\n    at <anonymous>:1:26", 
        "objectId": "{\"injectedScriptId\":1,\"id\":2}", 
        "subtype": "error", 
        "type": "object"
      }, 
      "exceptionId": 1, 
      "lineNumber": 48, 
      "scriptId": "40", 
      "text": "Uncaught"
    }, 
    "result": {
      "className": "TypeError", 
      "description": "TypeError: Cannot read property 'getEnabledNetworkTypes' of undefined\n    at Networking.getEnabledNetworkDevices (chrome-extension://agpdecomabdkdcjhchiibnloonmiipmj/background.js:49:27)\n    at <anonymous>:1:26", 
      "objectId": "{\"injectedScriptId\":1,\"id\":1}", 
      "subtype": "error", 
      "type": "object"
    }
  }
}]



Traceback (most recent call last):
  File "/usr/local/autotest/common_lib/test.py", line 600, in _exec
    _call_test_function(self.execute, *p_args, **p_dargs)
  File "/usr/local/autotest/common_lib/test.py", line 810, in _call_test_function
    raise error.UnhandledTestFail(e)
UnhandledTestFail: Unhandled EvaluateException: UncaughtTypeError:
TypeError: Cannot read property 'getEnabledNetworkTypes' of undefined
    at Networking.getEnabledNetworkDevices (chrome-extension://agpdecomabdkdcjhchiibnloonmiipmj/background.js:49:27)
    at <anonymous>:1:26
Traceback (most recent call last):
  File "/usr/local/autotest/common_lib/test.py", line 804, in _call_test_function
    return func(*args, **dargs)
  File "/usr/local/autotest/common_lib/test.py", line 461, in execute
    dargs)
  File "/usr/local/autotest/common_lib/test.py", line 347, in _call_run_once_with_retry
    postprocess_profiled_run, args, dargs)
  File "/usr/local/autotest/common_lib/test.py", line 376, in _call_run_once
    self.run_once(*args, **dargs)
  File "/usr/local/autotest/tests/network_ChromeWifiEndToEnd/network_ChromeWifiEndToEnd.py", line 216, in run_once
    enabled_devices = self.chrome_net.get_enabled_devices()
  File "/usr/local/autotest/cros/networking/chrome_testing/chrome_networking_test_api.py", line 56, in get_enabled_devices
    'getEnabledNetworkDevices')
  File "/usr/local/autotest/cros/networking/chrome_testing/chrome_networking_test_context.py", line 193, in call_test_function
    self.call_test_function_async(function, *args)
  File "/usr/local/autotest/cros/networking/chrome_testing/chrome_networking_test_context.py", line 144, in call_test_function_async
    'chromeTesting.networking.' + function + '(' + arguments + ');')
  File "/usr/local/telemetry/src/third_party/catapult/common/py_trace_event/py_trace_event/trace_event_impl/decorators.py", line 52, in traced_function
    return func(*args, **kwargs)
  File "/usr/local/telemetry/src/third_party/catapult/telemetry/telemetry/internal/browser/web_contents.py", line 174, in ExecuteJavaScript
    statement, context_id=None, timeout=timeout)
  File "/usr/local/telemetry/src/third_party/catapult/common/py_trace_event/py_trace_event/trace_event_impl/decorators.py", line 52, in traced_function
    return func(*args, **kwargs)
  File "/usr/local/telemetry/src/third_party/catapult/telemetry/telemetry/internal/browser/web_contents.py", line 207, in ExecuteJavaScriptInContext
    expr, context_id=context_id, timeout=timeout)
  File "/usr/local/telemetry/src/third_party/catapult/common/py_trace_event/py_trace_event/trace_event_impl/decorators.py", line 52, in traced_function
    return func(*args, **kwargs)
  File "/usr/local/telemetry/src/third_party/catapult/telemetry/telemetry/internal/backends/chrome_inspector/inspector_backend.py", line 36, in inner
    return func(inspector_backend, *args, **kwargs)
  File "/usr/local/telemetry/src/third_party/catapult/telemetry/telemetry/internal/backends/chrome_inspector/inspector_backend.py", line 199, in ExecuteJavaScript
    self._runtime.Execute(expr, context_id, timeout)
  File "/usr/local/telemetry/src/third_party/catapult/telemetry/telemetry/internal/backends/chrome_inspector/inspector_runtime.py", line 21, in Execute
    self.Evaluate(expr + '; 0;', context_id, timeout)
  File "/usr/local/telemetry/src/third_party/catapult/telemetry/telemetry/internal/backends/chrome_inspector/inspector_runtime.py", line 54, in Evaluate
    description=details.get('exception', {}).get('description'))
EvaluateException: UncaughtTypeError:
TypeError: Cannot read property 'getEnabledNetworkTypes' of undefined
    at Networking.getEnabledNetworkDevices (chrome-extension://agpdecomabdkdcjhchiibnloonmiipmj/background.js:49:27)
    at <anonymous>:1:26
Cc: -harpreet@chromium.org steve...@chromium.org
Owner: harpreet@chromium.org
Status: Available (was: Untriaged)
getEnabledNetworkTypes is "deprecated" in the sense that getDeviceStates is a better API to use, but I don't think support for it has been removed.

The error is 'Cannot read property 'getEnabledNetworkTypes' of undefined, which suggests that 'Networking' is undefined in the extension.

Cc: -steve...@chromium.org harpreet@chromium.org
Owner: steve...@chromium.org
ok. Assigning this to you.
Cc: steve...@chromium.org
Owner: aashuto...@chromium.org
Status: Assigned (was: Available)
I don't really know much about this test. I see failures going back to R53, but I can't find how to look at all runs to get a sense of the failure rate.

When I click on 'logs' I get an empty result. How does one go about debugging this?

It seems most likely that an autotest change or something unrelated to the networking code caused this to start failing if 'Networking' is undefined in the test.

(Does anyone know where the source of the extension referenced in the test is?)

re. #6 I am attaching the logs from 1 of the test failure runs. 

From what I can tell, no recent change has been made to this test.. https://cs.corp.google.com/chromeos_public/src/third_party/autotest/files/client/site_tests/network_ChromeWifiEndToEnd/network_ChromeWifiEndToEnd.py

chrome_networking_test_context which is used by each end to end ui networking test: https://cs.corp.google.com/chromeos_public/src/third_party/autotest/files/client/cros/networking/chrome_testing/chrome_networking_test_context.py




re. #7 No idea where the extension source is. There is a wrapper for chrome.networkingPrivate that you have worked on in the past https://cs.corp.google.com/chromeos_public/src/third_party/autotest/files/client/cros/networking/chrome_testing/network_test_ext/


89527825-chromeos-test%2Fchromeos2-row11-rack7-host4%2Fnetwork_WiFi_ChromeEndToEnd.tgz
26.6 MB Download
Cc: xiy...@chromium.org rdevlin....@chromium.org achuith@chromium.org
Owner: harpreet@chromium.org
So looking at the extension code, background.js:49:
https://cs.corp.google.com/chromeos_public/src/third_party/autotest/files/client/cros/networking/chrome_testing/network_test_ext/background.js?l=49

It is attempting to call chrome.networkingPrivate.getEnabledNetworkTypes

But chrome.networkingPrivate appears to be undefined.

This suggests that the extension no longer has permissions to access chrome.networkingPrivate.

+rdevlin@, +xiyuan@, +achuith@ - Any idea what might have changed to cause this to fail?

Random shot in the dark could be that crrev.com/1cc8fc7b0404e98ed920e13a0d5dca44aeac7b71 removed the ability to load unpacked extensions as component extensions, since it's a very dangerous flag.  I don't see that test doing it anywhere, but maybe there is a use somewhere else in the test setup?
Who is the right owner for this?
I believe this is fallout from https://bugs.chromium.org/p/chromium/issues/detail?id=654525

--load-component-extension is going away, and telemetry no longer supports this.

Looks like I missed network_WiFi_ChromeEndToEnd unfortunately.

I believe we want to add the extension used by the autotest here to the networkingPrivate whitelist. Here's the whitelist:
https://cs.chromium.org/chromium/src/extensions/common/api/_permission_features.json?l=311-344


This is the extension:
https://cs.corp.google.com/chromeos_public/src/third_party/autotest/files/client/cros/networking/chrome_testing/network_test_ext/

And this is where it's loaded into chrome:
https://cs.corp.google.com/chromeos_public/src/third_party/autotest/files/client/cros/networking/chrome_testing/chrome_networking_test_context.py?l=35-36

Unfortunately I'm away on vacation and can't take this on until I get back (Jan 2). 

But it should be pretty straightforward to update the whitelist.

Owner: steve...@chromium.org
Maybe Steven?
Achuith - I am looking into updating https://cs.chromium.org/chromium/src/extensions/common/api/_permission_features.json?l=311-344 with networking private extension id but I am not sure where to find this ID. I see the key in the manifest but how do I find the ID?
https://cs.corp.google.com/chromeos_public/src/third_party/autotest/files/client/cros/networking/chrome_testing/network_test_ext/manifest.json



Would it be agpdecomabdkdcjhchiibnloonmiipmj as listed in some of the log message?

Networking.getEnabledNetworkDevices (chrome-extension://agpdecomabdkdcjhchiibnloonmiipmj/background.js:49:27)\n    at 
The features json file uses the sha1 hash of the app id [1]

run this to get it for "agpdecomabdkdcjhchiibnloonmiipmj":

$ echo -n "agpdecomabdkdcjhchiibnloonmiipmj" | \
     sha1sum | tr '[:lower:]' '[:upper:]'

=> 23D8847AE3EE90122AA34657360AFEEC8B3E611B

[1] https://cs.chromium.org/chromium/src/chrome/common/extensions/api/_features.md?rcl=0&l=337
Whitelist extension used by autotest to use networkingPrivate.

Extension ID: agpdecomabdkdcjhchiibnloonmiipmj
Hashed Extension ID: 23D8847AE3EE90122AA34657360AFEEC8B3E611B


CL: https://codereview.chromium.org/2614023003/
 Issue 678780  has been merged into this issue.
Owner: harpreet@chromium.org
Tested the potential fix (https://codereview.chromium.org/2614023003/). It works as expected:

====================
WITH THE FIX:
====================

01/06 13:39:04.267 DEBUG|inspector_websocke:0097| sent [{
  "id": 7,
  "method": "Runtime.evaluate",
  "params": {
    "expression": "chromeTesting.networking.getEnabledNetworkDevices();; 0;",
    "returnByValue": true
  }
}]
01/06 13:39:04.275 DEBUG|inspector_websocke:0164| got [{
  "id": 7,
  "result": {
    "result": {
      "description": "0",
      "type": "number",
      "value": 0
    }
  }
}]
01/06 13:39:04.277 DEBUG|inspector_websocke:0097| sent [{
  "id": 8,
  "method": "Runtime.evaluate",
  "params": {
    "expression": "chromeTesting.networking.callStatus.getEnabledNetworkDevices",
    "returnByValue": true
  }
}]
01/06 13:39:04.277 DEBUG|inspector_websocke:0164| got [{
  "id": 8,
  "result": {
    "result": {
      "type": "object",
      "value": {
        "error": null,
        "result": [
          "Ethernet",
          "WiFi"
        ],
        "status": "chrome-test-call-status-success"
      }
    }
  }
}]
01/06 13:39:04.278 DEBUG|inspector_websocke:0097| sent [{
  "id": 9,
  "method": "Runtime.evaluate",
  "params": {
    "expression": "chromeTesting.networking.callStatus.getEnabledNetworkDevices",
    "returnByValue": true
  }
}]
01/06 13:39:04.278 DEBUG|inspector_websocke:0164| got [{
  "id": 9,
  "result": {
    "result": {
      "type": "object",
      "value": {
        "error": null,
        "result": [
          "Ethernet",
          "WiFi"
        ],
        "status": "chrome-test-call-status-success"
      }
    }
  }
}]
01/06 13:39:04.278 INFO |chrome_networking_:0059| Enabled Network Devices: [u'Ethernet', u'WiFi']
01/06 13:39:04.278 DEBUG|network_ChromeCell:0259| Enabled devices: [u'Ethernet', u'WiFi']
01/06 13:39:04.278 INFO |chrome_networking_:0090| Enabling: Cellular
01/06 13:39:04.280 DEBUG|inspector_websocke:0097| sent [{
  "id": 10,
  "method": "Runtime.evaluate",
  "params": {
    "expression": "chromeTesting.networking.enableNetworkDevice(\"Cellular\");; 0;",
    "returnByValue": true
  }
}]
01/06 13:39:04.281 DEBUG|inspector_websocke:0164| got [{
  "id": 10,
  "result": {
    "result": {
      "description": "0",
      "type": "number",
      "value": 0
    }
  }
}]



=======================
WITHOUT THE FIX
=======================

01/06 14:01:57.616 DEBUG|inspector_websocke:0097| sent [{
  "id": 7,
  "method": "Runtime.evaluate",
  "params": {
    "expression": "chromeTesting.networking.getEnabledNetworkDevices();; 0;",
    "returnByValue": true
  }
}]
01/06 14:01:57.618 DEBUG|inspector_websocke:0164| got [{
  "id": 7,
  "result": {
    "exceptionDetails": {
      "columnNumber": 26,
      "exception": {
        "className": "TypeError",
        "description": "TypeError: Cannot read property 'getEnabledNetworkTypes' of undefined\n    at Networking.getEnabledNetworkDevices (chrome-extension://agpdecomabdkdcjhchiibnloonmiipmj/background.js:49:27)\n    at <anonymous>:1:26",
        "objectId": "{\"injectedScriptId\":1,\"id\":2}",
        "subtype": "error",
        "type": "object"
      },
      "exceptionId": 1,
      "lineNumber": 48,
      "scriptId": "42",
      "text": "Uncaught"
    },
    "result": {
      "className": "TypeError",
      "description": "TypeError: Cannot read property 'getEnabledNetworkTypes' of undefined\n    at Networking.getEnabledNetworkDevices (chrome-extension://agpdecomabdkdcjhchiibnloonmiipmj/background.js:49:27)\n    at <anonymous>:1:26",
      "objectId": "{\"injectedScriptId\":1,\"id\":1}",
      "subtype": "error",
      "type": "object"
    }
  }
}]

Project Member

Comment 21 by bugdroid1@chromium.org, Jan 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a6e8cd6a118d18cef16398294ca5b44e6f723dff

commit a6e8cd6a118d18cef16398294ca5b44e6f723dff
Author: harpreet <harpreet@chromium.org>
Date: Tue Jan 10 19:04:37 2017

Whitelist extension used by autotest to use networkingPrivate.

BUG= 672340 

Review-Url: https://codereview.chromium.org/2614023003
Cr-Commit-Position: refs/heads/master@{#442645}

[modify] https://crrev.com/a6e8cd6a118d18cef16398294ca5b44e6f723dff/extensions/common/api/_permission_features.json

Project Member

Comment 22 by bugdroid1@chromium.org, Jan 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/autotest/+/3121ec87c4b946d6e0df7a08a974b942bec36a8a

commit 3121ec87c4b946d6e0df7a08a974b942bec36a8a
Author: harpreet <harpreet@google.com>
Date: Fri Jan 06 18:51:58 2017

Use networking.onc instead of networkingPrivate extension

Also replace deprecated networking API methods.

BUG= chromium:672340 
TEST=Tested locally.

Change-Id: Ie1ed0268b9770794cc6a83835560ba9bbe61f71d
Reviewed-on: https://chromium-review.googlesource.com/425822
Commit-Ready: Harpreet Grewal <harpreet@chromium.org>
Tested-by: Harpreet Grewal <harpreet@chromium.org>
Reviewed-by: Harpreet Grewal <harpreet@chromium.org>

[modify] https://crrev.com/3121ec87c4b946d6e0df7a08a974b942bec36a8a/client/cros/networking/chrome_testing/network_test_ext/manifest.json
[modify] https://crrev.com/3121ec87c4b946d6e0df7a08a974b942bec36a8a/client/cros/networking/chrome_testing/network_test_ext/background.js

Status: Fixed (was: Assigned)

Comment 24 by dchan@google.com, Mar 4 2017

Labels: VerifyIn-58

Comment 25 by dchan@google.com, Apr 17 2017

Labels: VerifyIn-59

Comment 26 by dchan@google.com, May 30 2017

Labels: VerifyIn-60
Labels: VerifyIn-61

Comment 28 by dchan@chromium.org, Oct 14 2017

Status: Archived (was: Fixed)

Sign in to add a comment