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

Issue 665251 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Last visit > 30 days ago
Closed: Nov 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

[Predator] Figure out way to use ``CrashConfig.Get()`` locally without remote_api?

Project Member Reported by kateso...@chromium.org, Nov 15 2016

Issue description

Is there a way to use ``CrashConfig.Get()`` in local scripts? Basically to solve this, we need to figure out how to use key.get() for datastore in local script.


Traceback (most recent call last):
  File "run-predator.py", line 150, in <module>
    RunPredator()
  File "run-predator.py", line 133, in RunPredator
    culprits = GetCulprits(crashes, args.client, args.app, args.verbose)
  File "run-predator.py", line 93, in GetCulprits
    findit = FinditForClientID(client_id, LocalGitRepository())
  File "../../../crash/crash_pipeline.py", line 53, in FinditForClientID
    return cls(repository)
  File "../../../crash/findit_for_chromecrash.py", line 54, in __init__
    component_classifier_config = CrashConfig.Get().component_classifier
  File "../../../model/versioned_config.py", line 29, in Get
    config_data = cls.GetVersion(version=version)
  File "../../../model/versioned_model.py", line 68, in GetVersion
    root = root_key.get()
  File "/usr/local/google/home/katesonia/Workstation/chromium_infra/google_appengine/google/appengine/ext/ndb/key.py", line 572, in get
    return self.get_async(**ctx_options).get_result()
  File "/usr/local/google/home/katesonia/Workstation/chromium_infra/google_appengine/google/appengine/ext/ndb/tasklets.py", line 383, in get_result
    self.check_success()
  File "/usr/local/google/home/katesonia/Workstation/chromium_infra/google_appengine/google/appengine/ext/ndb/tasklets.py", line 427, in _help_tasklet_along
    value = gen.throw(exc.__class__, exc, tb)
  File "/usr/local/google/home/katesonia/Workstation/chromium_infra/google_appengine/google/appengine/ext/ndb/context.py", line 722, in get
    deadline=memcache_deadline)
  File "/usr/local/google/home/katesonia/Workstation/chromium_infra/google_appengine/google/appengine/ext/ndb/tasklets.py", line 430, in _help_tasklet_along
    value = gen.send(val)
  File "/usr/local/google/home/katesonia/Workstation/chromium_infra/google_appengine/google/appengine/ext/ndb/context.py", line 1104, in _memcache_get_tasklet
    rpc = memcache.create_rpc(deadline=deadline)
  File "/usr/local/google/home/katesonia/Workstation/chromium_infra/google_appengine/google/appengine/api/memcache/__init__.py", line 294, in create_rpc
    return apiproxy_stub_map.UserRPC('memcache', deadline, callback)
  File "/usr/local/google/home/katesonia/Workstation/chromium_infra/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 414, in __init__
    self.__rpc = CreateRPC(service, stubmap)
  File "/usr/local/google/home/katesonia/Workstation/chromium_infra/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 68, in CreateRPC
    assert stub, 'No api proxy found for service "%s"' % service
AssertionError: No api proxy found for service "memcache"


 

Comment 1 by wrengr@chromium.org, Nov 15 2016

I'd say that rather than using ``CrashConfig.Get()`` per se, we should have some class that encapsulates the configuration parameters and which can be both parsed from a text file as well as retrieved from the NDB store. This goes along with  https://crbug.com/659354 
Right, breaking the dependency would be great, so I don't need to do some mocking hack. 

But the problem of this issue remains, I cannot find a way to retrieve entity by key from NDB datastore, the remote_api seems needed... Now the best way I can think of is to index config by timestamp and get the latest config using remote_api. 

Any better idea?

Comment 3 by st...@chromium.org, Nov 15 2016

A question here:

1. Is it required for the delta-test to read data from NDB in the live app engine app? And why?

2. Why we want to use ``CrashConfig.Get()`` locally without remote_api? Do we need to read the config from the live app engine app or not?
1. Is it required for the delta-test to read data from NDB in the live app engine app? And why?
Not necessarily the latest config as long as 2 versions use the same config.
But we do need one config which is not very old. 

2. Why we want to use ``CrashConfig.Get()`` locally without remote_api? Do we need to read the config from the live app engine app or not?

we need to read config from live app. I cannot find a way to get the NDB date without remote_api, so I created the bug for discussion...

Status: WontFix (was: Untriaged)
After some experiment, the remote_api can work well without the iterator work around. Cannot recall why it didn't work for CrashConfig.Get before (some experiments long time ago...).

Comment 6 by st...@chromium.org, Nov 15 2016

I still don't understand why we want to read data from the __live__ NDB but __without__ remote_api.
But it is good that we figured out the correct solution in the end.
I meant without remote_api iterator hack. 

Sign in to add a comment