jdc987
jdc987

Reputation: 743

Why does my Heroku app give me an application error when trying to open it? Error with mongoid.yml file?

I am using locomotive CMS and have created an app with their engine and have followed all the steps to upload it to Heroku. However, when I try to open the app using my URL, I get an application error that says that "An error occurred in the application and your page could not be served. Please try again in a few moments." Below is the log details. Can someone tell me what is going wrong?

2014-02-22T18:27:10.019069+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.6/lib/mongoid.rb:165:in `load!'
    2014-02-22T18:27:10.019069+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.6/lib/mongoid/config/environment.rb:40:in `load_yaml'
    2014-02-22T18:27:10.019069+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/initializable.rb:30:in `run'
    2014-02-22T18:27:10.019321+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/initializable.rb:55:in `block in run_initializers'
    2014-02-22T18:27:10.019321+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/initializable.rb:54:in `each'
    2014-02-22T18:27:10.019069+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/initializable.rb:30:in `instance_exec'
    2014-02-22T18:27:10.019321+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/initializable.rb:54:in `run_initializers'
    2014-02-22T18:27:10.019321+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/railtie/configurable.rb:30:in `method_missing'
    2014-02-22T18:27:10.019321+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
    2014-02-22T18:27:10.019321+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
    2014-02-22T18:27:10.019321+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/application.rb:136:in `initialize!'
    2014-02-22T18:27:10.019321+00:00 app[web.1]:    from /app/config/environment.rb:5:in `<top (required)>'
    2014-02-22T18:27:10.019321+00:00 app[web.1]:    from config.ru:3:in `require'
    2014-02-22T18:27:10.019502+00:00 app[web.1]:    from config.ru:1:in `new'
    2014-02-22T18:27:10.019502+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/lib/rack/adapter/loader.rb:33:in `load'
    2014-02-22T18:27:10.019502+00:00 app[web.1]:    from config.ru:1:in `<main>'
    2014-02-22T18:27:10.019321+00:00 app[web.1]:    from config.ru:3:in `block in <main>'
    2014-02-22T18:27:10.019502+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/lib/rack/adapter/loader.rb:33:in `eval'
    2014-02-22T18:27:10.019502+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/lib/thin/controllers/controller.rb:182:in `load_rackup_config'
    2014-02-22T18:27:10.019502+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/lib/thin/controllers/controller.rb:72:in `start'
    2014-02-22T18:27:10.019502+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/lib/thin/runner.rb:200:in `run_command'
    2014-02-22T18:27:10.019502+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/lib/thin/runner.rb:156:in `run!'
    2014-02-22T18:27:10.019502+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/bin/thin:6:in `<top (required)>'
    2014-02-22T18:27:10.019502+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `load'
    2014-02-22T18:27:09.945557+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `<main>'
    2014-02-22T18:27:10.020070+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `<main>'
    2014-02-22T18:27:11.123783+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
    2014-02-22T18:27:11.123783+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
    2014-02-22T18:27:11.331326+00:00 heroku[web.1]: Process exited with status 1
    2014-02-22T18:27:11.350265+00:00 heroku[web.1]: Process exited with status 1
    2014-02-22T18:27:12.266238+00:00 app[web.1]: /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/psych.rb:203:in `parse': (<unknown>): did not find expected key while parsing a block mapping at line 22 column 7 (Psych::SyntaxError)
    2014-02-22T18:27:12.266238+00:00 app[web.1]:    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
    2014-02-22T18:27:12.266238+00:00 app[web.1]:    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/psych.rb:127:in `load'
    2014-02-22T18:27:12.266238+00:00 app[web.1]:    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/psych.rb:151:in `parse'
    2014-02-22T18:27:12.266238+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.6/lib/mongoid/config/environment.rb:40:in `load_yaml'
    2014-02-22T18:27:12.266238+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.6/lib/mongoid/config.rb:89:in `load!'
    2014-02-22T18:27:12.266238+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.6/lib/mongoid.rb:165:in `load!'
    2014-02-22T18:27:12.266588+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/railtie/configurable.rb:30:in `method_missing'
    2014-02-22T18:27:12.266588+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/initializable.rb:55:in `block in run_initializers'
    2014-02-22T18:27:12.266238+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/initializable.rb:30:in `run'
    2014-02-22T18:27:12.266238+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/initializable.rb:30:in `instance_exec'
    2014-02-22T18:27:12.266238+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.6/lib/mongoid/railtie.rb:67:in `block in <class:Railtie>'
    2014-02-22T18:27:12.266588+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/application.rb:136:in `initialize!'
    2014-02-22T18:27:12.266588+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/initializable.rb:54:in `each'
    2014-02-22T18:27:12.266588+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/initializable.rb:54:in `run_initializers'
    2014-02-22T18:27:12.266588+00:00 app[web.1]:    from config.ru:3:in `block in <main>'
    2014-02-22T18:27:12.266588+00:00 app[web.1]:    from config.ru:3:in `require'
    2014-02-22T18:27:12.266588+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
    2014-02-22T18:27:12.266588+00:00 app[web.1]:    from /app/config/environment.rb:5:in `<top (required)>'
    2014-02-22T18:27:12.266869+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/lib/rack/adapter/loader.rb:33:in `load'
    2014-02-22T18:27:12.266588+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
    2014-02-22T18:27:12.266869+00:00 app[web.1]:    from config.ru:1:in `new'
    2014-02-22T18:27:12.266869+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/lib/thin/controllers/controller.rb:182:in `load_rackup_config'
    2014-02-22T18:27:12.266869+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/lib/thin/controllers/controller.rb:72:in `start'
    2014-02-22T18:27:12.266869+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/lib/rack/adapter/loader.rb:33:in `eval'
    2014-02-22T18:27:12.266869+00:00 app[web.1]:    from config.ru:1:in `<main>'
    2014-02-22T18:27:12.266869+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/lib/thin/runner.rb:156:in `run!'
    2014-02-22T18:27:12.266869+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/lib/thin/runner.rb:200:in `run_command'
    2014-02-22T18:27:12.266869+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `load'
    2014-02-22T18:27:12.266869+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/bin/thin:6:in `<top (required)>'
    2014-02-22T18:27:12.267626+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `<main>'
    2014-02-22T18:27:13.659542+00:00 heroku[web.1]: State changed from starting to crashed
    2014-02-22T18:27:13.659542+00:00 heroku[web.1]: State changed from crashed to starting
    2014-02-22T18:27:13.641921+00:00 heroku[web.1]: Process exited with status 1
    2014-02-22T18:27:21.169905+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -R config.ru -e production -p 38322`
    2014-02-22T18:27:47.282641+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
    2014-02-22T18:27:47.284111+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
    2014-02-22T18:27:49.769965+00:00 app[web.1]:    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
    2014-02-22T18:27:49.769965+00:00 app[web.1]:    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/psych.rb:151:in `parse'
    2014-02-22T18:27:49.769965+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.6/lib/mongoid/config.rb:89:in `load!'
    2014-02-22T18:27:49.769965+00:00 app[web.1]: /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/psych.rb:203:in `parse': (<unknown>): did not find expected key while parsing a block mapping at line 22 column 7 (Psych::SyntaxError)
    2014-02-22T18:27:49.770232+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/initializable.rb:55:in `block in run_initializers'
    2014-02-22T18:27:49.769965+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.6/lib/mongoid/config/environment.rb:40:in `load_yaml'
    2014-02-22T18:27:49.769965+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.6/lib/mongoid/railtie.rb:67:in `block in <class:Railtie>'
    2014-02-22T18:27:49.769965+00:00 app[web.1]:    from /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/psych.rb:127:in `load'
    2014-02-22T18:27:49.769965+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-3.1.6/lib/mongoid.rb:165:in `load!'
    2014-02-22T18:27:49.769965+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/initializable.rb:30:in `run'
    2014-02-22T18:27:49.770232+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/initializable.rb:54:in `run_initializers'
    2014-02-22T18:27:49.769965+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/initializable.rb:30:in `instance_exec'
    2014-02-22T18:27:49.770232+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/initializable.rb:54:in `each'
    2014-02-22T18:27:49.770232+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/railtie/configurable.rb:30:in `method_missing'
    2014-02-22T18:27:49.770232+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.16/lib/rails/application.rb:136:in `initialize!'
    2014-02-22T18:27:49.770232+00:00 app[web.1]:    from config.ru:3:in `block in <main>'
    2014-02-22T18:27:49.770232+00:00 app[web.1]:    from /app/config/environment.rb:5:in `<top (required)>'
    2014-02-22T18:27:49.770232+00:00 app[web.1]:    from config.ru:3:in `require'
    2014-02-22T18:27:49.770412+00:00 app[web.1]:    from config.ru:1:in `new'
    2014-02-22T18:27:49.770412+00:00 app[web.1]:    from config.ru:1:in `<main>'
    2014-02-22T18:27:49.770232+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
    2014-02-22T18:27:49.770412+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/lib/rack/adapter/loader.rb:33:in `eval'
    2014-02-22T18:27:49.770232+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
    2014-02-22T18:27:49.770412+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/bin/thin:6:in `<top (required)>'
    2014-02-22T18:27:49.770412+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/lib/rack/adapter/loader.rb:33:in `load'
    2014-02-22T18:27:49.770412+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `load'
    2014-02-22T18:27:49.770412+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `<main>'
    2014-02-22T18:27:49.770412+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/lib/thin/controllers/controller.rb:182:in `load_rackup_config'
    2014-02-22T18:27:49.770412+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/lib/thin/controllers/controller.rb:72:in `start'
    2014-02-22T18:27:49.770412+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/lib/thin/runner.rb:200:in `run_command'
    2014-02-22T18:27:49.770412+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.6.1/lib/thin/runner.rb:156:in `run!'
    2014-02-22T18:27:51.265166+00:00 heroku[web.1]: Process exited with status 1
    2014-02-22T18:27:51.276294+00:00 heroku[web.1]: State changed from starting to crashed
    2014-02-22T18:27:53.791976+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=danacamilleapp.herokuapp.com request_id=13abf837-1e73-468e-8d33-011ed163f1e3 fwd="72.89.235.136" dyno= connect= service= status=503 bytes=

This is my mongoid.yml file:

development:
  sessions:
    default:
      database: locomotive_dev
      hosts:
        - localhost:27017
  options:
    identity_map_enabled: true

test:
  sessions:
    default:
      database: locomotive_test
      hosts:
        - localhost:27017
  options:
    identity_map_enabled: true

production:
  sessions:
    default:
      database: locomotive_production
      # heroku
       uri: <%= ENV['MONGOHQ_URL'] %>
      hosts:
        - localhost:27017
  options:
    identity_map_enabled: true

Upvotes: 0

Views: 498

Answers (1)

bridiver
bridiver

Reputation: 1714

You have an extra space before uri which causes your yaml to be invalid. You can check it at http://yamllint.com

Upvotes: 3

Related Questions