Bug 1237074 - Get error when installing packages with requirements.txt - python-2.x
Summary: Get error when installing packages with requirements.txt - python-2.x
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Image
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Jakub Hadvig
QA Contact: Wenjing Zheng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-30 10:23 UTC by Guolei Sun
Modified: 2015-09-08 20:14 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-09-08 20:14:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Guolei Sun 2015-06-30 10:23:08 UTC
Description of problem:
error message "no such option: --trusted-host" when installing packages with requirements.txt - python-2.x

Version-Release number of selected component (if applicable):
devenv_5565

How reproducible:
always

Steps to Reproduce:
1.create one python-2.x app
rhc app create py26 python-2.6
2.edit the requirements.txt with following
gunicorn
Django==1.6.2
psycopg2
3.git add .; git commit -amp; git push

Actual results:

remote: Checking for pip dependency listed in requirements.txt file..
remote: 
remote: Usage:   
remote:   pip install [options] <requirement specifier> ...
remote:   pip install [options] -r <requirements file> ...
remote:   pip install [options] [-e] <vcs project url> ...
remote:   pip install [options] [-e] <local project path> ...
remote:   pip install [options] <archive url/path> ...
remote: 
remote: no such option: --trusted-host
remote: Running setup.py script..

Expected results:
no error displayed. packages installed success.

Additional info:

Comment 1 Ben Parees 2015-06-30 20:43:07 UTC
trusted host appears to only be valid for the python 3.3 cart which uses a different pip than the other 2.

Comment 2 Ben Parees 2015-06-30 20:45:43 UTC
This was introduced by the fix for https://bugzilla.redhat.com/show_bug.cgi?id=1225291

we should probably add version guards around the adding of the TRUSTED_HOST arg.

i'll see if i can get to it tomorrow.

Comment 3 Ben Parees 2015-06-30 21:56:42 UTC
looks like Jakub had already fixed this here:
https://github.com/openshift/origin-server/pull/6184

i tested it with 2.6 in a devenv and it's working now.

Comment 4 Guolei Sun 2015-07-01 03:30:51 UTC
Verified on the devenv_5569.
Log:
http://pastebin.test.redhat.com/293910

But there are some warning and syntax error in the log when installing python2.x, Please help to confirm this.

      remote: Installing collected packages: gunicorn, Django
      remote:   Running setup.py install for gunicorn
      remote:     warning: no previously-included files matching '__pycache__' found under directory '*'
      remote:     warning: no previously-included files matching '*.py[co]' found under directory '*'
      remote:     SyntaxError: ('invalid syntax', ('/var/lib/openshift/5593565b2ca48cece3000060/python/virtenv/lib/python2.6/site-packages/gunicorn/workers/_gaiohttp.py', 68, 26, '                yield from self.wsgi.close()\n'))
      remote:    
      remote:     Installing gunicorn_paster script to /var/lib/openshift/5593565b2ca48cece3000060/python/virtenv/bin
      remote:     Installing gunicorn script to /var/lib/openshift/5593565b2ca48cece3000060/python/virtenv/bin
      remote:     Installing gunicorn_django script to /var/lib/openshift/5593565b2ca48cece3000060/python/virtenv/bin


---------------------------------------


      remote:   Running setup.py install for gunicorn
      remote:    
      remote:     warning: no previously-included files matching '__pycache__' found under directory '*'
      remote:     warning: no previously-included files matching '*.py[co]' found under directory '*'
      remote:       File "/var/lib/openshift/559355292ca48cece3000008/python/virtenv/lib/python2.7/site-packages/gunicorn/workers/_gaiohttp.py", line 68
      remote:         yield from self.wsgi.close()
      remote:                  ^
      remote:     SyntaxError: invalid syntax
      remote:    
      remote:     Installing gunicorn_paster script to /var/lib/openshift/559355292ca48cece3000008/python/virtenv/bin
      remote:     Installing gunicorn script to /var/lib/openshift/559355292ca48cece3000008/python/virtenv/bin
      remote:     Installing gunicorn_django script to /var/lib/openshift/559355292ca48cece3000008/python/virtenv/bin(In reply to Ben Parees from comment #3)


> looks like Jakub had already fixed this here:
> https://github.com/openshift/origin-server/pull/6184
> 
> i tested it with 2.6 in a devenv and it's working now.

Comment 5 Ben Parees 2015-07-01 12:13:01 UTC
Can you mark this verified?

Comment 6 Xiaoli Tian 2015-07-02 01:27:16 UTC
(In reply to Ben Parees from comment #5)
> Can you mark this verified?

Hi, Ben

Guolei mentioned in comment 4 that there's still some syntax error , can you help confirm if that need fix?

Thanks

Comment 7 Ben Parees 2015-07-02 01:33:27 UTC
I suspect it's not something we can fix, but i'll let our resident python expert Maciej weigh in.

Comment 8 Guolei Sun 2015-07-02 03:16:53 UTC
(In reply to Ben Parees from comment #7)
> I suspect it's not something we can fix, but i'll let our resident python
> expert Maciej weigh in.

Please help to confirm this and I will mark as verified then. Thank you!

Comment 9 Maciej Szulik 2015-07-03 21:49:44 UTC
Confirming, the error comes from the compilation process of all the *.py files. Since that file is targeted at python >= 3.3 it'll pop-up here. At current time you can safely ignore, and the only thing possible to do is updating pip installation, which in newer versions is ignoring that message [1]. This on the other hand is a limitation of packages we have and I think we cannot pass through atm. I'm ok with closing as is.

[1] https://github.com/benoitc/gunicorn/issues/788#issuecomment-92877751

Comment 10 Guolei Sun 2015-07-06 00:09:54 UTC
Thank you for the confirmation.


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