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

Issue 709613 link

Starred by 2 users

Issue metadata

Status: Archived
Owner: ----
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

DistributionNotFound: gcloud when running export_to_gcloud on release builders

Project Member Reported by pho...@chromium.org, Apr 7 2017

Issue description

https://uberchromegw.corp.google.com/i/chromeos_release/builders/samus-pre-flight-branch%20release-R58-9334.B/builds/172/steps/Report/logs/stdio

13:23:07: INFO: RunCommand: /b/cbuild/shared_internal/chromite/bin/export_to_gcloud /creds/service_accounts/service-account-chromeos-datastore-writer-prod.json /tmp/cbuildbot-tmpLdZHP0/cbuildbot-tmp3AGfyN/tmpPZtll7
Traceback (most recent call last):
  File "/b/cbuild/shared_internal/chromite/bin/export_to_gcloud", line 102, in <module>
    main()
  File "/b/cbuild/shared_internal/chromite/bin/export_to_gcloud", line 40, in main
    wrapper.DoMain()
  File "/b/cbuild/shared_internal/chromite/scripts/wrapper.py", line 164, in DoMain
    commandline.ScriptWrapperMain(FindTarget)
  File "/b/cbuild/shared_internal/chromite/lib/commandline.py", line 814, in ScriptWrapperMain
    target = find_target_func(target)
  File "/b/cbuild/shared_internal/chromite/scripts/wrapper.py", line 139, in FindTarget
    module = cros_import.ImportModule(target)
  File "/b/cbuild/shared_internal/chromite/lib/cros_import.py", line 43, in ImportModule
    module = __import__(target)
  File "/b/cbuild/shared_internal/chromite/scripts/export_to_gcloud.py", line 9, in <module>
    from gcloud import datastore
  File "/b/cbuild/shared_internal/chromite/venv/.venv/lib/python2.7/site-packages/gcloud/__init__.py", line 19, in <module>
    __version__ = get_distribution('gcloud').version
  File "/b/build/third_party/setuptools-0.6c11/pkg_resources.py", line 311, in get_distribution
    if isinstance(dist,Requirement): dist = get_provider(dist)
  File "/b/build/third_party/setuptools-0.6c11/pkg_resources.py", line 197, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/b/build/third_party/setuptools-0.6c11/pkg_resources.py", line 666, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/b/build/third_party/setuptools-0.6c11/pkg_resources.py", line 565, in resolve
    raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: gcloud



Some googling indicates this can be caused by old versions of setuptools (https://github.com/tony/tmuxp/issues/111). Note, from the stacktrace, it is using setuptools-0.6c11, which is a version from 2009 (!). Latest setuptools is 34.3.3, from 2017/03.

Is export_to_gcloud running under a virtualenv? Is this caused by a change to that?
 
Cc: d...@chromium.org
+dnj

The really, really old setup tools in /b/build/third_party is managed by CrOps, not us.

My spot checking shows that this error is happening on many (all?) builders on the chromeos release waterfall, but not on any other waterfall. On the release waterfall, it's happening on both baremetal and GCE builders.
Potential duplicate of https://bugs.chromium.org/p/chromium/issues/detail?id=707456

Looks like the optimistic fix didn't work, or there are multiple factors causing this issue.
Something is injecting /b/build/third_party into the virtualenv.  The initial working theory was that PYTHONPATH was being used.

You can see in the traceback that Python is jumping into the virtualenv then jumping back out.
Cc: davidri...@chromium.org
Owner: dgarr...@chromium.org
Actually, this build is using an old version of chromite, so it doesn't have the fix.

I'm not sure what can be done here other than upgrade chromite.

+davidriley for export_to_gcloud discussion
If the change is simple and innocuous, lets backport it, otherwise, let's just live with the lack of data.
I'm not assuming this is a virtualenv bug that would be fixed by cleaning PYTHONPATH at entry?
Owner: ayatane@chromium.org
Labels: -Pri-1 Pri-2
Owner: ----
My understanding of this issue at this point is that old builders are going to need a backport of the fix.  I'm not really sure about the backport process, but the commit is referenced in the other bug if anyone wants to do it.
Status: Archived (was: Untriaged)
This bug is very old, is Untriaged, and has no owner.  If it is still relevant, reopen as Untriaged or open a new bug

Sign in to add a comment