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

Net::ResourceBusyError Permission denied #201

Closed
fstybel opened this issue Oct 17, 2018 · 5 comments
Closed

Net::ResourceBusyError Permission denied #201

fstybel opened this issue Oct 17, 2018 · 5 comments

Comments

@fstybel
Copy link

fstybel commented Oct 17, 2018

Hi,
I have question about using Semian.
I configured simple NetHttp adapter (like in README):
config/initializers/semian.rb

SEMIAN_PARAMETERS = { 
  tickets:           ENV['SEMIAN_TICKETS'].to_i,
  success_threshold: ENV['SEMIAN_SUCCESS_THRESHOLD'].to_i,
  error_threshold:   ENV['SEMIAN_ERROR_THRESHOLD'].to_i,
  error_timeout:     ENV['SEMIAN_ERROR_TIMEOUT'].to_i
}.freeze

Semian::NetHTTP.exceptions += [::OpenSSL::SSL::SSLError]
Semian::NetHTTP.semian_configuration = proc do |host, _port|
  case(host)
  when 'site1.com')
    SEMIAN_PARAMETERS.merge(name: 'site_1')
  when 'site2.com')
    SEMIAN_PARAMETERS.merge(name: 'site_2')
  else
    nil
  end
end

I tested it on development, and all was looks good. But problem was shows on after production deployment. When I try execute http request from rails console then I getting error:

2.3.6 :090 > RestClient.get('https://site1.com')
Net::ResourceBusyError: [nethttp_site_1] semget() failed, errno: 13 (Permission denied)
	from /usr/local/rvm/gems/ruby-2.3.6/gems/semian-0.8.3/lib/semian/adapter.rb:40:in `rescue in acquire_semian_resource'
	from /usr/local/rvm/gems/ruby-2.3.6/gems/semian-0.8.3/lib/semian/adapter.rb:32:in `acquire_semian_resource'
	from /usr/local/rvm/gems/ruby-2.3.6/gems/semian-0.8.3/lib/semian/net_http.rb:83:in `connect'
	from /usr/local/rvm/rubies/ruby-2.3.6/lib/ruby/2.3.0/net/http.rb:863:in `do_start'
	from /usr/local/rvm/rubies/ruby-2.3.6/lib/ruby/2.3.0/net/http.rb:852:in `start'
	from /usr/local/rvm/gems/ruby-2.3.6/gems/rest-client-2.0.2/lib/restclient/request.rb:715:in `transmit'
	from /usr/local/rvm/gems/ruby-2.3.6/gems/rest-client-2.0.2/lib/restclient/request.rb:145:in `execute'
	from /usr/local/rvm/gems/ruby-2.3.6/gems/rest-client-2.0.2/lib/restclient/request.rb:52:in `execute'
	from /usr/local/rvm/gems/ruby-2.3.6/gems/rest-client-2.0.2/lib/restclient.rb:67:in `get'
	from (irb):90
	from /usr/local/rvm/gems/ruby-2.3.6/gems/railties-4.2.5/lib/rails/commands/console.rb:110:in `start'
	from /usr/local/rvm/gems/ruby-2.3.6/gems/railties-4.2.5/lib/rails/commands/console.rb:9:in `start'
	from /usr/local/rvm/gems/ruby-2.3.6/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:68:in `console'
	from /usr/local/rvm/gems/ruby-2.3.6/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
	from /usr/local/rvm/gems/ruby-2.3.6/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
	from bin/rails:4:in `require'
	from bin/rails:4:in `<main>'

In this time Semian.resources return blank hash.

Could you explain me what is wrong? I don't understand this error.

@sirupsen
Copy link
Contributor

Is this on OS X? Bulkheads (i.e. tickets) are not supported on OS X. We just disable them in development and test.

@fstybel
Copy link
Author

fstybel commented Oct 24, 2018

I working on OS X. But server works on Docker container in Amazon with system: ubuntu 16.04

@sirupsen
Copy link
Contributor

Yep, tickets on OS X is not supported. See README.

Feel free to revive #51

@bsandeepan
Copy link

@fstybel I am stuck trying to undewrstand how to use the NetHttp adapter. Can you help me out?
#312

@sirupsen
Copy link
Contributor

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

No branches or pull requests

3 participants