Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install #35

Closed
mickaelperrin opened this issue Aug 9, 2016 · 13 comments
Closed

Unable to install #35

mickaelperrin opened this issue Aug 9, 2016 · 13 comments

Comments

@mickaelperrin
Copy link

mickaelperrin commented Aug 9, 2016

Hi,

Last days, I encountered big troubles to install phantomjs. It looks like the CDN of bitbucket blocked the download and request for an Oauth token, like #34. I tried several options to install it, but all failed.

At first, I switched to the master branch of the composer package: "jakoch/phantomjs-installer": "dev-master" to be able to change the CDN.

Setting a bitbucket Oauth token

I created an Oauth token in my account and used composer config -g bitbucket-oauth.bitbucket.org KEY SECRET to set the Oauth token. Then run, composer -vvv install (actually PHANTOMJS_CDNURL=https://bitbucket.org/ariya/phantomjs/downloads/ composer -vvv install) and got:

Installing phantomjs (2.1.1)
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
Downloading: 100%
Failed to decode response: Failed to decode zlib stream
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
Downloading: 100%
Download failed, retrying...
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
Downloading: 100%
Download failed, retrying...
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
Downloading: 100%
Failed: [Composer\Downloader\TransportException] 0: Failed to decode zlib stream

It looks like, nothing is downloaded. I tried with curl -L -v https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 and found that an XML permission message was returned. I tried it three times and finally got the file the third time. However, never get it working at all through composer.

Using the new default github medium

Running PHANTOMJS_CDNURL=https://github.com/Medium/phantomjs/ composer -vvv install, lead to the error:

It looks like the header reports 23415665 and the strlen composer function 23415536.

Using the 'official' https://cnpmjs.org/downloads

Download is extremely slow and leads to the same error as with Github medium (with the exact same filesizes reported ).

Some informations about my settings:

  • Composer version 1.2-dev (034f1cf591e9061500488a4c354050cf3ea4965f)
  • PHP 7.0.9 (cli) (built: Jul 29 2016 21:02:10) ( NTS )
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.9, Copyright (c) 1999-2016, by Zend Technologies
  • Mbstring is loaded but mbstring.func_overload is set to 0

Note: I finally got it working using bitbucket and removing the oauth, but yesterday it was failing due to the missing Oauth... Crazy...

Any hints ?

@mickaelperrin
Copy link
Author

Just looked at the headers when using bitbucket, looks like authentification doesn't work and we enter in a loop.

Click to expand and see headers

   post-install-cmd: PhantomInstaller\Installer::installPhantomJS
  - Installing phantomjs (2.1.1)
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
    Downloading: Connecting...array(359) {
  [0]=>
  string(18) "HTTP/1.1 302 FOUND"
  [1]=>
  string(19) "Server: nginx/1.6.2"
  [2]=>
  string(21) "Vary: Accept-Encoding"
  [3]=>
  string(24) "Cache-Control: max-age=0"
  [4]=>
  string(38) "Content-Type: text/html; charset=utf-8"
  [5]=>
  string(22) "Content-Encoding: gzip"
  [6]=>
  string(43) "Strict-Transport-Security: max-age=31536000"
  [7]=>
  string(35) "Date: Tue, 09 Aug 2016 12:59:10 GMT"
  [8]=>
  string(116) "Location: https://bitbucket.org/account/signin/?next=/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2"
  [9]=>
  string(20) "X-Served-By: app-104"
  [10]=>
  string(38) "Expires: Tue, 09 Aug 2016 12:59:10 GMT"
  [11]=>
  string(30) "X-Static-Version: 62d2162cb91f"
  [12]=>
  string(40) "ETag: "d41d8cd98f00b204e9800998ecf8427e""
  [13]=>
  string(31) "X-Content-Type-Options: nosniff"
  [14]=>
  string(30) "X-Render-Time: 0.0319881439209"
  [15]=>
  string(17) "Connection: close"
  [16]=>
  string(44) "Last-Modified: Tue, 09 Aug 2016 12:59:10 GMT"
  [17]=>
  string(23) "X-Version: 62d2162cb91f"
  [18]=>
  string(27) "X-Frame-Options: SAMEORIGIN"
  [19]=>
  string(20) "X-Request-Count: 290"
  [20]=>
  string(18) "HTTP/1.1 302 FOUND"
  [21]=>
  string(19) "Server: nginx/1.6.2"
  [22]=>
  string(21) "Vary: Accept-Encoding"
  [23]=>
  string(24) "Cache-Control: max-age=0"
  [24]=>
  string(38) "Content-Type: text/html; charset=utf-8"
  [25]=>
  string(22) "Content-Encoding: gzip"
  [26]=>
  string(43) "Strict-Transport-Security: max-age=31536000"
  [27]=>
  string(35) "Date: Tue, 09 Aug 2016 12:59:11 GMT"
  [28]=>
  string(142) "Location: https://bitbucket.org/account/signin/?next=/account/signin/%3Fnext%3D/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2"
  [29]=>
  string(20) "X-Served-By: app-124"
  [30]=>
  string(38) "Expires: Tue, 09 Aug 2016 12:59:11 GMT"
  [31]=>
  string(30) "X-Static-Version: 62d2162cb91f"
  [32]=>
  string(40) "ETag: "d41d8cd98f00b204e9800998ecf8427e""
  [33]=>
  string(31) "X-Content-Type-Options: nosniff"
  [34]=>
  string(29) "X-Render-Time: 0.020092010498"
  [35]=>
  string(17) "Connection: close"
  [36]=>
  string(44) "Last-Modified: Tue, 09 Aug 2016 12:59:11 GMT"
  [37]=>
  string(23) "X-Version: 62d2162cb91f"
  [38]=>
  string(27) "X-Frame-Options: SAMEORIGIN"
  [39]=>
  string(20) "X-Request-Count: 297"
  [40]=>
  string(18) "HTTP/1.1 302 FOUND"
  [41]=>
  string(19) "Server: nginx/1.6.2"
  [42]=>
  string(21) "Vary: Accept-Encoding"
  [43]=>
  string(24) "Cache-Control: max-age=0"
  [44]=>
  string(38) "Content-Type: text/html; charset=utf-8"
  [45]=>
  string(22) "Content-Encoding: gzip"
  [46]=>
  string(43) "Strict-Transport-Security: max-age=31536000"
  [47]=>
  string(35) "Date: Tue, 09 Aug 2016 12:59:11 GMT"
  [48]=>
  string(172) "Location: https://bitbucket.org/account/signin/?next=/account/signin/%3Fnext%3D/account/signin/%253Fnext%253D/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2"
  [49]=>
  string(20) "X-Served-By: app-124"
  [50]=>
  string(38) "Expires: Tue, 09 Aug 2016 12:59:11 GMT"
  [51]=>
  string(30) "X-Static-Version: 62d2162cb91f"
  [52]=>
  string(40) "ETag: "d41d8cd98f00b204e9800998ecf8427e""
  [53]=>
  string(31) "X-Content-Type-Options: nosniff"
  [54]=>
  string(30) "X-Render-Time: 0.0163469314575"
  [55]=>
  string(17) "Connection: close"
  [56]=>
  string(44) "Last-Modified: Tue, 09 Aug 2016 12:59:11 GMT"
  [57]=>
  string(23) "X-Version: 62d2162cb91f"
  [58]=>
  string(27) "X-Frame-Options: SAMEORIGIN"
  [59]=>
  string(20) "X-Request-Count: 118"
  [60]=>
  string(18) "HTTP/1.1 302 FOUND"
  [61]=>
  string(19) "Server: nginx/1.6.2"
  [62]=>
  string(21) "Vary: Accept-Encoding"
  [63]=>
  string(24) "Cache-Control: max-age=0"
  [64]=>
  string(38) "Content-Type: text/html; charset=utf-8"
  [65]=>
  string(22) "Content-Encoding: gzip"
  [66]=>
  string(43) "Strict-Transport-Security: max-age=31536000"
  [67]=>
  string(35) "Date: Tue, 09 Aug 2016 12:59:12 GMT"
  [68]=>
  string(206) "Location: https://bitbucket.org/account/signin/?next=/account/signin/%3Fnext%3D/account/signin/%253Fnext%253D/account/signin/%25253Fnext%25253D/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2"
  [69]=>
  string(20) "X-Served-By: app-107"
  [70]=>
  string(38) "Expires: Tue, 09 Aug 2016 12:59:12 GMT"
  [71]=>
  string(30) "X-Static-Version: 62d2162cb91f"
  [72]=>
  string(40) "ETag: "d41d8cd98f00b204e9800998ecf8427e""
  [73]=>
  string(31) "X-Content-Type-Options: nosniff"
  [74]=>
  string(29) "X-Render-Time: 0.015515089035"
  [75]=>
  string(17) "Connection: close"
  [76]=>
  string(44) "Last-Modified: Tue, 09 Aug 2016 12:59:12 GMT"
  [77]=>
  string(23) "X-Version: 62d2162cb91f"
  [78]=>
  string(27) "X-Frame-Options: SAMEORIGIN"
  [79]=>
  string(20) "X-Request-Count: 140"
  [80]=>
  string(18) "HTTP/1.1 302 FOUND"
  [81]=>
  string(19) "Server: nginx/1.6.2"
  [82]=>
  string(21) "Vary: Accept-Encoding"
  [83]=>
  string(24) "Cache-Control: max-age=0"
  [84]=>
  string(38) "Content-Type: text/html; charset=utf-8"
  [85]=>
  string(22) "Content-Encoding: gzip"
  [86]=>
  string(43) "Strict-Transport-Security: max-age=31536000"
  [87]=>
  string(35) "Date: Tue, 09 Aug 2016 12:59:12 GMT"
  [88]=>
  string(244) "Location: https://bitbucket.org/account/signin/?next=/account/signin/%3Fnext%3D/account/signin/%253Fnext%253D/account/signin/%25253Fnext%25253D/account/signin/%2525253Fnext%2525253D/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2"
  [89]=>
  string(20) "X-Served-By: app-124"
  [90]=>
  string(38) "Expires: Tue, 09 Aug 2016 12:59:12 GMT"
  [91]=>
  string(30) "X-Static-Version: 62d2162cb91f"
  [92]=>
  string(40) "ETag: "d41d8cd98f00b204e9800998ecf8427e""
  [93]=>
  string(31) "X-Content-Type-Options: nosniff"
  [94]=>
  string(30) "X-Render-Time: 0.0225260257721"
  [95]=>
  string(17) "Connection: close"
  [96]=>
  string(44) "Last-Modified: Tue, 09 Aug 2016 12:59:12 GMT"
  [97]=>
  string(23) "X-Version: 62d2162cb91f"
  [98]=>
  string(27) "X-Frame-Options: SAMEORIGIN"
  [99]=>
  string(19) "X-Request-Count: 52"
  [100]=>
  string(18) "HTTP/1.1 302 FOUND"
  [101]=>
  string(19) "Server: nginx/1.6.2"
  [102]=>
  string(21) "Vary: Accept-Encoding"
  [103]=>
  string(24) "Cache-Control: max-age=0"
  [104]=>
  string(38) "Content-Type: text/html; charset=utf-8"
  [105]=>
  string(22) "Content-Encoding: gzip"
  [106]=>
  string(43) "Strict-Transport-Security: max-age=31536000"
  [107]=>
  string(35) "Date: Tue, 09 Aug 2016 12:59:13 GMT"
  [108]=>
  string(286) "Location: https://bitbucket.org/account/signin/?next=/account/signin/%3Fnext%3D/account/signin/%253Fnext%253D/account/signin/%25253Fnext%25253D/account/signin/%2525253Fnext%2525253D/account/signin/%252525253Fnext%252525253D/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2"
  [109]=>
  string(20) "X-Served-By: app-106"
  [110]=>
  string(38) "Expires: Tue, 09 Aug 2016 12:59:13 GMT"
  [111]=>
  string(30) "X-Static-Version: 62d2162cb91f"
  [112]=>
  string(40) "ETag: "d41d8cd98f00b204e9800998ecf8427e""
  [113]=>
  string(31) "X-Content-Type-Options: nosniff"
  [114]=>
  string(30) "X-Render-Time: 0.0157079696655"
  [115]=>
  string(17) "Connection: close"
  [116]=>
  string(44) "Last-Modified: Tue, 09 Aug 2016 12:59:13 GMT"
  [117]=>
  string(23) "X-Version: 62d2162cb91f"
  [118]=>
  string(27) "X-Frame-Options: SAMEORIGIN"
  [119]=>
  string(20) "X-Request-Count: 324"
  [120]=>
  string(18) "HTTP/1.1 302 FOUND"
  [121]=>
  string(19) "Server: nginx/1.6.2"
  [122]=>
  string(21) "Vary: Accept-Encoding"
  [123]=>
  string(24) "Cache-Control: max-age=0"
  [124]=>
  string(38) "Content-Type: text/html; charset=utf-8"
  [125]=>
  string(22) "Content-Encoding: gzip"
  [126]=>
  string(43) "Strict-Transport-Security: max-age=31536000"
  [127]=>
  string(35) "Date: Tue, 09 Aug 2016 12:59:13 GMT"
  [128]=>
  string(332) "Location: https://bitbucket.org/account/signin/?next=/account/signin/%3Fnext%3D/account/signin/%253Fnext%253D/account/signin/%25253Fnext%25253D/account/signin/%2525253Fnext%2525253D/account/signin/%252525253Fnext%252525253D/account/signin/%25252525253Fnext%25252525253D/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2"
  [129]=>
  string(20) "X-Served-By: app-106"
  [130]=>
  string(38) "Expires: Tue, 09 Aug 2016 12:59:13 GMT"
  [131]=>
  string(30) "X-Static-Version: 62d2162cb91f"
  [132]=>
  string(40) "ETag: "d41d8cd98f00b204e9800998ecf8427e""
  [133]=>
  string(31) "X-Content-Type-Options: nosniff"
  [134]=>
  string(30) "X-Render-Time: 0.0198369026184"
  [135]=>
  string(17) "Connection: close"
  [136]=>
  string(44) "Last-Modified: Tue, 09 Aug 2016 12:59:13 GMT"
  [137]=>
  string(23) "X-Version: 62d2162cb91f"
  [138]=>
  string(27) "X-Frame-Options: SAMEORIGIN"
  [139]=>
  string(20) "X-Request-Count: 422"
  [140]=>
  string(18) "HTTP/1.1 302 FOUND"
  [141]=>
  string(19) "Server: nginx/1.6.2"
  [142]=>
  string(21) "Vary: Accept-Encoding"
  [143]=>
  string(24) "Cache-Control: max-age=0"
  [144]=>
  string(38) "Content-Type: text/html; charset=utf-8"
  [145]=>
  string(22) "Content-Encoding: gzip"
  [146]=>
  string(43) "Strict-Transport-Security: max-age=31536000"
  [147]=>
  string(35) "Date: Tue, 09 Aug 2016 12:59:14 GMT"
  [148]=>
  string(382) "Location: https://bitbucket.org/account/signin/?next=/account/signin/%3Fnext%3D/account/signin/%253Fnext%253D/account/signin/%25253Fnext%25253D/account/signin/%2525253Fnext%2525253D/account/signin/%252525253Fnext%252525253D/account/signin/%25252525253Fnext%25252525253D/account/signin/%2525252525253Fnext%2525252525253D/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2"
  [149]=>
  string(20) "X-Served-By: app-124"
  [150]=>
  string(38) "Expires: Tue, 09 Aug 2016 12:59:14 GMT"
  [151]=>
  string(30) "X-Static-Version: 62d2162cb91f"
  [152]=>
  string(40) "ETag: "d41d8cd98f00b204e9800998ecf8427e""
  [153]=>
  string(31) "X-Content-Type-Options: nosniff"
  [154]=>
  string(30) "X-Render-Time: 0.0187971591949"
  [155]=>
  string(17) "Connection: close"
  [156]=>
  string(44) "Last-Modified: Tue, 09 Aug 2016 12:59:14 GMT"
  [157]=>
  string(23) "X-Version: 62d2162cb91f"
  [158]=>
  string(27) "X-Frame-Options: SAMEORIGIN"
  [159]=>
  string(20) "X-Request-Count: 268"
  [160]=>
  string(18) "HTTP/1.1 302 FOUND"
  [161]=>
  string(19) "Server: nginx/1.6.2"
  [162]=>
  string(21) "Vary: Accept-Encoding"
  [163]=>
  string(24) "Cache-Control: max-age=0"
  [164]=>
  string(38) "Content-Type: text/html; charset=utf-8"
  [165]=>
  string(22) "Content-Encoding: gzip"
  [166]=>
  string(43) "Strict-Transport-Security: max-age=31536000"
  [167]=>
  string(35) "Date: Tue, 09 Aug 2016 12:59:14 GMT"
  [168]=>
  string(436) "Location: https://bitbucket.org/account/signin/?next=/account/signin/%3Fnext%3D/account/signin/%253Fnext%253D/account/signin/%25253Fnext%25253D/account/signin/%2525253Fnext%2525253D/account/signin/%252525253Fnext%252525253D/account/signin/%25252525253Fnext%25252525253D/account/signin/%2525252525253Fnext%2525252525253D/account/signin/%252525252525253Fnext%252525252525253D/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2"
  [169]=>
  string(20) "X-Served-By: app-106"
  [170]=>
  string(38) "Expires: Tue, 09 Aug 2016 12:59:14 GMT"
  [171]=>
  string(30) "X-Static-Version: 62d2162cb91f"
  [172]=>
  string(40) "ETag: "d41d8cd98f00b204e9800998ecf8427e""
  [173]=>
  string(31) "X-Content-Type-Options: nosniff"
  [174]=>
  string(30) "X-Render-Time: 0.0200660228729"
  [175]=>
  string(17) "Connection: close"
  [176]=>
  string(44) "Last-Modified: Tue, 09 Aug 2016 12:59:14 GMT"
  [177]=>
  string(23) "X-Version: 62d2162cb91f"
  [178]=>
  string(27) "X-Frame-Options: SAMEORIGIN"
  [179]=>
  string(18) "X-Request-Count: 6"
  [180]=>
  string(18) "HTTP/1.1 302 FOUND"
  [181]=>
  string(19) "Server: nginx/1.6.2"
  [182]=>
  string(21) "Vary: Accept-Encoding"
  [183]=>
  string(24) "Cache-Control: max-age=0"
  [184]=>
  string(38) "Content-Type: text/html; charset=utf-8"
  [185]=>
  string(22) "Content-Encoding: gzip"
  [186]=>
  string(43) "Strict-Transport-Security: max-age=31536000"
  [187]=>
  string(35) "Date: Tue, 09 Aug 2016 12:59:15 GMT"
  [188]=>
  string(494) "Location: https://bitbucket.org/account/signin/?next=/account/signin/%3Fnext%3D/account/signin/%253Fnext%253D/account/signin/%25253Fnext%25253D/account/signin/%2525253Fnext%2525253D/account/signin/%252525253Fnext%252525253D/account/signin/%25252525253Fnext%25252525253D/account/signin/%2525252525253Fnext%2525252525253D/account/signin/%252525252525253Fnext%252525252525253D/account/signin/%25252525252525253Fnext%25252525252525253D/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2"
  [189]=>
  string(20) "X-Served-By: app-104"
  [190]=>
  string(38) "Expires: Tue, 09 Aug 2016 12:59:15 GMT"
  [191]=>
  string(30) "X-Static-Version: 62d2162cb91f"
  [192]=>
  string(40) "ETag: "d41d8cd98f00b204e9800998ecf8427e""
  [193]=>
  string(31) "X-Content-Type-Options: nosniff"
  [194]=>
  string(30) "X-Render-Time: 0.0160570144653"
  [195]=>
  string(17) "Connection: close"
  [196]=>
  string(44) "Last-Modified: Tue, 09 Aug 2016 12:59:15 GMT"
  [197]=>
  string(23) "X-Version: 62d2162cb91f"
  [198]=>
  string(27) "X-Frame-Options: SAMEORIGIN"
  [199]=>
  string(20) "X-Request-Count: 420"
  [200]=>
  string(18) "HTTP/1.1 302 FOUND"
  [201]=>
  string(19) "Server: nginx/1.6.2"
  [202]=>
  string(21) "Vary: Accept-Encoding"
  [203]=>
  string(24) "Cache-Control: max-age=0"
  [204]=>
  string(38) "Content-Type: text/html; charset=utf-8"
  [205]=>
  string(22) "Content-Encoding: gzip"
  [206]=>
  string(43) "Strict-Transport-Security: max-age=31536000"
  [207]=>
  string(35) "Date: Tue, 09 Aug 2016 12:59:15 GMT"
  [208]=>
  string(556) "Location: https://bitbucket.org/account/signin/?next=/account/signin/%3Fnext%3D/account/signin/%253Fnext%253D/account/signin/%25253Fnext%25253D/account/signin/%2525253Fnext%2525253D/account/signin/%252525253Fnext%252525253D/account/signin/%25252525253Fnext%25252525253D/account/signin/%2525252525253Fnext%2525252525253D/account/signin/%252525252525253Fnext%252525252525253D/account/signin/%25252525252525253Fnext%25252525252525253D/account/signin/%2525252525252525253Fnext%2525252525252525253D/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2"
  [209]=>
  string(20) "X-Served-By: app-106"
  [210]=>
  string(38) "Expires: Tue, 09 Aug 2016 12:59:15 GMT"
  [211]=>
  string(30) "X-Static-Version: 62d2162cb91f"
  [212]=>
  string(40) "ETag: "d41d8cd98f00b204e9800998ecf8427e""
  [213]=>
  string(31) "X-Content-Type-Options: nosniff"
  [214]=>
  string(30) "X-Render-Time: 0.0138478279114"
  [215]=>
  string(17) "Connection: close"
  [216]=>
  string(44) "Last-Modified: Tue, 09 Aug 2016 12:59:15 GMT"
  [217]=>
  string(23) "X-Version: 62d2162cb91f"
  [218]=>
  string(27) "X-Frame-Options: SAMEORIGIN"
  [219]=>
  string(20) "X-Request-Count: 352"
  [220]=>
  string(18) "HTTP/1.1 302 FOUND"
  [221]=>
  string(19) "Server: nginx/1.6.2"
  [222]=>
  string(21) "Vary: Accept-Encoding"
  [223]=>
  string(24) "Cache-Control: max-age=0"
  [224]=>
  string(38) "Content-Type: text/html; charset=utf-8"
  [225]=>
  string(22) "Content-Encoding: gzip"
  [226]=>
  string(43) "Strict-Transport-Security: max-age=31536000"
  [227]=>
  string(35) "Date: Tue, 09 Aug 2016 12:59:16 GMT"
  [228]=>
  string(622) "Location: https://bitbucket.org/account/signin/?next=/account/signin/%3Fnext%3D/account/signin/%253Fnext%253D/account/signin/%25253Fnext%25253D/account/signin/%2525253Fnext%2525253D/account/signin/%252525253Fnext%252525253D/account/signin/%25252525253Fnext%25252525253D/account/signin/%2525252525253Fnext%2525252525253D/account/signin/%252525252525253Fnext%252525252525253D/account/signin/%25252525252525253Fnext%25252525252525253D/account/signin/%2525252525252525253Fnext%2525252525252525253D/account/signin/%252525252525252525253Fnext%252525252525252525253D/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2"
  [229]=>
  string(20) "X-Served-By: app-104"
  [230]=>
  string(38) "Expires: Tue, 09 Aug 2016 12:59:16 GMT"
  [231]=>
  string(30) "X-Static-Version: 62d2162cb91f"
  [232]=>
  string(40) "ETag: "d41d8cd98f00b204e9800998ecf8427e""
  [233]=>
  string(31) "X-Content-Type-Options: nosniff"
  [234]=>
  string(30) "X-Render-Time: 0.0217881202698"
  [235]=>
  string(17) "Connection: close"
  [236]=>
  string(44) "Last-Modified: Tue, 09 Aug 2016 12:59:16 GMT"
  [237]=>
  string(23) "X-Version: 62d2162cb91f"
  [238]=>
  string(27) "X-Frame-Options: SAMEORIGIN"
  [239]=>
  string(20) "X-Request-Count: 375"
  [240]=>
  string(18) "HTTP/1.1 302 FOUND"
  [241]=>
  string(19) "Server: nginx/1.6.2"
  [242]=>
  string(21) "Vary: Accept-Encoding"
  [243]=>
  string(24) "Cache-Control: max-age=0"
  [244]=>
  string(38) "Content-Type: text/html; charset=utf-8"
  [245]=>
  string(22) "Content-Encoding: gzip"
  [246]=>
  string(43) "Strict-Transport-Security: max-age=31536000"
  [247]=>
  string(35) "Date: Tue, 09 Aug 2016 12:59:16 GMT"
  [248]=>
  string(692) "Location: https://bitbucket.org/account/signin/?next=/account/signin/%3Fnext%3D/account/signin/%253Fnext%253D/account/signin/%25253Fnext%25253D/account/signin/%2525253Fnext%2525253D/account/signin/%252525253Fnext%252525253D/account/signin/%25252525253Fnext%25252525253D/account/signin/%2525252525253Fnext%2525252525253D/account/signin/%252525252525253Fnext%252525252525253D/account/signin/%25252525252525253Fnext%25252525252525253D/account/signin/%2525252525252525253Fnext%2525252525252525253D/account/signin/%252525252525252525253Fnext%252525252525252525253D/account/signin/%25252525252525252525253Fnext%25252525252525252525253D/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2"
  [249]=>
  string(20) "X-Served-By: app-124"
  [250]=>
  string(38) "Expires: Tue, 09 Aug 2016 12:59:16 GMT"
  [251]=>
  string(30) "X-Static-Version: 62d2162cb91f"
  [252]=>
  string(40) "ETag: "d41d8cd98f00b204e9800998ecf8427e""
  [253]=>
  string(31) "X-Content-Type-Options: nosniff"
  [254]=>
  string(30) "X-Render-Time: 0.0212509632111"
  [255]=>
  string(17) "Connection: close"
  [256]=>
  string(44) "Last-Modified: Tue, 09 Aug 2016 12:59:16 GMT"
  [257]=>
  string(23) "X-Version: 62d2162cb91f"
  [258]=>
  string(27) "X-Frame-Options: SAMEORIGIN"
  [259]=>
  string(20) "X-Request-Count: 190"
  [260]=>
  string(18) "HTTP/1.1 302 FOUND"
  [261]=>
  string(19) "Server: nginx/1.6.2"
  [262]=>
  string(21) "Vary: Accept-Encoding"
  [263]=>
  string(24) "Cache-Control: max-age=0"
  [264]=>
  string(38) "Content-Type: text/html; charset=utf-8"
  [265]=>
  string(22) "Content-Encoding: gzip"
  [266]=>
  string(43) "Strict-Transport-Security: max-age=31536000"
  [267]=>
  string(35) "Date: Tue, 09 Aug 2016 12:59:17 GMT"
  [268]=>
  string(766) "Location: https://bitbucket.org/account/signin/?next=/account/signin/%3Fnext%3D/account/signin/%253Fnext%253D/account/signin/%25253Fnext%25253D/account/signin/%2525253Fnext%2525253D/account/signin/%252525253Fnext%252525253D/account/signin/%25252525253Fnext%25252525253D/account/signin/%2525252525253Fnext%2525252525253D/account/signin/%252525252525253Fnext%252525252525253D/account/signin/%25252525252525253Fnext%25252525252525253D/account/signin/%2525252525252525253Fnext%2525252525252525253D/account/signin/%252525252525252525253Fnext%252525252525252525253D/account/signin/%25252525252525252525253Fnext%25252525252525252525253D/account/signin/%2525252525252525252525253Fnext%2525252525252525252525253D/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2"
  [269]=>
  string(20) "X-Served-By: app-104"
  [270]=>
  string(38) "Expires: Tue, 09 Aug 2016 12:59:17 GMT"
  [271]=>
  string(30) "X-Static-Version: 62d2162cb91f"
  [272]=>
  string(40) "ETag: "d41d8cd98f00b204e9800998ecf8427e""
  [273]=>
  string(31) "X-Content-Type-Options: nosniff"
  [274]=>
  string(30) "X-Render-Time: 0.0162808895111"
  [275]=>
  string(17) "Connection: close"
  [276]=>
  string(44) "Last-Modified: Tue, 09 Aug 2016 12:59:17 GMT"
  [277]=>
  string(23) "X-Version: 62d2162cb91f"
  [278]=>
  string(27) "X-Frame-Options: SAMEORIGIN"
  [279]=>
  string(20) "X-Request-Count: 349"
  [280]=>
  string(18) "HTTP/1.1 302 FOUND"
  [281]=>
  string(19) "Server: nginx/1.6.2"
  [282]=>
  string(21) "Vary: Accept-Encoding"
  [283]=>
  string(24) "Cache-Control: max-age=0"
  [284]=>
  string(38) "Content-Type: text/html; charset=utf-8"
  [285]=>
  string(22) "Content-Encoding: gzip"
  [286]=>
  string(43) "Strict-Transport-Security: max-age=31536000"
  [287]=>
  string(35) "Date: Tue, 09 Aug 2016 12:59:17 GMT"
  [288]=>
  string(844) "Location: https://bitbucket.org/account/signin/?next=/account/signin/%3Fnext%3D/account/signin/%253Fnext%253D/account/signin/%25253Fnext%25253D/account/signin/%2525253Fnext%2525253D/account/signin/%252525253Fnext%252525253D/account/signin/%25252525253Fnext%25252525253D/account/signin/%2525252525253Fnext%2525252525253D/account/signin/%252525252525253Fnext%252525252525253D/account/signin/%25252525252525253Fnext%25252525252525253D/account/signin/%2525252525252525253Fnext%2525252525252525253D/account/signin/%252525252525252525253Fnext%252525252525252525253D/account/signin/%25252525252525252525253Fnext%25252525252525252525253D/account/signin/%2525252525252525252525253Fnext%2525252525252525252525253D/account/signin/%252525252525252525252525253Fnext%252525252525252525252525253D/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2"
  [289]=>
  string(20) "X-Served-By: app-104"
  [290]=>
  string(38) "Expires: Tue, 09 Aug 2016 12:59:17 GMT"
  [291]=>
  string(30) "X-Static-Version: 62d2162cb91f"
  [292]=>
  string(40) "ETag: "d41d8cd98f00b204e9800998ecf8427e""
  [293]=>
  string(31) "X-Content-Type-Options: nosniff"
  [294]=>
  string(30) "X-Render-Time: 0.0199120044708"
  [295]=>
  string(17) "Connection: close"
  [296]=>
  string(44) "Last-Modified: Tue, 09 Aug 2016 12:59:17 GMT"
  [297]=>
  string(23) "X-Version: 62d2162cb91f"
  [298]=>
  string(27) "X-Frame-Options: SAMEORIGIN"
  [299]=>
  string(19) "X-Request-Count: 22"
  [300]=>
  string(18) "HTTP/1.1 302 FOUND"
  [301]=>
  string(19) "Server: nginx/1.6.2"
  [302]=>
  string(21) "Vary: Accept-Encoding"
  [303]=>
  string(24) "Cache-Control: max-age=0"
  [304]=>
  string(38) "Content-Type: text/html; charset=utf-8"
  [305]=>
  string(22) "Content-Encoding: gzip"
  [306]=>
  string(43) "Strict-Transport-Security: max-age=31536000"
  [307]=>
  string(35) "Date: Tue, 09 Aug 2016 12:59:18 GMT"
  [308]=>
  string(926) "Location: https://bitbucket.org/account/signin/?next=/account/signin/%3Fnext%3D/account/signin/%253Fnext%253D/account/signin/%25253Fnext%25253D/account/signin/%2525253Fnext%2525253D/account/signin/%252525253Fnext%252525253D/account/signin/%25252525253Fnext%25252525253D/account/signin/%2525252525253Fnext%2525252525253D/account/signin/%252525252525253Fnext%252525252525253D/account/signin/%25252525252525253Fnext%25252525252525253D/account/signin/%2525252525252525253Fnext%2525252525252525253D/account/signin/%252525252525252525253Fnext%252525252525252525253D/account/signin/%25252525252525252525253Fnext%25252525252525252525253D/account/signin/%2525252525252525252525253Fnext%2525252525252525252525253D/account/signin/%252525252525252525252525253Fnext%252525252525252525252525253D/account/signin/%25252525252525252525252525253Fnext%25252525252525252525252525253D/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2"
  [309]=>
  string(20) "X-Served-By: app-124"
  [310]=>
  string(38) "Expires: Tue, 09 Aug 2016 12:59:18 GMT"
  [311]=>
  string(30) "X-Static-Version: 62d2162cb91f"
  [312]=>
  string(40) "ETag: "d41d8cd98f00b204e9800998ecf8427e""
  [313]=>
  string(31) "X-Content-Type-Options: nosniff"
  [314]=>
  string(30) "X-Render-Time: 0.0201079845428"
  [315]=>
  string(17) "Connection: close"
  [316]=>
  string(44) "Last-Modified: Tue, 09 Aug 2016 12:59:18 GMT"
  [317]=>
  string(23) "X-Version: 62d2162cb91f"
  [318]=>
  string(27) "X-Frame-Options: SAMEORIGIN"
  [319]=>
  string(20) "X-Request-Count: 194"
  [320]=>
  string(18) "HTTP/1.1 302 FOUND"
  [321]=>
  string(19) "Server: nginx/1.6.2"
  [322]=>
  string(21) "Vary: Accept-Encoding"
  [323]=>
  string(24) "Cache-Control: max-age=0"
  [324]=>
  string(38) "Content-Type: text/html; charset=utf-8"
  [325]=>
  string(22) "Content-Encoding: gzip"
  [326]=>
  string(43) "Strict-Transport-Security: max-age=31536000"
  [327]=>
  string(35) "Date: Tue, 09 Aug 2016 12:59:18 GMT"
  [328]=>
  string(1012) "Location: https://bitbucket.org/account/signin/?next=/account/signin/%3Fnext%3D/account/signin/%253Fnext%253D/account/signin/%25253Fnext%25253D/account/signin/%2525253Fnext%2525253D/account/signin/%252525253Fnext%252525253D/account/signin/%25252525253Fnext%25252525253D/account/signin/%2525252525253Fnext%2525252525253D/account/signin/%252525252525253Fnext%252525252525253D/account/signin/%25252525252525253Fnext%25252525252525253D/account/signin/%2525252525252525253Fnext%2525252525252525253D/account/signin/%252525252525252525253Fnext%252525252525252525253D/account/signin/%25252525252525252525253Fnext%25252525252525252525253D/account/signin/%2525252525252525252525253Fnext%2525252525252525252525253D/account/signin/%252525252525252525252525253Fnext%252525252525252525252525253D/account/signin/%25252525252525252525252525253Fnext%25252525252525252525252525253D/account/signin/%2525252525252525252525252525253Fnext%2525252525252525252525252525253D/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2"
  [329]=>
  string(20) "X-Served-By: app-104"
  [330]=>
  string(38) "Expires: Tue, 09 Aug 2016 12:59:18 GMT"
  [331]=>
  string(30) "X-Static-Version: 62d2162cb91f"
  [332]=>
  string(40) "ETag: "d41d8cd98f00b204e9800998ecf8427e""
  [333]=>
  string(31) "X-Content-Type-Options: nosniff"
  [334]=>
  string(30) "X-Render-Time: 0.0158410072327"
  [335]=>
  string(17) "Connection: close"
  [336]=>
  string(44) "Last-Modified: Tue, 09 Aug 2016 12:59:18 GMT"
  [337]=>
  string(23) "X-Version: 62d2162cb91f"
  [338]=>
  string(27) "X-Frame-Options: SAMEORIGIN"
  [339]=>
  string(20) "X-Request-Count: 389"
  [340]=>
  string(18) "HTTP/1.1 302 FOUND"
  [341]=>
  string(19) "Server: nginx/1.6.2"
  [342]=>
  string(21) "Vary: Accept-Encoding"
  [343]=>
  string(24) "Cache-Control: max-age=0"
  [344]=>
  string(38) "Content-Type: text/html; charset=utf-8"
  [345]=>
  string(22) "Content-Encoding: gzip"
  [346]=>
  string(43) "Strict-Transport-Security: max-age=31536000"
  [347]=>
  string(35) "Date: Tue, 09 Aug 2016 12:59:19 GMT"
  [348]=>
  string(20) "X-Served-By: app-104"
  [349]=>
  string(38) "Expires: Tue, 09 Aug 2016 12:59:19 GMT"
  [350]=>
  string(30) "X-Static-Version: 62d2162cb91f"
  [351]=>
  string(40) "ETag: "d41d8cd98f00b204e9800998ecf8427e""
  [352]=>
  string(31) "X-Content-Type-Options: nosniff"
  [353]=>
  string(30) "X-Render-Time: 0.0199761390686"
  [354]=>
  string(17) "Connection: close"
  [355]=>
  string(44) "Last-Modified: Tue, 09 Aug 2016 12:59:19 GMT"
  [356]=>
  string(23) "X-Version: 62d2162cb91f"
  [357]=>
  string(27) "X-Frame-Options: SAMEORIGIN"
  [358]=>
  string(20) "X-Request-Count: 381"
</details>

@jakoch
Copy link
Owner

jakoch commented Aug 9, 2016

Hey Mickaël!

Thank you for reporting this issue.

It still think the Bitbucket CDN or their load balancer has some issues. It's unlikely that the download behaviour of Bitbucket changes, even when you set the Oauth token. It's simply unreliable and you have to re-try way to often to get a download. (Yes, the headers you posted indicate an infinite redirect, because the download is not available and the request counter goes up until you hit the API limit, then the token request kicks in, then even if the token is set, the download might fail.)

I've added the PHANTOMJS_CDNURL directive to address this issue.
But it's likely that we have to sort some issues out to stabilize the mirror handling.

You don't need to set PHANTOMJS_CDNURL=https://bitbucket.org/ariya/phantomjs/downloads/
The bitbucket download is the default fallback, when no PHANTOMJS_CDNURL set.
I should point that out in the Readme.

When using PHANTOMJS_CDNURL=https://github.com/Medium/phantomjs/, the Composer TransportException with 0: Content-Length mismatch shouldn't happen. That sounds like a bug.
But it's hard so say the cause. It needs some digging into the Composer Downloader with activated logging. It could be anything: from a redirection header, gzipped content, mbstring overloading conflicting with string length calculations. Without any further digging, i would say it's an upstream issue.

@mickaelperrin
Copy link
Author

Some update about this, I tried to host myself the binaries of Github. As expected, I got the same issue as with the Medium release:

Failed: [Composer\Downloader\TransportException] 0: Content-Length mismatch

@alexleonard
Copy link

I had to clear my composer cache today and encountered this issue as well

> post-install-cmd: PhantomInstaller\Installer::installPhantomJS
  - Installing phantomjs (2.1.1)
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
    Downloading: Connecting...Following redirect (2) https://bbuseruploads.s3.amazonaws.com/fd96ed93-2b32-46a7-9d2b-ecbc0988516a/downloads/396e7977-71fd-4592-8723-495ca4cfa7cc/phantomjs-2.1.1-linux-x86_64.tar.bz2?Signature=xxxx&Expires=1471018495&AWSAccessKeyId=xxxx&versionId=null&response-content-disposition=attachment%3B%20filename%3D%22phantomjs-2.1.1-linux-x86_64.tar.bz2%22
Downloading https://bbuseruploads.s3.amazonaws.com/fd96ed93-2b32-46a7-9d2b-ecbc0988516a/downloads/396e7977-71fd-4592-8723-495ca4cfa7cc/phantomjs-2.1.1-linux-x86_64.tar.bz2?Signature=xxxx&Expires=1471018495&AWSAccessKeyId=xxxx&versionId=null&response-content-disposition=attachment%3B%20filename%3D%22phantomjs-2.1.1-linux-x86_64.tar.bz2%22
    Authentication required (bbuseruploads.s3.amazonaws.com):                                                                                                                                                                                                                                                                                                                                  
      Username: 

@iainp999
Copy link

iainp999 commented Sep 1, 2016

Same issue here, I've been unable to find a solution. Has anyone made any progress? Thanks

edit: turns out I'd previously configured oauth; removing the config resolved the issue.

@nadavoid
Copy link

nadavoid commented Sep 8, 2016

@iainp999 Thanks for the update. I encountered this issue a couple of days ago and jumped through the hoops of configuring oauth. That didn't work. Today I removed my oauth config from my auth.json file, and now a composer install completes successfully. The binary is downloaded from bitbucket and moved into the right place.

@iainp999
Copy link

iainp999 commented Sep 8, 2016

@nadavoid no problem! glad you got it sorted out.

@berlinger-rarents
Copy link
Contributor

This is still an issue when using PHP < 5.6 and/or having oauth configured for bitbucket in composer config. It's not always possible to change those. The PHANTOMJS_CDNURL environment variable is a nice addition, but not ideal in my opinion. There is no control over environment variables inside a repository / composer.json. So one would always have to instruct others using the repository to remember to set that env before running composer.update. I'll write a PR to read from a config file in the repository.

Issue about bitbucket downloads on composer: #5584. I'm afraid it might not get solved.

I propose using another CDN by default instead of bitbucket. E.g. github medium/phantomjs. Because I think there will be more support for github downloading from composer.

@jakoch
Copy link
Owner

jakoch commented Sep 29, 2016

There is no control over environment variables inside a repository / composer.json. So one would always have to instruct others using the repository to remember to set that env before running composer.update. I'll write a PR to read from a config file in the repository.

I would suggest to add it to composer.json itself then, maybe as custom config ['phantomjs-install']['cdn_url']. Then it ships along to others. What do you think?

@berlinger-rarents
Copy link
Contributor

Even nicer. If it is allowed to put custom config in composer.json.

@jakoch
Copy link
Owner

jakoch commented Sep 29, 2016

Yes, it's allowed. There is a section extra, see

https://getcomposer.org/doc/04-schema.md#extra and
https://github.com/composer/composer/blob/master/res/composer-schema.json#L271-L274

So, we could use an entry like this:

"extra": {
        "phantomjs-installer": {
            "cdn_url": "http://.."
        }
    }

One more thing to consider: if we add this functionality, then setting the ENV var locally needs to be an override for the value in composer.json. (To allow: even if the team uses CDN x, the local developer uses CDN y.)

berlinger-rarents added a commit to berlinger-rarents/phantomjs-installer that referenced this issue Sep 29, 2016
@berlinger-rarents
Copy link
Contributor

Funny thing by the way,
https://github.com/Medium/phantomjs/releases/download/v1.9.8/phantomjs-1.9.8-macosx.zip
is a 404. They moved it apparently to
https://github.com/Medium/phantomjs/releases/download/v1.9.19/phantomjs-1.9.8-macosx.zip

berlinger-rarents added a commit to berlinger-rarents/phantomjs-installer that referenced this issue Sep 29, 2016
berlinger-rarents added a commit to berlinger-rarents/phantomjs-installer that referenced this issue Sep 29, 2016
@jakoch
Copy link
Owner

jakoch commented Oct 12, 2016

  • changed default download location to the "new" Bitbucket v2 API:
    https://api.bitbucket.org/2.0/repositories/ariya/phantomjs/downloads/
  • tagged a new release: 2.1.1-p07

Roel, thank you again for working here and on the upstream to solve this issue!
The builds are green and i think the issue is finally resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants