Errors when building the Gitlies plugin: AttributeError: ZipFile instance has no attribute '__exit__'

197 views
Skip to first unread message

Ólafur Egilsson

unread,
Jun 15, 2015, 4:46:30 AM6/15/15
to repo-d...@googlegroups.com
Can anyone spot the problem I'm having when trying to build the Gitlies plugin for Gerrit v10.2?

cd gerrit
git checkout v2.10.2
cd gitlies
git checkout remotes/origin/stable-2.10
cd ../..
buck build plugins/gitiles:gitiles

I've tried changing to python 2.7 with:
update-alternatives --config python

Output:
/local/software/buck/bin/buck_common: line 64: watchman: command not found
Watchman not found, please install when using buckd.
[-] PARSING BUILD FILES...FINISHED 2.0s
Traceback (most recent call last):
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
    self.execute_entry(entry_point, args)
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
    runner(entry_point)
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
    runpy.run_module(module_name, run_name='__main__')
  File "/usr/lib64/python2.6/runpy.py", line 140, in run_module
    fname, loader, pkg_name)
  File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code
    exec code in run_globals
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/tools/download_file.py", line 145, in <module>
AttributeError: ZipFile instance has no attribute '__exit__'
Traceback (most recent call last):
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
    self.execute_entry(entry_point, args)
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
    runner(entry_point)
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
    runpy.run_module(module_name, run_name='__main__')
  File "/usr/lib64/python2.6/runpy.py", line 140, in run_module
    fname, loader, pkg_name)
  File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code
    exec code in run_globals
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/tools/download_file.py", line 145, in <module>
AttributeError: ZipFile instance has no attribute '__exit__'

Traceback (most recent call last):
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
    self.execute_entry(entry_point, args)
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
    runner(entry_point)
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
    runpy.run_module(module_name, run_name='__main__')
  File "/usr/lib64/python2.6/runpy.py", line 140, in run_module
    fname, loader, pkg_name)
  File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code
    exec code in run_globals
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/tools/download_file.py", line 155, in <module>
AttributeError: ZipFile instance has no attribute '__exit__'
Traceback (most recent call last):
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
    self.execute_entry(entry_point, args)
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
    runner(entry_point)
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
    runpy.run_module(module_name, run_name='__main__')
  File "/usr/lib64/python2.6/runpy.py", line 140, in run_module
    fname, loader, pkg_name)
  File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code
    exec code in run_globals
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/tools/download_file.py", line 155, in <module>
AttributeError: ZipFile instance has no attribute '__exit__'

Traceback (most recent call last):
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
    self.execute_entry(entry_point, args)
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
    runner(entry_point)
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
    runpy.run_module(module_name, run_name='__main__')
  File "/usr/lib64/python2.6/runpy.py", line 140, in run_module
    fname, loader, pkg_name)
  File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code
    exec code in run_globals
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/tools/download_file.py", line 155, in <module>
AttributeError: ZipFile instance has no attribute '__exit__'
Traceback (most recent call last):
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
    self.execute_entry(entry_point, args)
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
    runner(entry_point)
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
    runpy.run_module(module_name, run_name='__main__')
  File "/usr/lib64/python2.6/runpy.py", line 140, in run_module
    fname, loader, pkg_name)
  File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code
    exec code in run_globals
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/tools/download_file.py", line 155, in <module>
AttributeError: ZipFile instance has no attribute '__exit__'

Traceback (most recent call last):
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
    self.execute_entry(entry_point, args)
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
    runner(entry_point)
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
    runpy.run_module(module_name, run_name='__main__')
  File "/usr/lib64/python2.6/runpy.py", line 140, in run_module
    fname, loader, pkg_name)
  File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code
    exec code in run_globals
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/tools/download_file.py", line 155, in <module>
AttributeError: ZipFile instance has no attribute '__exit__'
Traceback (most recent call last):
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
    self.execute_entry(entry_point, args)
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
    runner(entry_point)
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
    runpy.run_module(module_name, run_name='__main__')
  File "/usr/lib64/python2.6/runpy.py", line 140, in run_module
    fname, loader, pkg_name)
  File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code
    exec code in run_globals
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/tools/download_file.py", line 155, in <module>
AttributeError: ZipFile instance has no attribute '__exit__'

Traceback (most recent call last):
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
    self.execute_entry(entry_point, args)
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
    runner(entry_point)
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
    runpy.run_module(module_name, run_name='__main__')
  File "/usr/lib64/python2.6/runpy.py", line 140, in run_module
    fname, loader, pkg_name)
  File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code
    exec code in run_globals
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/tools/download_file.py", line 145, in <module>
AttributeError: ZipFile instance has no attribute '__exit__'
Traceback (most recent call last):
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 223, in execute
    self.execute_entry(entry_point, args)
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 271, in execute_entry
    runner(entry_point)
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/.bootstrap/_twitter_common_python/pex.py", line 288, in execute_module
    runpy.run_module(module_name, run_name='__main__')
  File "/usr/lib64/python2.6/runpy.py", line 140, in run_module
    fname, loader, pkg_name)
  File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code
    exec code in run_globals
  File "/home/ec2-user/gerrit/buck-out/bin/tools/download_file.pex/tools/download_file.py", line 145, in <module>
AttributeError: ZipFile instance has no attribute '__exit__'

BUILD FAILED: //lib/jgit:jgit-servlet__download_bin failed with exit code 1:
genrule
[-] BUILDING...FINISHED 1.3s



David Ostrovsky

unread,
Jun 15, 2015, 5:45:10 AM6/15/15
to repo-d...@googlegroups.com

Am Montag, 15. Juni 2015 10:46:30 UTC+2 schrieb Ólafur Egilsson:
Can anyone spot the problem I'm having when trying to build the Gitlies plugin for Gerrit v10.2?

Nope. Buck team forked some parts of twitter commons PEX framework to package python_binary()
artefacts as PEX file. It works for us as expected on many different Linux versions and flavors. Only
once PEX related environment problem was reported: [2]. Unfortunately, Buck team wasn't able to find out
the root cause. Clean up your environment should probably help.



Björn Pedersen

unread,
Jun 18, 2015, 11:30:33 AM6/18/15
to repo-d...@googlegroups.com
Hi,

I had the same errors quite often. It boilded down to a download of wrong pex-files (The zip-file contruct used seems to be available reliably only python 2.7).
You have to ensure that everything is run with a path set in a way that python is a python 2.7.

See also
https://gerrit-review.googlesource.com/#/c/68145/
which ensure the correct python is used if using virtualenvs.

Björn
Reply all
Reply to author
Forward
0 new messages