Open xAxKx opened 10 years ago
Can you explain a little bit further when is this being presented?
This happened to me also while following http://apionrails.icalialabs.com/ tutorial, any idea why this is happening?
I think is something related to simple_form
or the way the explorer is being accesed.
Are you running the application to explore on another server?
I am having this issue also. I'm running Ubuntu Linux. At first I was getting: Errno::ECONNREFUSED in SabisuRails::ExplorerController#index Connection refused - connect(2) for "api.marketplaceapi.dev" port 80
Went to terminal and entered: prax start Now I'm getting: EOFError in SabisuRails::ExplorerController#index end of file reached
Any help if possible?
same issue here , I'm using
rails s -b 0.0.0.0 -p 8080
with vagrant (forwarded port 8080 => 3000 )
rails -v
Rails 4.2.3
ruby -v
ruby 2.2.1p85 (2015-02-26 revision 49769) [i686-linux]
Are you running the instance on a multithread server? something like Puma or Unicorn?
nope, i'm following rails api book( great book btw ) , but running the default server (webrick I guess ). That's the only thing that didn't work.
Are you using pow? or prax?
I also have same problem I use pow. and mac os may be,I think the problem is localhost port is 3000, but default port 80.
env ruby : ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin15] Rails 4.2.4
img https://gyazo.com/8aca0a31573006d989cfc946687f7808
Errno::ECONNREFUSED in SabisuRails::ExplorerController#index Connection refused - connect(2) for nil port 80
Extracted source (around line #879): D "opening connection to #{conn_address}:#{conn_port}..." s = Timeout.timeout(@open_timeout, Net::OpenTimeout) { TCPSocket.open(conn_address, conn_port, @local_host, @local_port) } s.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) D "opened"
Application Trace | Framework Trace | Full Trace
/Users/y_kim/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:879:in initialize' /Users/y_kim/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:879:in
open'
/Users/y_kim/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:879:in block in connect' /Users/y_kim/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/timeout.rb:74:in
timeout'
/Users/y_kim/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:878:in connect' /Users/y_kim/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:863:in
do_start'
/Users/y_kim/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:852:in start' /Users/y_kim/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:1375:in
request'
httparty (0.13.7) lib/httparty/request.rb:117:in perform' httparty (0.13.7) lib/httparty.rb:545:in
perform_request'
httparty (0.13.7) lib/httparty.rb:476:in get' /Users/y_kim/.rvm/gems/ruby-2.2.1/bundler/gems/sabisu-rails-af7499e87912/lib/sabisu_rails/request.rb:17:in
response'
/Users/y_kim/.rvm/gems/ruby-2.2.1/bundler/gems/sabisu-rails-af7499e87912/app/controllers/sabisu_rails/explorer_controller.rb:7:in index' actionpack (4.2.4) lib/action_controller/metal/implicit_render.rb:4:in
send_action'
actionpack (4.2.4) lib/abstract_controller/base.rb:198:in `process_action'
Are you using a multithread server like puma or unicorn?
I have linux, recently solved the same problem running
prax start prior to: rails s
@ppeusco 's solution should work, make sure you have a multithread server...
Having the same issue. It does not actually matter whether I use webrick or puma. As @yongwoonKim mentioned the issue is that Sabisu expects app to run on port 80 when it runs on 3000.
Setup: webrick || puma prax linux
The issue is that a port is not picked up by HTTParty and it starts using the default one which is 80.
new_uri = path.relative? ? options[:uri_adapter].parse("#{base_uri}#{path}") : path.clone
since base_uri is passed as is and path is /users/ (a default resource) we get the error above. I have not found the fix/reasons for the issue so far
an exact place in httparty (httparty/connection_adapter.rb)
port = uri.port || (uri.scheme == 'https' ? 443 : 80)
even if I specify the port in api_base_uri and the right URI is built, net/http.rb cannot establish connection to http://api.marketplace.dev:3000/users/
@yongwoonKim, are you sure you have specified api_base_uri in sabisu_rails.rb config file? My exception looks differently than yours. (yours shows 'nil' instead of host)
Connection refused - connect(2) for "api.marketplaceapi.dev" port 80
@yongwoonKim did you made it work?
@kurenn yeap, I did it!
I'll close this then!
@kurenn The issue is still valid for me =(
@tamatsyk what is going on?, sorry about that, I'll reopen!
@kurenn
Same issue here. Hanging on "http://localhost:3000/sabisu_rails/explorer", then a Net::ReadTimeout in SabisuRails::ExplorerController#index
Following tutorial at http://apionrails.icalialabs.com/ exactly. Made sure the base_uri_path is set and all configurations set.
After the timeout error stack, there are two instances of
Started GET "/api/users/" for 127.0.0.1 at 2016-02-19 15:09:53 -0500
ActionController::RoutingError (No route matches [GET] "/api/users"):
actionpack (4.2.5.1) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
web-console (2.3.0) lib/web_console/middleware.rb:28:in `block in call'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `catch'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `call'
actionpack (4.2.5.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.5.1) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.5.1) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.5.1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.5.1) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.5.1) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.5.1) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.5.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.5.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
actionpack (4.2.5.1) lib/action_dispatch/middleware/static.rb:116:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
railties (4.2.5.1) lib/rails/engine.rb:518:in `call'
railties (4.2.5.1) lib/rails/application.rb:165:in `call'
rack (1.6.4) lib/rack/urlmap.rb:66:in `block in call'
rack (1.6.4) lib/rack/urlmap.rb:50:in `each'
rack (1.6.4) lib/rack/urlmap.rb:50:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
rack (1.6.4) lib/rack/content_length.rb:15:in `call'
rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
/home/casi/.rbenv/versions/2.2.3/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/home/casi/.rbenv/versions/2.2.3/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/home/casi/.rbenv/versions/2.2.3/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
Tested with both prax and WEBRick, same errors.
Try using puma or unicorn, or run two different instances of the rails app, one running on the 3000
port and other one on 5000
then you can just run one of them to display sabisu.
Let me know how it goes!
Full trace:
/usr/local/rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/net/protocol.rb:153:in
read_nonblock' /usr/local/rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/net/protocol.rb:153:in
rbuf_fill' /usr/local/rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/net/protocol.rb:134:inreaduntil' /usr/local/rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/net/protocol.rb:144:in
readline' /usr/local/rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/net/http/response.rb:39:inread_status_line' /usr/local/rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/net/http/response.rb:28:in
read_new' /usr/local/rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/net/http.rb:1406:inblock in transport_request' /usr/local/rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/net/http.rb:1403:in
catch' /usr/local/rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/net/http.rb:1403:intransport_request' /usr/local/rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/net/http.rb:1376:in
request' /usr/local/rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/net/http.rb:1369:inblock in request' /usr/local/rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/net/http.rb:852:in
start' /usr/local/rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/net/http.rb:1367:inrequest' httparty (0.13.1) lib/httparty/request.rb:93:in
perform' httparty (0.13.1) lib/httparty.rb:521:inperform_request' httparty (0.13.1) lib/httparty.rb:457:in
get' /usr/local/rvm/gems/ruby-2.0.0-p481@market_place_api/bundler/gems/sabisu-rails-de6340971e70/lib/sabisu_rails/request.rb:17:inresponse' /usr/local/rvm/gems/ruby-2.0.0-p481@market_place_api/bundler/gems/sabisu-rails-de6340971e70/app/controllers/sabisu_rails/explorer_controller.rb:7:in
index' actionpack (4.1.4) lib/action_controller/metal/implicit_render.rb:4:insend_action' actionpack (4.1.4) lib/abstract_controller/base.rb:189:in
process_action' actionpack (4.1.4) lib/action_controller/metal/rendering.rb:10:inprocess_action' actionpack (4.1.4) lib/abstract_controller/callbacks.rb:20:in
block in process_action' activesupport (4.1.4) lib/active_support/callbacks.rb:113:incall' activesupport (4.1.4) lib/active_support/callbacks.rb:113:in
call' activesupport (4.1.4) lib/active_support/callbacks.rb:166:inblock in halting' activesupport (4.1.4) lib/active_support/callbacks.rb:229:in
call' activesupport (4.1.4) lib/active_support/callbacks.rb:229:inblock in halting' activesupport (4.1.4) lib/active_support/callbacks.rb:166:in
call' activesupport (4.1.4) lib/active_support/callbacks.rb:166:inblock in halting' activesupport (4.1.4) lib/active_support/callbacks.rb:86:in
call' activesupport (4.1.4) lib/active_support/callbacks.rb:86:inrun_callbacks' actionpack (4.1.4) lib/abstract_controller/callbacks.rb:19:in
process_action' actionpack (4.1.4) lib/action_controller/metal/rescue.rb:29:inprocess_action' actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:31:in
block in process_action' activesupport (4.1.4) lib/active_support/notifications.rb:159:inblock in instrument' activesupport (4.1.4) lib/active_support/notifications/instrumenter.rb:20:in
instrument' activesupport (4.1.4) lib/active_support/notifications.rb:159:ininstrument' actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:30:in
process_action' actionpack (4.1.4) lib/action_controller/metal/params_wrapper.rb:250:inprocess_action' activerecord (4.1.4) lib/active_record/railties/controller_runtime.rb:18:in
process_action' actionpack (4.1.4) lib/abstract_controller/base.rb:136:inprocess' actionview (4.1.4) lib/action_view/rendering.rb:30:in
process' actionpack (4.1.4) lib/action_controller/metal.rb:196:indispatch' actionpack (4.1.4) lib/action_controller/metal/rack_delegation.rb:13:in
dispatch' actionpack (4.1.4) lib/action_controller/metal.rb:232:inblock in action' actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:82:in
call' actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:82:indispatch' actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:50:in
call' actionpack (4.1.4) lib/action_dispatch/journey/router.rb:71:inblock in call' actionpack (4.1.4) lib/action_dispatch/journey/router.rb:59:in
each' actionpack (4.1.4) lib/action_dispatch/journey/router.rb:59:incall' actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:678:in
call' railties (4.1.4) lib/rails/engine.rb:514:incall' railties (4.1.4) lib/rails/railtie.rb:194:in
public_send' railties (4.1.4) lib/rails/railtie.rb:194:inmethod_missing' actionpack (4.1.4) lib/action_dispatch/journey/router.rb:71:in
block in call' actionpack (4.1.4) lib/action_dispatch/journey/router.rb:59:ineach' actionpack (4.1.4) lib/action_dispatch/journey/router.rb:59:in
call' actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:678:incall' warden (1.2.3) lib/warden/manager.rb:35:in
block in call' warden (1.2.3) lib/warden/manager.rb:34:incatch' warden (1.2.3) lib/warden/manager.rb:34:in
call' rack (1.5.2) lib/rack/etag.rb:23:incall' rack (1.5.2) lib/rack/conditionalget.rb:25:in
call' rack (1.5.2) lib/rack/head.rb:11:incall' actionpack (4.1.4) lib/action_dispatch/middleware/params_parser.rb:27:in
call' actionpack (4.1.4) lib/action_dispatch/middleware/flash.rb:254:incall' rack (1.5.2) lib/rack/session/abstract/id.rb:225:in
context' rack (1.5.2) lib/rack/session/abstract/id.rb:220:incall' actionpack (4.1.4) lib/action_dispatch/middleware/cookies.rb:560:in
call' activerecord (4.1.4) lib/active_record/query_cache.rb:36:incall' activerecord (4.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in
call' activerecord (4.1.4) lib/active_record/migration.rb:380:incall' actionpack (4.1.4) lib/action_dispatch/middleware/callbacks.rb:29:in
block in call' activesupport (4.1.4) lib/active_support/callbacks.rb:82:inrun_callbacks' actionpack (4.1.4) lib/action_dispatch/middleware/callbacks.rb:27:in
call' actionpack (4.1.4) lib/action_dispatch/middleware/reloader.rb:73:incall' actionpack (4.1.4) lib/action_dispatch/middleware/remote_ip.rb:76:in
call' actionpack (4.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:incall' actionpack (4.1.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in
call' railties (4.1.4) lib/rails/rack/logger.rb:38:incall_app' railties (4.1.4) lib/rails/rack/logger.rb:20:in
block in call' activesupport (4.1.4) lib/active_support/tagged_logging.rb:68:inblock in tagged' activesupport (4.1.4) lib/active_support/tagged_logging.rb:26:in
tagged' activesupport (4.1.4) lib/active_support/tagged_logging.rb:68:intagged' railties (4.1.4) lib/rails/rack/logger.rb:20:in
call' actionpack (4.1.4) lib/action_dispatch/middleware/request_id.rb:21:incall' rack (1.5.2) lib/rack/methodoverride.rb:21:in
call' rack (1.5.2) lib/rack/runtime.rb:17:incall' activesupport (4.1.4) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in
call' rack (1.5.2) lib/rack/lock.rb:17:incall' actionpack (4.1.4) lib/action_dispatch/middleware/static.rb:64:in
call' rack (1.5.2) lib/rack/sendfile.rb:112:incall' railties (4.1.4) lib/rails/engine.rb:514:in
call' railties (4.1.4) lib/rails/application.rb:144:incall' rack (1.5.2) lib/rack/lock.rb:17:in
call' rack (1.5.2) lib/rack/content_length.rb:14:incall' rack (1.5.2) lib/rack/handler/webrick.rb:60:in
service' /usr/local/rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/webrick/httpserver.rb:138:inservice' /usr/local/rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/webrick/httpserver.rb:94:in
run' /usr/local/rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'