New issue
Advanced search Search tips

Issue 700234 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Extension Doc Server: Assert failure while running update_cache.py.

Project Member Reported by karandeepb@chromium.org, Mar 10 2017

Issue description

Chrome Version: 59.0.3033.0

Steps:
1) Run python chrome/common/extensions/docs/server2/update_cache.py  --no-push --save-file=FOOCACHE --data-source=api_list

It fails with -

INFO:root:Starting refresh from commit 52f904d3bf07e423a6bb907ff6f344935532affa...
INFO:root:Updating api_list...
ERROR:root:APIListDataSource: error Traceback (most recent call last):
  File "chrome/common/extensions/docs/server2/update_cache.py", line 99, in _UpdateDataSource
    data_source.Refresh().Get()
  File "/Users/karandeepb/Desktop/chromium/src/chrome/common/extensions/docs/server2/future.py", line 129, in Get
    self._Raise()
  File "/Users/karandeepb/Desktop/chromium/src/chrome/common/extensions/docs/server2/future.py", line 125, in Get
    self._value = self._callback()
  File "/Users/karandeepb/Desktop/chromium/src/chrome/common/extensions/docs/server2/future.py", line 114, in then
    return val.Get() if isinstance(val, Future) else val
  File "/Users/karandeepb/Desktop/chromium/src/chrome/common/extensions/docs/server2/future.py", line 129, in Get
    self._Raise()
  File "/Users/karandeepb/Desktop/chromium/src/chrome/common/extensions/docs/server2/future.py", line 125, in Get
    self._value = self._callback()
  File "/Users/karandeepb/Desktop/chromium/src/chrome/common/extensions/docs/server2/future.py", line 111, in then
    val = error_handler(e)
  File "/Users/karandeepb/Desktop/chromium/src/chrome/common/extensions/docs/server2/future.py", line 13, in _DefaultErrorHandler
    raise error
AssertionError

INFO:root:Updating api_list took 173 seconds
Traceback (most recent call last):
  File "chrome/common/extensions/docs/server2/update_cache.py", line 205, in <module>
    _Main(sys.argv[1:])
  File "chrome/common/extensions/docs/server2/update_cache.py", line 184, in _Main
    commit=commit)
  File "chrome/common/extensions/docs/server2/update_cache.py", line 122, in UpdateCache
    _UpdateDataSource(single_data_source, data_sources[single_data_source])
  File "chrome/common/extensions/docs/server2/update_cache.py", line 102, in _UpdateDataSource
    raise e
AssertionError


 
Though the stack trace does not show this, the failure is due to the assert failure on line 

assert isinstance(channel_info, ChannelInfo)

at https://cs.chromium.org/chromium/src/chrome/common/extensions/docs/server2/availability_finder.py?q=availability_finder.py&sq=package:chromium&l=91

The root cause behind this is that the _GetPredeterminedNodeAvailability calls self._branch_utility.GetStableChannelInfo(node_info['version']) for the Webstore API which returns None.

This only started failing recently since the API endpoint https://omahaproxy.appspot.com/history.json?channel=dev&os=win&json=1 that we use to find branches, stopped serving info. for version 15 (corresponding to Webstore API) recently.

Cc: rdevlin....@chromium.org lazyboy@chromium.org
Just to confirm. I'm seeing the same issue when auto-generating a ClojureScript wrapper library[1] for Chrome Extension APIs.

Also having two other minor issues I was able to work around in the past:

1. need to call build_server.main() before update_cache.py can be called from command-line:
https://github.com/binaryage/chromex/blob/fd4455e723843fca92417eba0c8b685a5222e5dd/tools/build-cache.sh#L45-L50

2. need to apply a patch to prevent assert breaking the cache update:
https://github.com/binaryage/chromex/blob/master/tools/chromium.patch

It would be great if those two could be addressed as well while you are at it. I'm currently running update_cache.py cold without loading prior state via --load-file.

[1] https://github.com/binaryage/chromex
Project Member

Comment 4 by bugdroid1@chromium.org, Mar 14 2017

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

commit 08614915649c30c0278a9b154825e370b819a6de
Author: karandeepb <karandeepb@chromium.org>
Date: Tue Mar 14 18:28:01 2017

Extensions: Fix DocServer assert failures.

Currently, there are a couple of assert failures happening for the DocServer.
Two issues are involved:

  - r446160 updated tools/json_schema_compiler/model.py. It changed the logic to
    assign the callback for a function, so that only the last parameter function
    of a function could be recognised as a callback. This broke some DocServer
    tests and hence the extension presubmit script.
  - Recently the API endpoint
    https://omahaproxy.appspot.com/history.json?channel=dev&os=win&json=1 that
    we use to fetch the branch for a particular Chrome version, stopped
    providing info. for version 15. This led to an assert failure when
    generating the Availability info. for the Webstore API.

This CL fixes the issues so that the extension presubmit tests pass. For issue
1, a new category type is introduced to APICategorizer for the internal APIs. It
is ensured that the API data source does not generate info. for internal APIs
which are never documented. Existing tests are updated to work around the fact
that only the last parameter of a function can be recognised as a callback.

For  issue 2 , it is ensured that the assert failure is not reached. However, the
core issue (omahaproxy endpoint not providing details of all Chrome versions)
still needs to be tackled.

BUG= 696767 ,  700234 

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

[modify] https://crrev.com/08614915649c30c0278a9b154825e370b819a6de/chrome/common/extensions/docs/server2/api_categorizer.py
[modify] https://crrev.com/08614915649c30c0278a9b154825e370b819a6de/chrome/common/extensions/docs/server2/api_data_source.py
[modify] https://crrev.com/08614915649c30c0278a9b154825e370b819a6de/chrome/common/extensions/docs/server2/api_schema_graph.py
[modify] https://crrev.com/08614915649c30c0278a9b154825e370b819a6de/chrome/common/extensions/docs/server2/app.yaml
[modify] https://crrev.com/08614915649c30c0278a9b154825e370b819a6de/chrome/common/extensions/docs/server2/availability_finder.py
[modify] https://crrev.com/08614915649c30c0278a9b154825e370b819a6de/chrome/common/extensions/docs/server2/test_data/object_level_availability/tabs.py

Status: Fixed (was: Assigned)
Regarding c#3, point 2, it should be fixed by the change in c#4. Feel free to open a new bug it it isn't.
Thanks for the fixes. I confirm that the c#4 commit fixed[1] my script as well and no extra patching of chromium is needed on my side anymore.

[1] https://github.com/binaryage/chromex/commit/15ccf7fab83b2a74b3f25967274b0b02c953f74e
Good to know!

Sign in to add a comment