JoshCheek / miniature-octo-ironman

It's small. It had 8 legs. It sells weapons of mass comprehension to the most eager learner!
4 stars 4 forks source link

It blows up on the server when you submit an endpoint #46

Closed JoshCheek closed 9 years ago

JoshCheek commented 9 years ago

Idk why, doesn't happen locally :/ Unfortunately, I have to go now, my folks are showing up and I haven't showered or cleaned the place.

Here is the output from the log:

TypeError - no implicit conversion of Hash into String:
    /home/miniature-octo-ironman/miniature-octo-ironman/lib/moi/manifest/endpoint.rb:58:in `initialize'
    /home/miniature-octo-ironman/miniature-octo-ironman/lib/moi/manifest/endpoint.rb:58:in `new'
    /home/miniature-octo-ironman/miniature-octo-ironman/lib/moi/manifest/endpoint.rb:58:in `reponame'
    /home/miniature-octo-ironman/miniature-octo-ironman/lib/moi/manifest/endpoint.rb:62:in `generate_localpath'
    /home/miniature-octo-ironman/miniature-octo-ironman/lib/moi/manifest/endpoint.rb:26:in `localpath'
    /home/miniature-octo-ironman/miniature-octo-ironman/lib/moi/manifest/endpoint.rb:50:in `to_hash'
    /home/miniature-octo-ironman/miniature-octo-ironman/lib/moi/manifest.rb:24:in `each'
    /home/miniature-octo-ironman/miniature-octo-ironman/lib/moi/manifest.rb:24:in `each'
    /home/miniature-octo-ironman/miniature-octo-ironman/lib/moi/manifest/persist_to_json.rb:11:in `map'
    /home/miniature-octo-ironman/miniature-octo-ironman/lib/moi/manifest/persist_to_json.rb:11:in `save'
    /home/miniature-octo-ironman/miniature-octo-ironman/lib/app.rb:71:in `block in <class:MiniatureOctoIronman>'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `call'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `block in compile!'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `[]'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (3 levels) in route!'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:985:in `route_eval'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (2 levels) in route!'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1006:in `block in process_route'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `catch'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `process_route'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:964:in `block in route!'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `each'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `route!'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1076:in `block in dispatch!'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1073:in `dispatch!'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `block in call!'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `call!'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:886:in `call'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/nulllogger.rb:9:in `call'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:180:in `call'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:2014:in `call'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `block in call'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1788:in `synchronize'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `call'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/puma-2.9.0/lib/puma/configuration.rb:71:in `call'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/puma-2.9.0/lib/puma/server.rb:490:in `handle_request'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/puma-2.9.0/lib/puma/server.rb:361:in `process_client'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/puma-2.9.0/lib/puma/server.rb:254:in `block in run'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/puma-2.9.0/lib/puma/thread_pool.rb:92:in `call'
    /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/puma-2.9.0/lib/puma/thread_pool.rb:92:in `block in spawn_thread'
dalexj commented 9 years ago

somehow in app.rb, line 65 repopath: params["endpoint"]["repopath"]

the repopath is being set to a hash, or it could be the JSON loading a previous endpoint's repopath as a hash.

line 58 of endpoint.rb Pathname.new(repopath).basename.sub_ext("")

if I just run Pathname.new({}).basename.sub_ext("") I get the same error no implicit conversion of Hash into String (TypeError)

just a little context, I can look more into this later

tyrbo commented 9 years ago

Is this still broken? I might take a look at it a little later as well.

JoshCheek commented 9 years ago

Yes. Would be awesome if you took a look!

tyrbo commented 9 years ago

Might be able to take a look tonight, but it's been a busy weekend.

JoshCheek commented 9 years ago

I just deployed the most recent changes, and this is fixed now. We were missing injected dependencies from the middleware in the config.prod.ru, so I copy/pasted from config.ru.