php-src icon indicating copy to clipboard operation
php-src copied to clipboard

Cannot download php source with ruby rest client

Open xtreme-shane-lattanzio opened this issue 4 years ago • 2 comments

Description

I apologize if this is off base asking here but I am running out of ideas. We have a pipeline that runs ruby code that downloads php sources. It uses a ruby gem called rest-client. Recently we are getting:

RestClient.get "https://www.php.net/distributions/php-7.4.27.tar.gz", "Accept"=>"*/*", "User-Agent"=>"rest-client/2.1.0 (linux x86_64) ruby/3.1.1p18"
streaming GET https://www.php.net/distributions/php-7.4.27.tar.gz (16056 of unknown) [0 Content-Length]
streaming GET https://www.php.net/distributions/php-7.4.27.tar.gz (30522 of unknown) [0 Content-Length]
# => 503 ServiceUnavailable | text/html 30522 bytes, 0.51s

I tried to just run this RestClient::Request.execute(method: :get, url: 'https://www.php.net/distributions/php-7.4.27.tar.gz', raw_response: true, log: Logger.new(STDOUT)) in a ruby shell after requiring the client (require rest-client) and I get the same issue. I can no longer download the files and get a 503 every time and it has been this way for about a month.

Repro Steps:

  1. gem install rest-client
  2. irb
  3. require 'rest-client'
  4. RestClient::Request.execute(method: :get, url: 'https://www.php.net/distributions/php-7.4.27.tar.gz', raw_response: true, log: Logger.new(STDOUT))

I have tried to curl this URL directly and it works. The rest client has not changed for a long time so I am wondering if something has happened to php.net to cause this. I have tried rest client with other URLs to download zip files and they all work. There may be configurations in the rest client gem that I need to tweak but I cannot see any. Since this has worked well in the past, I am looking for any insight from your end as to why this could be happening. Appreciate the help!!

PHP Version

Any

Operating System

Attempted with MacOS 12.1 and Ubuntu 18.04

xtreme-shane-lattanzio avatar Mar 25 '22 18:03 xtreme-shane-lattanzio

I assume this has the same underlying root cause as https://github.com/php/web-php/issues/506; see also https://github.com/php/web-php/issues/505#issuecomment-1076056925 for some more details.

cmb69 avatar Mar 26 '22 11:03 cmb69

I'm closing this ticket, since it is certainly not a php-src issue, and likely a duplicate of php/web-php#506.

cmb69 avatar Mar 28 '22 13:03 cmb69