practicalmeteor/spacejam

PhantomJS dependency is being rate limited by bitbucket

Closed this issue · 3 comments

This is a big problem with CI as builds will randomly fail based on phantomjs being installed or not.
Our current workaround is to use our forked spacejam package.

> phantomjs@1.9.16 install /home/ubuntu/nvm/v0.10.33/lib/node_modules/spacejam/node_modules/phantomjs
> node install.js

PhantomJS detected, but wrong version 2.1.1 @ /usr/local/bin/phantomjs.
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2
Saving to /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2
Receiving...

Error requesting archive.
Status: 403
Request options: {
  "uri": "https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2",
  "encoding": null,
  "followRedirect": true,
  "headers": {},
  "strictSSL": true
}
Response headers: {
  "x-amz-request-id": "EF0ED079FB70957F",
  "x-amz-id-2": "E0Nw03P++DfFE5A8NiRlEo5SzRbZaxyO4/Yo6NNR7VIDLGrcHDuplaT0ZU3/65SDTKM5eOK3P+E=",
  "content-type": "application/xml",
  "transfer-encoding": "chunked",
  "date": "Mon, 04 Apr 2016 23:17:23 GMT",
  "server": "AmazonS3"
}
cpury commented

We had the exact same problem. Fixed it by some tweaks to our circle.yml:

  • Download phantom js manually via wget in override:
  • Use that file when installing phantomjs, e.g. npm install phantomjs@1.9.16 --phantomjs_downloadurl=file://~/phantom2js/phantomjs-1.9.16.tgz
  • Cache our downloaded version of phantomjs in cache_directories:

That way, the download only needs to succeed once and then all future build will use the cached version.

If you (this project) update the phantomjs dependency, the CDN has recently been switched to github. Or you can just use the CDN_URL env variable (I think that's it, but check the README.md on the phantomjs repo) to point to the new location.

https://github.com/Medium/phantomjs/releases

After I did that, my problems went away.

I also see there are a few issues here to bump the version of phantom prebuilt to > 2.0, so that should help whenever that gets done.

@denodaeus great, will add this to the readme, once we document travis ci usage in it.