Bug 969953 - Meet "NameError: global name 're' is not defined" while trying to install pymongo for python-2.7 or git push to scaled up python-2.7 app
Meet "NameError: global name 're' is not defined" while trying to install py...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Mrunal Patel
libra bugs
: Regression
: 971527 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-03 03:21 EDT by Meng Bo
Modified: 2015-05-14 19:20 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-24 10:50:19 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Meng Bo 2013-06-03 03:21:02 EDT
Description of problem:
Create python-2.7 app, and modify the setup.py to install the pymongo package.
It will fail when installing.

Version-Release number of selected component (if applicable):
STG(devenv-stage_356) , devenv_3307

How reproducible:
always

Steps to Reproduce:
1.Create python-2.7 app
2.Modify the setup.py and uncomment the pymongo line
3.Do git push

Actual results:
It will fail due to some dependencies issue.
Full log pasted in Additional info.

Expected results:
Should install the pymongo without issue.

Additional info:
It worked well in our testing in last week.

remote: Installed /var/lib/openshift/51ac31d62587c8f73500030a/app-root/runtime/repo
remote: Processing dependencies for YourAppName==1.0
remote: Searching for pymongo
remote: Reading http://mirror1.ops.rhcloud.com/mirror/python/web/simple/pymongo/
remote: Best match: pymongo 2.5.2
remote: Downloading http://mirror1.ops.rhcloud.com/mirror/python/web/packages/source/p/pymongo/pymongo-2.5.2.tar.gz#md5=d1ada91f0ec474534eab88429fb6ce5e
remote: Processing pymongo-2.5.2.tar.gz
remote: Running pymongo-2.5.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-5hOb96/pymongo-2.5.2/egg-dist-tmp-5RnOXW
remote: zip_safe flag not set; analyzing archive contents...
remote: Adding pymongo 2.5.2 to easy-install.pth file
remote: 
remote: Installed /var/lib/openshift/51ac31d62587c8f73500030a/python/virtenv/lib/python2.7/site-packages/pymongo-2.5.2-py2.7-linux-x86_64.egg
remote: Searching for gevent
remote: Reading http://mirror1.ops.rhcloud.com/mirror/python/web/simple/gevent/
remote: Reading http://www.gevent.org/
remote: Reading http://gevent.org/
remote: Best match: gevent 0.13.8
remote: Downloading http://mirror1.ops.rhcloud.com/mirror/python/web/packages/source/g/gevent/gevent-0.13.8.tar.gz#md5=ca9dcaa7880762d8ebbc266b11252960
remote: Processing gevent-0.13.8.tar.gz
remote: Running gevent-0.13.8/setup.py -q bdist_egg --dist-dir /tmp/easy_install-q68xa6/gevent-0.13.8/egg-dist-tmp-JJASjm
remote: zip_safe flag not set; analyzing archive contents...
remote: Linking /tmp/easy_install-q68xa6/gevent-0.13.8/build/lib.linux-x86_64-2.7/gevent/core.so to /tmp/easy_install-q68xa6/gevent-0.13.8/gevent/core.so
remote: Adding gevent 0.13.8 to easy-install.pth file
remote: 
remote: Installed /var/lib/openshift/51ac31d62587c8f73500030a/python/virtenv/lib/python2.7/site-packages/gevent-0.13.8-py2.7-linux-x86_64.egg
remote: Searching for greenlet
remote: Reading http://mirror1.ops.rhcloud.com/mirror/python/web/simple/greenlet/
remote: Best match: greenlet 0.4.0
remote: Downloading http://mirror1.ops.rhcloud.com/mirror/python/web/packages/source/g/greenlet/greenlet-0.4.0.zip#md5=87887570082caadc08fb1f8671dbed71
remote: Processing greenlet-0.4.0.zip
remote: Running greenlet-0.4.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-fZsKlZ/greenlet-0.4.0/egg-dist-tmp-bU9kJd
remote: greenlet.c: In function 'g_switch':
remote: greenlet.c:543: warning: 'err' may be used uninitialized in this function
remote: Adding greenlet 0.4.0 to easy-install.pth file
remote: 
remote: Installed /var/lib/openshift/51ac31d62587c8f73500030a/python/virtenv/lib/python2.7/site-packages/greenlet-0.4.0-py2.7-linux-x86_64.egg
remote: Finished processing dependencies for YourAppName==1.0
remote: Error in atexit._run_exitfuncs:
remote: Traceback (most recent call last):
remote:   File "/var/lib/openshift/51ac31d62587c8f73500030a/python/opt/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
remote:     func(*targs, **kargs)
remote:   File "/var/lib/openshift/51ac31d62587c8f73500030a/python/opt/lib/python2.7/multiprocessing/util.py", line 284, in _exit_function
remote:     info('process shutting down')
remote: TypeError: 'NoneType' object is not callable
remote: Error in sys.exitfunc:
remote: Traceback (most recent call last):
remote:   File "/var/lib/openshift/51ac31d62587c8f73500030a/python/opt/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
remote:     func(*targs, **kargs)
remote:   File "/var/lib/openshift/51ac31d62587c8f73500030a/python/opt/lib/python2.7/multiprocessing/util.py", line 284, in _exit_function
remote:     info('process shutting down')
remote: TypeError: 'NoneType' object is not callable
remote:  - Done processing setup.py
remote: Making script /var/lib/openshift/51ac31d62587c8f73500030a/python//virtenv/bin/easy_install-2.7 relative
remote: Making script /var/lib/openshift/51ac31d62587c8f73500030a/python//virtenv/bin/pip relative
remote: Making script /var/lib/openshift/51ac31d62587c8f73500030a/python//virtenv/bin/pip-2.7 relative
remote: Script /var/lib/openshift/51ac31d62587c8f73500030a/python//virtenv/bin/activate.fish cannot be made relative (it's not a normal script that starts with #!/var/lib/openshift/51ac31d62587c8f73500030a/python/virtenv/bin/python)
remote: Making script /var/lib/openshift/51ac31d62587c8f73500030a/python//virtenv/bin/easy_install relative
remote: Script /var/lib/openshift/51ac31d62587c8f73500030a/python//virtenv/bin/activate.csh cannot be made relative (it's not a normal script that starts with #!/var/lib/openshift/51ac31d62587c8f73500030a/python/virtenv/bin/python)
remote: New python executable in /var/lib/openshift/51ac31d62587c8f73500030a/python//virtenv/bin/python
remote: Installing setuptools................................................
remote:   Complete output from command /var/lib/openshift/5...n/virtenv/bin/python -c "#!python
remote: \"\"\"Bootstra...sys.argv[1:])
remote: 
remote: 
remote: 
remote: 
remote: 
remote: 
remote: " --always-copy -U setuptools:
remote:   Searching for setuptools
remote: Reading https://pypi.python.org/simple/setuptools/
remote: Traceback (most recent call last):
remote:   File "<string>", line 278, in <module>
remote:   File "<string>", line 239, in main
remote:   File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 1712, in main
remote:   File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
remote:   File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 1716, in <lambda>
remote:   File "/var/lib/openshift/51ac31d62587c8f73500030a/python/opt/lib/python2.7/distutils/core.py", line 152, in setup
remote:     dist.run_commands()
remote:   File "/var/lib/openshift/51ac31d62587c8f73500030a/python/opt/lib/python2.7/distutils/dist.py", line 953, in run_commands
remote:     self.run_command(cmd)
remote:   File "/var/lib/openshift/51ac31d62587c8f73500030a/python/opt/lib/python2.7/distutils/dist.py", line 972, in run_command
remote:     cmd_obj.run()
remote:   File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 211, in run
remote:   File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 434, in easy_install
remote:   File "build/bdist.linux-x86_64/egg/setuptools/package_index.py", line 454, in fetch_distribution
remote:   File "build/bdist.linux-x86_64/egg/setuptools/package_index.py", line 303, in find_packages
remote:   File "build/bdist.linux-x86_64/egg/setuptools/package_index.py", line 617, in scan_url
remote:   File "build/bdist.linux-x86_64/egg/setuptools/package_index.py", line 190, in process_url
remote:   File "build/bdist.linux-x86_64/egg/setuptools/package_index.py", line 578, in open_url
remote:   File "build/bdist.linux-x86_64/egg/setuptools/package_index.py", line 758, in open_with_auth
remote:   File "/var/lib/openshift/51ac31d62587c8f73500030a/python/opt/lib/python2.7/urllib2.py", line 400, in open
remote:     response = self._open(req, data)
remote:   File "/var/lib/openshift/51ac31d62587c8f73500030a/python/opt/lib/python2.7/urllib2.py", line 418, in _open
remote:     '_open', req)
remote:   File "/var/lib/openshift/51ac31d62587c8f73500030a/python/opt/lib/python2.7/urllib2.py", line 378, in _call_chain
remote:     result = func(*args)
remote:   File "build/bdist.linux-x86_64/egg/setuptools/ssl_support.py", line 174, in https_open
remote:   File "/var/lib/openshift/51ac31d62587c8f73500030a/python/opt/lib/python2.7/urllib2.py", line 1174, in do_open
remote:     h.request(req.get_method(), req.get_selector(), req.data, headers)
remote:   File "/var/lib/openshift/51ac31d62587c8f73500030a/python/opt/lib/python2.7/httplib.py", line 958, in request
remote:     self._send_request(method, url, body, headers)
remote:   File "/var/lib/openshift/51ac31d62587c8f73500030a/python/opt/lib/python2.7/httplib.py", line 992, in _send_request
remote:     self.endheaders(body)
remote:   File "/var/lib/openshift/51ac31d62587c8f73500030a/python/opt/lib/python2.7/httplib.py", line 954, in endheaders
remote:     self._send_output(message_body)
remote:   File "/var/lib/openshift/51ac31d62587c8f73500030a/python/opt/lib/python2.7/httplib.py", line 814, in _send_output
remote:     self.send(msg)
remote:   File "/var/lib/openshift/51ac31d62587c8f73500030a/python/opt/lib/python2.7/httplib.py", line 776, in send
remote:     self.connect()
remote:   File "build/bdist.linux-x86_64/egg/setuptools/ssl_support.py", line 192, in connect
remote:   File "build/bdist.linux-x86_64/egg/setuptools/ssl_support.py", line 116, in match_hostname
remote:   File "build/bdist.linux-x86_64/egg/setuptools/ssl_support.py", line 98, in _dnsname_to_pat
remote: NameError: global name 're' is not defined
remote: ----------------------------------------
remote: ...Installing setuptools...done.
remote: Traceback (most recent call last):
remote:   File "/usr/lib/python2.6/site-packages/virtualenv.py", line 2577, in <module>
remote:     main()
remote:   File "/usr/lib/python2.6/site-packages/virtualenv.py", line 979, in main
remote:     no_pip=options.no_pip)
remote:   File "/usr/lib/python2.6/site-packages/virtualenv.py", line 1091, in create_environment
remote:     search_dirs=search_dirs, never_download=never_download)
remote:   File "/usr/lib/python2.6/site-packages/virtualenv.py", line 611, in install_setuptools
remote:     search_dirs=search_dirs, never_download=never_download)
remote:   File "/usr/lib/python2.6/site-packages/virtualenv.py", line 583, in _install_req
remote:     cwd=cwd)
remote:   File "/usr/lib/python2.6/site-packages/virtualenv.py", line 1057, in call_subprocess
remote:     % (cmd_desc, proc.returncode))
remote: OSError: Command /var/lib/openshift/5...n/virtenv/bin/python -c "#!python
remote: \"\"\"Bootstra...sys.argv[1:])
remote: 
remote: 
remote: 
remote: 
remote: 
remote: 
remote: " --always-copy -U setuptools failed with error code 1
remote: Running virtualenv with interpreter /var/lib/openshift/51ac31d62587c8f73500030a/python//opt/bin/python
Comment 1 Meng Bo 2013-06-03 05:19:30 EDT
Meet the same issue when git push changes to a scale python2.7 app with multiple web gears.
Comment 2 Mrunal Patel 2013-06-03 14:33:41 EDT
I wasn't able to reproduce the issue on devenv/stage. pymongo installed successfully and I was able to import it on each gear of a scalable app.
Comment 3 Meng Bo 2013-06-04 03:14:51 EDT
Cannot reproduce the issue on latest STG and devenv_3313 too.

