Bug 1021567

Summary: Unable to access Pear Channel
Product: OpenShift Online Reporter: Chris Ryan <cryan>
Component: ContainersAssignee: Michal Fojtik <mfojtik>
Status: CLOSED NOTABUG QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: jhonce, mfojtik, vvitek, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-23 15:48:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Chris Ryan 2013-10-21 14:23:57 UTC
Description of problem:
I am experiencing a problem very similar to bug 827575. I am unable to access the specified external pear channel, either manually in RHCShell or as a dependency. 

Version-Release number of selected component (if applicable):
devenv-stage_518 (ami-c3326faa)

How reproducible:
Always

Steps to Reproduce:
1. Create a new php-5.3 application, add a pear channel to deplist.txt
echo "channel://shupp.github.com/pirum/EZRP-0.2.1" > deplist.txt
2. Git push the app
3. Run pear channel-discover shupp.github.com/pirum inside the app. 

Actual results:
Could not open input file: ~/php/phplib/pear/pear/php/pearcmd.php (when running pear channel-discover inside the gear)

and

no write access to /var/lib/openshift/5265175853ced3e9610004c3//.pearrc!

Expected results:
The dependency should be met.

Additional info:

Comment 1 Xiaoli Tian 2013-10-21 14:25:42 UTC
[phpapp-domstg1.stg.rhcloud.com 5265358a2587c89812000128]\> pear channel-discover pear.drush.org/drush
Discovering channel pear.drush.org/drush over http:// failed with message: channel-add: Cannot open "http://pear.drush.org/drush/channel.xml" (File http://pear.drush.org:80/drush/channel.xml not valid (received: HTTP/1.1 404 Not Found
))
Trying to discover channel pear.drush.org/drush over https:// instead
Discovery of channel "pear.drush.org/drush" failed (channel-add: Cannot open "https://pear.drush.org/drush/channel.xml" (File https://pear.drush.org:443/drush/channel.xml not valid (received: HTTP/1.1 404 Not found
)))

Comment 2 Michal Fojtik 2013-10-21 14:33:40 UTC
The ~/.pearrc file is created during 'install' and locked in PHP cartridge and cannot be overwritten.

 ---
locked_files:
- ~/.pearrc

Comment 3 Michal Fojtik 2013-10-22 16:38:31 UTC
I'll look into this tomorrow, seems like a multiple PHP bugs to me.

Comment 4 Michal Fojtik 2013-10-23 13:56:23 UTC
Cryan:

I was able to reproduce this on latest devenv, but I can open the ~/php/phplib/pear/pear/php/pearcmd.php file (cat ..)
However the 'php' command is denied to see that file for some strange reason. Might be a SELinux problem?

The ~/.pearrc file is generated in install script and I don't think we want to make it unlocked to users, Jhon agree?

Comment 5 Michal Fojtik 2013-10-23 14:02:29 UTC
xiaoli: Are you still able to reproduce the issue? Seems like a temporary failure of drush.org to me.

Comment 6 Michal Fojtik 2013-10-23 14:11:55 UTC
xiaoli, sorry for the noise, I check checked:

~ → curl -v -k https://pear.drush.org/drush/channel.xml
< HTTP/1.1 404 Not found

I discovered that the issue could be solved by upgrading 'pear':

https://drupal.org/node/1322564#comment-5170634

Comment 7 Michal Fojtik 2013-10-23 14:33:48 UTC
So update:

 ~ → curl -I -H "Host: pear.drush.org:80" http://pear.drush.org/channel.xml
HTTP/1.1 200 OK


It seems like they removed the '/drush/' segment from the URL... Also the HTTPS does not work for me at all. Xiali, could you please try:

$ pear channel-discover pear.drush.org

instead of:

$ pear channel-discover pear.drush.org/drush

?

Comment 8 Xiaoli Tian 2013-10-23 14:40:08 UTC
Yeah, it works,  thanks for your time.
[phpap1-domx1.dev.rhcloud.com 5267dcabfd80ab68810000e3]\> pear channel-discover pear.drush.org
Channel "pear.drush.org" is already initialized

After adding it to deplist.txt, it could be installed successfully.

remote: Checking pear: pear.drush.org/drush
remote: 
remote: Attempting to discover channel "pear.drush.org"...
remote: downloading channel.xml ...
remote: Starting to download channel.xml (804 bytes)
remote: ....done: 804 bytes
remote: Auto-discovered channel "pear.drush.org", alias "drush", adding to registry
remote: downloading drush-6.1.0.0.tgz ...
remote: Starting to download drush-6.1.0.0.tgz (504,788 bytes)
remote: ...done: 504,788 bytes
remote: install ok: channel://pear.drush.org/drush-6.1.0.0

Comment 9 Michal Fojtik 2013-10-23 15:48:48 UTC
So to summarize here:

* BUG1: ~/php/phplib/pear/pear/php/pearcmd.php

This is a PEAR bug where we use '~' instead of $HOME. Should be fixed in this bug:

https://bugzilla.redhat.com/show_bug.cgi?id=1000223

* BUG2: no write access to /var/lib/openshift/5265175853ced3e9610004c3//.pearrc!

NOTABUG since the ~/.pearrc file is locked in manifest and we don't allow users to overwrite it.

* BUG3: Discovering channel pear.drush.org/drush over http:// failed

NOTABUG: This was problem on drush.org side, since they removed the /drush/ segment from the URL

In summary, I would close this one as not a bug :-)