colszowka / phantomjs-gem

Phantomjs via Rubygems: Auto-install phantomjs on demand for current platform. Comes with poltergeist integration.
Other
222 stars 106 forks source link

Everything is sad if bitbucket is down #70

Open jonahwh opened 8 years ago

jonahwh commented 8 years ago

Bitbucket is currently down, which causes the following.

One solution is to rescue and not re-raise this error if there is already a matching version of phantomjs in the PATH.

phantomjs does not appear to be installed in /home/rof/.phantomjs/2.1.1/x86_64-linux/bin/phantomjs, installing!
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100 64146    0 64146    0     0  3127k      0 --:--:-- --:--:-- --:--:-- 3296k
bunzip2: phantomjs-2.1.1-linux-x86_64.tar.bz2 is not a bzip2 file.
tar: phantomjs-2.1.1-linux-x86_64.tar: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
rake aborted!
TypeError: no implicit conversion of nil into String
/home/rof/cache/bundler/ruby/2.2.0/gems/phantomjs-2.1.1.0/lib/phantomjs/platform.rb:72:in `block in install!'
/home/rof/cache/bundler/ruby/2.2.0/gems/phantomjs-2.1.1.0/lib/phantomjs/platform.rb:53:in `chdir'
/home/rof/cache/bundler/ruby/2.2.0/gems/phantomjs-2.1.1.0/lib/phantomjs/platform.rb:53:in `install!'
/home/rof/cache/bundler/ruby/2.2.0/gems/phantomjs-2.1.1.0/lib/phantomjs/platform.rb:86:in `ensure_installed!'
/home/rof/cache/bundler/ruby/2.2.0/gems/phantomjs-2.1.1.0/lib/phantomjs.rb:30:in `platform'
/home/rof/cache/bundler/ruby/2.2.0/gems/phantomjs-2.1.1.0/lib/phantomjs.rb:25:in `path'
/home/rof/cache/bundler/ruby/2.2.0/gems/phantomjs-2.1.1.0/lib/phantomjs/poltergeist.rb:10:in `<top (required)>'
/home/rof/.rvm/gems/ruby-2.2.2/gems/bundler-1.9.5/lib/bundler/runtime.rb:76:in `require'
/home/rof/.rvm/gems/ruby-2.2.2/gems/bundler-1.9.5/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/home/rof/.rvm/gems/ruby-2.2.2/gems/bundler-1.9.5/lib/bundler/runtime.rb:72:in `each'
/home/rof/.rvm/gems/ruby-2.2.2/gems/bundler-1.9.5/lib/bundler/runtime.rb:72:in `block in require'
/home/rof/.rvm/gems/ruby-2.2.2/gems/bundler-1.9.5/lib/bundler/runtime.rb:61:in `each'
/home/rof/.rvm/gems/ruby-2.2.2/gems/bundler-1.9.5/lib/bundler/runtime.rb:61:in `require'
/home/rof/.rvm/gems/ruby-2.2.2/gems/bundler-1.9.5/lib/bundler.rb:134:in `require'
...
(See full trace by running task with --trace)
davebrace commented 8 years ago

I ran into the same issue today. In my case, it looks like BitBucket is not down, but rather they are returning 'Rate limit for this resource has been exceeded'.

agios commented 8 years ago

Same here, on a ci server, very annoying...

jonahwh commented 8 years ago

Just as an update, as a workaround in CI, I ended up hosting my own version of the binary in S3, and am downloading that ahead of time so this gem sees that it already exists in my PATH.

alexBaizeau commented 8 years ago

Thanks for sharing your workaround!

davebrace commented 8 years ago

Looks like the phantomjs team is working to setup alternative download locations: https://github.com/ariya/phantomjs/issues/13953

Zeneixe commented 8 years ago

I am getting this error VERY often on Circle CI

yurifds commented 8 years ago

Same here. I am using Semaphore.

tansaku commented 8 years ago

We're having this same issue on phantomjs 2.1.1.0 at the moment:

https://github.com/AgileVentures/WebsiteOne/issues/1103

shepmaster commented 8 years ago

One workaround is to use your CI environment's caching ability:

This appears to improve our case.

Also, Ubuntu 14.04 on CircleCI happens to include PhantomJS 2.1.1, avoiding any download until the next version is released.

cunnie commented 6 years ago

One suggestion would be to add the -f flag to the curl command which is used to download the asset. This would cause curl to fail instead of successfully downloading the bitbucket error page. Hopefully this would make it clear in the error message that the asset failed to download.

On the downside, the failed curl would be immediately by a wget which may bury the cause of the error.

Let me know if you want a PR.

Phantomjs does not appear to be installed in /root/.phantomjs/2.1.1/x86_64-linux/bin/phantomjs, installing!
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 31300  100 31300    0     0  78021      0 --:--:-- --:--:-- --:--:-- 78250
bunzip2: phantomjs-2.1.1-linux-x86_64.tar.bz2 is not a bzip2 file.
tar: phantomjs-2.1.1-linux-x86_64.tar: Cannot open: No such file or directory
ashawley commented 6 years ago

https://status.bitbucket.org/incidents/z029156p1svh

We are presently investigating service issues with Bitbucket resulting in degraded performance on the website and via SSH & Git via HTTPS. -- Jan 09, 2018 - 13:47 UTC

I don't mind the bad errors, I guess I wish my CI service cache proxied bitbucket for our builds. Not like phantomjs-2.1.1 has changed recently...