It works for scaled-up app well, but still has some errors when installing pymongo dependency, as following:


remote: Finished processing dependencies for YourAppName==1.0
remote: Error in atexit._run_exitfuncs:
remote: Traceback (most recent call last):
remote:   File "/var/lib/openshift/586597646506928759635968/python/opt/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
remote:     func(*targs, **kargs)
remote:   File "/var/lib/openshift/586597646506928759635968/python/opt/lib/python2.7/multiprocessing/util.py", line 284, in _exit_function
remote:     info('process shutting down')
remote: TypeError: 'NoneType' object is not callable
remote: Error in sys.exitfunc:
remote: Traceback (most recent call last):
remote:   File "/var/lib/openshift/586597646506928759635968/python/opt/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
remote:     func(*targs, **kargs)
remote:   File "/var/lib/openshift/586597646506928759635968/python/opt/lib/python2.7/multiprocessing/util.py", line 284, in _exit_function
remote:     info('process shutting down')
remote: TypeError: 'NoneType' object is not callable
remote:  - Done processing setup.py
Comment 4 Mrunal Patel 2013-06-06 17:41:00 EDT
*** Bug 971527 has been marked as a duplicate of this bug. ***
Comment 5 Mrunal Patel 2013-06-13 11:25:11 EDT
The error we see from the gevent/greenlet install is harmless.
Comment 6 Mrunal Patel 2013-06-17 11:38:44 EDT
Could we move this bug to verified if it can't be reproduced? If we see it in prod, the workaround is to use force_clean_build.
Comment 8 Meng Bo 2013-06-18 02:38:02 EDT
Checked on devenv_3375,

Enable all the default dependencies for python2.7 in the setup.py and git push.

No error appears. Include the gevent/greenlet.

For scalable app, add force_clean_build marker will fix the issue.


Move bug to verified.

Note You need to log in before you can comment on or make changes to this bug.