iron-io / iron_worker_ruby_ng

Next Gen Ruby gem for IronWorker
www.iron.io
BSD 2-Clause "Simplified" License
58 stars 22 forks source link

Remote Build Failing - mime-types dependency #159

Open chrishol opened 10 years ago

chrishol commented 10 years ago

Error:

/task/__gems__/gems/bundler-1.3.5/lib/bundler/runtime.rb:33:in `block in setup': You have already activated mime-types 2.0, but your Gemfile requires mime-types 1.25. Using bundle exec may solve this. (Gem::LoadError)
    from /task/__gems__/gems/bundler-1.3.5/lib/bundler/runtime.rb:19:in `setup'
    from /task/__gems__/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
    from /task/__gems__/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `<top (required)>'
    from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /task/__builder__.rb:45:in `<top (required)>'
    from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from __runner__.rb:213:in `<main>'

Stacktrace:

/usr/local/rvm/gems/ruby-2.0.0-p195/gems/iron_core-1.0.1/lib/iron_core/iron_logger.rb:50:in `raise_exception'
/usr/local/rvm/gems/ruby-2.0.0-p195/gems/iron_core-1.0.1/lib/iron_core/iron_logger.rb:27:in `error'
/usr/local/rvm/gems/ruby-2.0.0-p195/gems/iron_worker_ng-1.0.2/lib/iron_worker_ng/client.rb:116:in `codes_create'
/usr/local/rvm/gems/ruby-2.0.0-p195/gems/iron_worker_ng-1.0.2/lib/iron_worker_ng/client.rb:18:in `method_missing'
/Users/chrishol/code/hasty-backend/lib/tasks/iron_worker.rake:24:in `upload_worker'
/Users/chrishol/code/hasty-backend/lib/tasks/iron_worker.rake:40:in `block (5 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.0.0-p195/gems/bugsnag-1.6.3/lib/bugsnag/rake.rb:27:in `block in bugsnag_define_task'
Tasks: TOP => workers:staging:upload_yelp_cacher

A new version of the mime-types gem was just released. Does this need fixing at < 2.0 for now?

chrishol commented 10 years ago

This issue (https://github.com/rest-client/rest-client/pull/240) is relevant.

fred commented 10 years ago

I cant deploy any ruby worker to Iron IO now because of this issue. This is a serious issue.

It seems the server has mime-type 2.0 already installed.

/task/__gems__/gems/bundler-1.3.5/lib/bundler/runtime.rb:33:in `block in setup': You have already activated mime-types 2.0, but your Gemfile requires mime-types 1.25. Using bundle exec may solve this. (Gem::LoadError)
    Fetching gem metadata from http://rubygems.org/.......
from /task/__gems__/gems/bundler-1.3.5/lib/bundler/runtime.rb:19:in `setup'
from /task/__gems__/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
from /task/__gems__/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `<top (required)>'
from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /task/__builder__.rb:45:in `<top (required)>'
from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from __runner__.rb:213:in `<main>'
chrishol commented 10 years ago

Yes, all of my workers that require a remote build are failing for this reason so new code uploads aren't currently possible for these.

vreys commented 10 years ago

:+1: I'm experiencing this issue with my build worker too

rkononov commented 10 years ago

as a temporary solution just add following line to your .worker file

@use_local_iron_worker_ng = true

vreys commented 10 years ago

@rkononov, @use_local_iron_worker_ng = true did the trick. Thx.

vreys commented 10 years ago

@rkononov, the solution you provided didn't work for all of my builders. I've got the following errors:

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions into the /task/__gems__/bin directory.
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions into the /task/__gems__/bin directory.
Could not find gem 'ffi (= 1.9.2) ruby' in the gems available on this machine.

Here is the full backtrace: https://gist.github.com/vreys/7248018#file-gistfile1-txt

rkononov commented 10 years ago

@iced could you check this one?

fred commented 10 years ago

this fix works for me, I can now deploy my ruby workers, but now I'm having another issue with params not being available.. a new BUG:

params is not set, when I try to access params on the worker, i.e: params['name'] I get error:

params['name']
undefined method `[]' for nil:NilClass 

parameters to iron worker are just fine

{
  "name": "homespace"
}

back to square 1

vreys commented 10 years ago

Any update on this?

treeder commented 10 years ago

Can you guys all comment on this pull request to get the fix in? https://github.com/rest-client/rest-client/pull/240

fred commented 10 years ago

Having issues with 1.25.1

/task/__gems__/gems/bundler-1.5.0.rc.1/lib/bundler/runtime.rb:34:in `block in setup': You have already activated mime-types 1.25, but your Gemfile requires mime-types 1.25.1. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
    from /task/__gems__/gems/bundler-1.5.0.rc.1/lib/bundler/runtime.rb:19:in `setup'
    from /task/__gems__/gems/bundler-1.5.0.rc.1/lib/bundler.rb:119:in `setup'
    from /task/__gems__/gems/bundler-1.5.0.rc.1/lib/bundler/setup.rb:17:in `<top (required)>'
    from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /task/__builder__.rb:45:in `<top (required)>'
    from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from __runner__.rb:213:in `<main>'

I had

gem 'mime-types', '~> 1.25'

than changing to this fixes it.

gem 'mime-types', '1.25'

Seems that there is a real problem with gems versioning on Iron ruby workers. Many gems need freezing. Is there any plans on fixing this issue for good?

tamoyal commented 10 years ago

+1 to the mime types gem versioning issue. @use_local_iron_worker_ng = true did not solve my problem

hanchang commented 9 years ago

I had a bunch of these issues as well, and downgrading from ruby 2.1 to ruby 1.9 as the stack solved my problem.

# your.worker
runtime "ruby"
stack "ruby-1.9"
treeder commented 9 years ago

Hey guys, we recommend use the new Docker based workerflow for IronWorker, gets rid of all these issues.

Blog post: http://blog.iron.io/2015/03/the-new-ironworker-development-workflow.html Examples repo: https://github.com/iron-io/dockerworker