Discovery of channel "pear.drush.org" failed (channel-add: Cannot open "http://pear.drush.org/channel.xml" (File http://pear.drush.org:80/channel.xml not valid (received: HTTP/1.1 404 Not Found
)))

Error on 2 macs, remote ubuntu.

Related: #1215346: Distributing drush via PEAR (was drush debian packaging usage instructions

Comments

dwightaspinwall’s picture

I'm having same problem from ubuntu:

sysadmin@dev1:~$ pear channel-discover pear.drush.org
Discovering channel pear.drush.org over http:// failed with message: channel-add: Cannot open "http://pear.drush.org/channel.xml" (File http://pear.drush.org:80/channel.xml not valid (received: HTTP/1.1 404 Not Found
))
Trying to discover channel pear.drush.org over https:// instead
Discovery of channel "pear.drush.org" failed (channel-add: Cannot open "https://pear.drush.org/channel.xml" (Connection to `pear.drush.org:443' failed: Connection refused))

Which is odd, considering that I can curl that URI:

sysadmin@dev1:~$ curl http://pear.drush.org:80/channel.xml
<?xml version="1.0" encoding="UTF-8" ?>
<channel version="1.0" xmlns="http://pear.php.net/channel-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/channel-1.0 http://pear.php.net/dtd/channel-1.0.xsd">
    <name>pear.drush.org</name>
    <summary>Drush's PEAR Channel Server</summary>
    <suggestedalias>drush</suggestedalias>
    <servers>
        <primary>
            <rest>
                <baseurl type="REST1.0">http://pear.drush.org/rest/</baseurl>
                <baseurl type="REST1.1">http://pear.drush.org/rest/</baseurl>
                <baseurl type="REST1.2">http://pear.drush.org/rest/</baseurl>
                <baseurl type="REST1.3">http://pear.drush.org/rest/</baseurl>
            </rest>
        </primary>
    </servers>
</channel>sysadmin@dev1:~$ 
ccoppen’s picture

Getting the same error on Ubuntu 10.04 Server, but succeeded on Ubuntu 11.10 Desktop.

Looking to see if there's a blocking issue, but wget works fine to grab the drush file from the project page.

I can navigate to the channel.xml in the browser just fine.

ccoppen’s picture

Update:

I tested pear channel-discover with the following site: http://pear.symfony-project.com/ and it worked properly adding the channel. This was with the 10.04 server.

The issue must be with the pear.drush.org.

It worked from 11.10 desktop, but not with the 10.04 server.

ccoppen’s picture

Ahh....problem solved.

From another project that someone was having the same issue with, just do the following:

pear upgrade

Once that's done, do the pear channel-discover again.

It worked.

msonnabaum’s picture

Status: Active » Fixed

Yup, just need to upgrade your version of pear.

The actual pear channel is hosted on github, so its pretty unlikely it'll be down.

greg.1.anderson’s picture

I added a note about pear upgrade on the main project page.

mariomaric’s picture

Status: Fixed » Active

Greg, can you please maybe prefix all commands (on the main project page) with "sudo"?!

Most people probably use standard Ubuntu setup, in which pear commands will not work without sudo...

torpy’s picture

Shouldn't the command be [sudo] 'pear upgrade pear'?

'pear upgrade' didn't work for me on Ubuntu 8.04..

msonnabaum’s picture

Status: Active » Fixed

Not going to add sudo.

Those who install php via homebrew (me) don't have to use sudo. If I did it would screw up my perms.

moshe weitzman’s picture

We could add a comment suggesting that folks use sudo if they get perm failures.

msonnabaum’s picture

Not apposed to that.

mariomaric’s picture

Component: Miscellaneous » Documentation
Status: Fixed » Active

+1 for #10.

seanr’s picture

This is actually not working. Even after the upgrade it still doesn't work.


root@ip-10-114-67-132:/var/www/.../sites/default# pear upgrade pear
WARNING: channel "pear.php.net" has updated its protocols, use "pear channel-update pear.php.net" to update
downloading PEAR-1.9.4.tgz ...
Starting to download PEAR-1.9.4.tgz (296,332 bytes)
.............................................................done: 296,332 bytes
root@ip-10-114-67-132:/var/www/.../sites/default# pear channel-discover pear.drush.org
Discovering channel pear.drush.org over http:// failed with message: channel-add: Cannot open "http://pear.drush.org/channel.xml" (File http://pear.drush.org:80/channel.xml not valid (received: HTTP/1.1 404 Not Found
))
Trying to discover channel pear.drush.org over https:// instead
Discovery of channel "pear.drush.org" failed (channel-add: Cannot open "https://pear.drush.org/channel.xml" (Connection to `pear.drush.org:443' failed: Connection refused))
root@ip-10-114-67-132:/var/www/.../sites/default# 

Even after following the instructions in that warning about protocols being updated, it still doesn't work. AFAICT, this is just 100% broken.

ccoppen’s picture

Have you tried
sudo pear upgrade pear

as suggested in previous comments?

msonnabaum’s picture

Hmm, given that I've never actually been able to make this *not* work, I wouldn't exactly describe it as 100% broken.

That said, 1.9.4 should be the version you need. The discovery seems to work fine for me on 1.9.4. Any more info you can provide?

seanr’s picture

You'll notice from my pasted code that I was already root. The first command was pear upgrade pear run as root and it didn't have any effect.

FWIW, I finally just gave up and did it the old fashioned way.

Steven Merrill’s picture

I'm afraid I'm having the same problem under CentOS 5.6.

In adding some print_r() statements to my PEAR source files (even after doing a sudo pear upgrade pear), I see that it's sending a Host: header of "pear.drush.org:80", which is throwing GitHub Pages off and causing it to throw a 404.

The entire request is as follows:

GET /channel.xml HTTP/1.1
Host: pear.drush.org:80
User-Agent: PEAR/1.4.9/PHP/5.2.17
Connection: close
Steven Merrill’s picture

Sure enough, upgrading to PEAR 1.9.1 (by installing php52-pear from IUS in this specific case) fixed this issue for me, but there may be quite a few folks out there with ancient PEAR versions that still send a Host header with :80 appended.

(Yes, technically it's legal to include a port in the Host: header per the HTTP/1.0 spec, but this was also breaking Google Code last year: http://blog.pear.php.net/2010/03/23/google-code-channels-broken/.)

Since there may still be people out there (any CentOS 5.x users, to start with) who have ancient PEAR versions for whom a sudo pear upgrade pear won't really change anything, what's the best option?

We could contact GitHub and see if they'll address it, or else we could run a proxy in front of pear.drush.org and strip out a trailing ":80" from the Host header. ;)

moskito’s picture

Workaorund for CentOS 5 users to upgrade PEAR (https://bugzilla.redhat.com/show_bug.cgi?id=673521#c4):

pear upgrade –force Console_Getopt
pear upgrade –force pear
pear upgrade-all
msonnabaum’s picture

Steve - Can you comment on the feasibility of the workaround above?

If that doesn't work I'll think a bit more about how we take care of I on our end.

Steven Merrill’s picture

That worked, and I'll try from a fresh VM - the upgrade-all at the end might not be necessary. Thanks!

I can write up a summary of CentOS options for the documentation.

mgifford’s picture

On Debian I also needed to run sudo pear upgrade-all

I think this should be changed on the initial project page. I tried sudo pear upgrade first, but that didn't work.

xcafebabe’s picture

Worked for me @moskito solution. Thanks!

Steven Merrill’s picture

Sadly, even CentOS 6 includes PEAR 1.9.0, which is one minor version away from having the Host: header fix.

I put in a support request to GitHub just to see if they'll entertain it.

Otherwise, forcing an upgrade of PEAR itself does work both on CentOS 5.6 and 6.

highermath’s picture

I think that changing the hint to "pear upgrade pear" might be a more universal approach.

It would be great if all of the workarounds here were in the documentation.

greg.1.anderson’s picture

Perhaps someone could make an effort to collect all of the workarounds and submit a suggested change for the main project page that encompasses all of the remediation steps as succinctly as possible. One command (or a short sequence of commands) that works for everyone and avoids akward "if this then that" instructions would be best. I'm still uncertain about the suggestion to include "sudo", but since we have Windows-specific instructions, maybe we put the "sudo" in now?

mehuls’s picture

use followin command

pear channel-discover pear.drush.org

If it doesn't work directly do following commands first

pear upgrade –force Console_Getopt
pear upgrade –force pear
pear upgrade-all

greg.1.anderson’s picture

Status: Active » Needs review

I modified the main project page with something similar to #27.

Steven Merrill’s picture

GitHub is at least aware of the issue. Here's what they sent me. No promises, but this might fix itself at some point.

From: Jesse Newland (GitHub Staff) 
Subject: [Contact] Accept :80 in the Host header

Hi Steven -

+1 for referencing the RFC! We'll look into it, but I'm afraid I can't say that it'll be done in the near term.
moskito’s picture

The text as is now

If the channel-discover fails, try running the following sequence of commands:

sounds for me like one should run only #19, instead of run

pear upgrade –force Console_Getopt
pear upgrade –force pear
pear upgrade-all
pear channel-discover pear.drush.org
pear install drush/drush

to install it correctly if channel-discover fails.

My text suggestion:

If the channel-discover fails, probably you need a updated PEAR version. One way to update PEAR is running the following sequence of commands:

Also would be nice to define a minimum PEAR version needed somewhere. Since, a more technical person could install the PEAR version he wants.

moshe weitzman’s picture

Status: Needs review » Fixed

i think project page now says all that is discussed here.

arnoldbird’s picture

In Ubuntu 10.04 server, I had to do this...

pear upgrade –force Console_Getopt
pear upgrade –force pear
pear upgrade-all
pear channel-discover pear.drush.org
pear channel-discover pear.drush.org
pear install drush/drush

Yes, that's right, I had to do the channel-discover twice. I am certain I ran the same command twice because I up arrowed in my terminal to run it again.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

leroysteinbacher’s picture

After running

sudo pear install drush/drush

I'm getting this:

Failed to download drush/drush, latest release is version 4.0.0, but it requires PHP version "5.0.0", use "channel://pear.drush.org/drush-4.0.0" to install

I tried:

sudo pear install drush/drush-4.0.0

and got:

drush/drush requires PHP (version >= 5.0.0), installed version is 4.4.9

php --version is giving me PHP 5.2.4

I still have PHP 4.4.9 used by Max OS X Apache (usr/lib/php)

But I've pointed my .bash_profile to my php5 directory.

PATH=/usr/local/php5/bin/:$PATH
export PATH

How do I point PEAR to the latest PHP version?

The long version of this story is here:

http://www.technecal.com/node/17

Thanks!

Leroy Steinbacher

ccoppen’s picture

Drush attempts to use the CGI version of PHP which is what is happening here. You need to change the Drush config to point to the correct version of PHP. I remember it in the documentation, but not sure where.

mattreba’s picture

I received the following warning:

[root@webserver ~]# pear upgrade --force Console_Getopt
WARNING: channel "pear.php.net" has updated its protocols, use "pear channel-update pear.php.net" to update

Even though it said it upgraded I still could not get channel-discover to work. After running the channel-update as suggested by the warning and then rerunning the pear upgrade commands previously suggested I was able to do the channel-discover and install drush.

ahimsauzi’s picture

If you are using MAMP 2.0 and PEAR is not recognized, have a look at this article:
http://bigdiver.wordpress.com/2011/11/10/mamp-2-0-pear-and-phpunit-insta...

In my case, pear.conf was reporting as corrupted and had to be removed before I can upgrade pear.

Once I upgraded pear, drush install was a breeze!

~Uzi

ovi_mihai’s picture

Steps I followed to install drush

pear upgrade pear

pear channel-discover pear.drush.org

pear install drush/drush

upgrading pear solved the problem.
on ubuntu should add the sudo in front

Ken Hawkins’s picture

Running on CentOS 5.8, I had much the same issue, but no fix mentioned here has worked.

Pear version installed was 1.4.9 leaving me unable to upgrade pear, as a newer version of pear was needed. X.x

This worked:

 pear upgrade --force http://pear.php.net/get/PEAR-1.9.0 
pear upgrade --force http://pear.php.net/get/PEAR-1.9.1
pear upgrade

Then all worked as expected.

Harry Slaughter’s picture

#3 fixed it for me. Ubuntu vOLD

fureigh’s picture

Version: » 7.x-5.8

+1 for #27. Those steps were necessary on my Mac even after running sudo pear channel-update pear.php.net.

(Disregard the version number; it's just a required field for adding this comment.)

Kristen Pol’s picture

#39 worked for me! Thanks Ken :)

ZenDoodles’s picture

Status: Closed (fixed) » Active

This is either broken again or still a problem...
Note:

  • pear list shows version 1.9.4 Stable, so upgrading per comment #39 isn't the solution.
  • ping gets a response, so github is there. (no surprises)
  • I can wget channel.xml, so it's not there either. (channel.xml is the expected channel definition too)
alpha [15:03] ~  $ pear list
Installed packages, channel pear.php.net:
=========================================
Package          Version State
Archive_Tar      1.3.11  stable
PEAR             1.9.4   stable
Structures_Graph 1.0.4   stable
XML_Util         1.2.1   stable
alpha [15:04] ~  $ pear channel-discover pear.drush.org
Discovery of channel "pear.drush.org" failed (channel-add: Cannot open "http://pear.drush.org/channel.xml" (File http://pear.drush.org:80/channel.xml not valid (received: HTTP/1.1 404 Not Found
)))
alpha [15:04] ~  $ wget http://pear.drush.org/channel.xml
--2013-02-20 15:05:02--  http://pear.drush.org/channel.xml
Resolving pear.drush.org... 204.232.175.78
Connecting to pear.drush.org|204.232.175.78|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 804 [text/xml]
Saving to: `channel.xml.1'

100%[============================================================================================================================================>] 804         --.-K/s   in 0s      

2013-02-20 15:05:02 (46.8 MB/s) - `channel.xml.1' saved [804/804]

alpha [15:05] ~  $ ping pear.drush.org
PING drush-ops.github.com (204.232.175.78) 56(84) bytes of data.
64 bytes from pages.github.com (204.232.175.78): icmp_seq=1 ttl=56 time=28.2 ms
64 bytes from pages.github.com (204.232.175.78): icmp_seq=2 ttl=56 time=30.4 ms
64 bytes from pages.github.com (204.232.175.78): icmp_seq=3 ttl=56 time=27.9 ms

--- drush-ops.github.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 27.916/28.886/30.456/1.120 ms

Dunno what else to try. Meanwhile, I guess I'll do it the old fashioned way...

greg.1.anderson’s picture

I have Pear 1.9.4 stable as well, and the channel discovery seems to be working okay for me at the moment.

$ sudo pear channel-discover pear.drush.org
Adding Channel "pear.drush.org" succeeded
Discovery of channel "pear.drush.org" succeeded
romaingar’s picture

hello can't access the pear'channel,
this is my system configuration :

uname -a
Linux icpu1765 2.6.28.8-20120713a-iscsi-ntacker-3ware-sec8-fmon-igb-dif2-grsec #1 SMP Fri Jul 13 13:37:07 CEST 2012 i686 GNU/Linux

I've follow #34 with no success, and udate pear to 1.9.4. with no succes

 pear channel-discover pear.drush.org    Discovery of channel "pear.drush.org" failed (channel-add: Cannot open "http://pear.drush.org/channel.xml")

It's seems that the problem is with my hosting (1and1), because i'm not root on my ssh session. that's all...

greg.1.anderson’s picture

Category: bug » support
Status: Active » Fixed

If you cannot access the pear channel due to restricted permissions on a shared hosting service, install manually by another technique. See README.txt for more information.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Steven Merrill’s picture

As an aside after the fact, It looks as though GitHub Pages finally supports requests with port numbers in the Host header:

 ┌┤smerrill@lilliputian-resolution [Jul 11 10:27:14] ~
 └╼ curl -I -H "Host: pear.drush.org:80" http://pear.drush.org/channel.xml
HTTP/1.1 200 OK
Server: GitHub.com
Content-Type: text/xml
Last-Modified: Thu, 25 Apr 2013 05:05:04 GMT
Expires: Fri, 05 Jul 2013 04:42:03 GMT
Cache-Control: max-age=600
Content-Length: 804
Accept-Ranges: bytes
Date: Thu, 11 Jul 2013 14:27:18 GMT
Via: 1.1 varnish
Age: 554116
Connection: keep-alive
X-Served-By: cache-v37-ASH
X-Cache: HIT
X-Cache-Hits: 4
X-Timer: S1373552838.438456774,VS0,VE3
Vary: Accept-Encoding
marcnz’s picture

Issue summary: View changes

I think it is time to re-open this issue!
[root@s1 ~]# pear version
PEAR Version: 1.10.1
PHP Version: 5.5.9-1ubuntu4.14
Zend Engine Version: 2.5.0
Running on: Linux s1 2.6.32-042stab111.11 #1 SMP Tue Sep 1 18:19:12 MSK 2015 x86_64

[root@s1 ~]# pear channel-discover pear.drush.org
Discovering channel pear.drush.org over http:// failed with message: channel-add: Cannot open "http://pear.drush.org/channel.xml" (Connection to `pear.drush.org:80' failed: php_network_getaddresses: getaddrinfo failed: Name or service not known)
Trying to discover channel pear.drush.org over https:// instead
Discovery of channel "pear.drush.org" failed (channel-add: Cannot open "https://pear.drush.org/channel.xml" (Connection to `pear.drush.org:443' failed: php_network_getaddresses: getaddrinfo failed: Name or service not known))

I tried all the pear upgrade --force listed in the thread without any luck!

Any solution found?

robproper’s picture

I just ran into the same problem. A little over a week ago this problem did not exist.

However, now the problem is different though. The original problem was a HTTP 404 response code (File http://pear.drush.org:80/channel.xml not valid (received: HTTP/1.1 404 Not Found)). Now the server cannot be found at all (Connection to `pear.drush.org:80' failed: php_network_getaddresses: getaddrinfo failed: Name or service not known). In fact pear.drush.org does not resolve to an IP address. This may be more permanent.

sunildias’s picture

I am assuming that Drush stopped installing through PEAR and the Drush Needs to be installed through composer.

Because Drush is moved to GITHUB and made it as their official project page. https://github.com/drush-ops/drush

And the installation steps are available here http://docs.drush.org/en/master/install/

If you found any other solution. Please post here.

hassan2’s picture

Follow this video instruction to install all you need.

https://www.youtube.com/watch?v=Esvthnt79ac