iron_worker_ruby_ng icon indicating copy to clipboard operation
iron_worker_ruby_ng copied to clipboard

Remote Build Failing - mime-types dependency

Open chrishol opened this issue 11 years ago • 15 comments

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 avatar Oct 30 '13 03:10 chrishol

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

chrishol avatar Oct 30 '13 03:10 chrishol

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>'

fred avatar Oct 31 '13 06:10 fred

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.

chrishol avatar Oct 31 '13 08:10 chrishol

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

vreys avatar Oct 31 '13 09:10 vreys

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

@use_local_iron_worker_ng = true

rkononov avatar Oct 31 '13 09:10 rkononov

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

vreys avatar Oct 31 '13 09:10 vreys

@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

vreys avatar Oct 31 '13 11:10 vreys

@iced could you check this one?

rkononov avatar Oct 31 '13 11:10 rkononov

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

fred avatar Oct 31 '13 12:10 fred

Any update on this?

vreys avatar Nov 04 '13 07:11 vreys

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

treeder avatar Nov 04 '13 16:11 treeder

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?

fred avatar Dec 01 '13 01:12 fred

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

tamoyal avatar Dec 01 '13 18:12 tamoyal

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"

hanchang avatar Apr 03 '15 21:04 hanchang

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

treeder avatar Apr 03 '15 22:04 treeder