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

Issue 775107 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

[Findit] gae_ts_mon prevents findit from running locally

Project Member Reported by wylieb@chromium.org, Oct 16 2017

Issue description

Commands I executed:
make polymer-install
make run

All services start, but when navigating to default endpoint I get the following traceback:

Traceback (most recent call last):
  File "/usr/local/google/home/wylieb/chromium/infra-internal/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/usr/local/google/home/wylieb/chromium/infra-internal/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
    handler, path, err = LoadObject(self._handler)
  File "/usr/local/google/home/wylieb/chromium/infra-internal/google_appengine/google/appengine/runtime/wsgi.py", line 85, in LoadObject
    obj = __import__(path[0])
  File "/usr/local/google/home/wylieb/chromium/infra-internal/infra/appengine/findit/main.py", line 8, in <module>
    import gae_ts_mon
  File "/usr/local/google/home/wylieb/chromium/infra-internal/infra/appengine/findit/first_party/gae_ts_mon/__init__.py", line 32, in <module>
    import infra_libs.ts_mon.httplib2_utils
  File "/usr/local/google/home/wylieb/chromium/infra-internal/infra/appengine/findit/first_party/gae_ts_mon/httplib2_utils.py", line 21, in <module>
    from infra_libs.ts_mon.common import http_metrics
  File "/usr/local/google/home/wylieb/chromium/infra-internal/infra/appengine/findit/first_party/gae_ts_mon/common/http_metrics.py", line 6, in <module>
    from infra_libs.ts_mon.common import metrics
  File "/usr/local/google/home/wylieb/chromium/infra-internal/infra/appengine/findit/first_party/gae_ts_mon/common/metrics.py", line 10, in <module>
    from infra_libs.ts_mon.protos import metrics_pb2
  File "/usr/local/google/home/wylieb/chromium/infra-internal/infra/appengine/findit/first_party/gae_ts_mon/protos/metrics_pb2.py", line 6, in <module>
    from google.protobuf.internal import enum_type_wrapper
  File "/usr/local/google/home/wylieb/chromium/infra-internal/google_appengine/google/appengine/tools/devappserver2/python/runtime/sandbox.py", line 1132, in load_module
    raise ImportError('No module named %s' % fullname)
ImportError: No module named google.protobuf

It looks like gae_ts_mon is preventing a localrun from taking place because it requires google.protobuf which isn't found.
 

Comment 1 by wylieb@chromium.org, Oct 16 2017

Owner: ----
Investigated a bit, looks like the module path is being updated here:

https://cs.chromium.org/chromium/infra/appengine_module/gae_ts_mon/__init__.py?l=19

Not sure why it's failing on a local run.

Comment 2 by wylieb@chromium.org, Oct 16 2017

Cc: dsansome@chromium.org
Hey Dave,

Could you take a quick look at this? Our local build is failing -- have you seen something like this before?
Cc: sergeybe...@chromium.org vadimsh@chromium.org
I don't work on this any more, maybe Sergey or Vadim can take a look?
Cc: katthomas@chromium.org
+katthomas@ had to deal with google.protobuf in infra.git lately - any ideas?

I also don't work on this directly anymore, but in theory it all should work locally. The fundamental problem here is that protobuf uses a "namespace" python package called "google", which only works if all packages under "google" declare it as "namespace". Unfortunatel, appengine creates its packages under "google" path without declaring it as "namespace", thus if appengine's "google" loads first, no further package under "google" can load later.

The 'gae_ts_mon' code referenced above attempts to amend this by adding protobuf to the "google" path (it's almost equivalent to how namespace packages are declared), but something must be loading incorrectly when it's run locally...
Cc: iannucci@chromium.org d...@chromium.org
Ah, yes, I did deal with this but with much support from Dan and Robbie. However, I was adding a dependency which depended on google.protobuf. I don't see why you would encounter this unless your environment isn't activated or configured correctly. So, just to double-check, is the environment activated and configured correctly? 

Comment 6 by wylieb@chromium.org, Oct 17 2017

Nothing jumps out at me.

"../../ENV/bin/python" "gae.py" devserver

Is the command that is used to run the app. Looks gae.py is symlinked, but that looks standard across the infra apps. Is there any setup that we might have missed that would prevent it from running locally?

(deploying this to appengine works)

Comment 7 by st...@chromium.org, Nov 8 2017

Owner: st...@chromium.org
Status: Assigned (was: Untriaged)
Project Member

Comment 8 by bugdroid1@chromium.org, Nov 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/infra/+/1f7c77e4d5a2f9c132fd04d8befd61bc108722d4

commit 1f7c77e4d5a2f9c132fd04d8befd61bc108722d4
Author: Shuotao Gao <stgao@chromium.org>
Date: Thu Nov 09 21:44:17 2017

[Findit] Fix path conflict of protobuf for non-production environment.

Bug:  775107 
Change-Id: I3f73336c1d928cfc9d79ab8536c13089e1dfce09
Reviewed-on: https://chromium-review.googlesource.com/761405
Reviewed-by: Brandon Wylie <wylieb@chromium.org>
Reviewed-by: Chan Li <chanli@chromium.org>
Commit-Queue: Shuotao Gao <stgao@chromium.org>

[modify] https://crrev.com/1f7c77e4d5a2f9c132fd04d8befd61bc108722d4/appengine/findit/appengine_config.py

Comment 9 by st...@chromium.org, Nov 9 2017

Status: Verified (was: Assigned)

Sign in to add a comment