corincerami / mars-photo-api

A Rails API for photo data from NASA's Mars Rovers
https://api.nasa.gov/#MarsPhotos
GNU General Public License v3.0
347 stars 46 forks source link

Application Error #73

Closed frankiescott closed 6 years ago

frankiescott commented 6 years ago

the api was working fine this morning. now I'm getting 503 and this error in the browser:

An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.

corincerami commented 6 years ago

It seems the application started crashing after the most recent deploy, which was some time yesterday. I'll have to investigate with Heroku what the issue is, as that deploy contained no code changes.

corincerami commented 6 years ago

Here's the error from the logs on Heroku:

Jan 16 07:41:04 mars-photos app/web.1:  [4] ! Unable to load application: Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add `gem 'pg'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). 
Jan 16 07:41:04 mars-photos app/web.1:  bundler: failed to load command: puma (/app/vendor/bundle/ruby/2.4.0/bin/puma) 
Jan 16 07:41:04 mars-photos app/web.1:  Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add `gem 'pg'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/connection_specification.rb:188:in `rescue in spec' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/connection_specification.rb:185:in `spec' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:880:in `establish_connection' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_handling.rb:58:in `establish_connection' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/railtie.rb:124:in `block (2 levels) in <class:Railtie>' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:69:in `instance_eval' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:60:in `with_execution_control' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:65:in `execute_hook' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:50:in `block in run_load_hooks' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:49:in `each' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:49:in `run_load_hooks' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/base.rb:326:in `<module:ActiveRecord>' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/base.rb:25:in `<top (required)>' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/app/models/camera.rb:1:in `<top (required)>' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:379:in `block in require_or_load' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:36:in `block in load_interlock' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:12:in `block in loading' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/concurrency/share_lock.rb:149:in `exclusive' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:11:in `loading' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:36:in `load_interlock' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:357:in `require_or_load' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:335:in `depend_on' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:251:in `require_dependency' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:476:in `block (2 levels) in eager_load!' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:475:in `each' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:475:in `block in eager_load!' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:473:in `each' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:473:in `eager_load!' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:354:in `eager_load!' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/application/finisher.rb:67:in `each' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/application/finisher.rb:67:in `block in <module:Finisher>' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `instance_exec' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `run' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:59:in `block in run_initializers' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/ruby-2.4.2/lib/ruby/2.4.0/tsort.rb:228:in `block in tsort_each' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/ruby-2.4.2/lib/ruby/2.4.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/ruby-2.4.2/lib/ruby/2.4.0/tsort.rb:431:in `each_strongly_connected_component_from' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/ruby-2.4.2/lib/ruby/2.4.0/tsort.rb:349:in `block in each_strongly_connected_component' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/ruby-2.4.2/lib/ruby/2.4.0/tsort.rb:347:in `each' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/ruby-2.4.2/lib/ruby/2.4.0/tsort.rb:347:in `call' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/ruby-2.4.2/lib/ruby/2.4.0/tsort.rb:347:in `each_strongly_connected_component' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/ruby-2.4.2/lib/ruby/2.4.0/tsort.rb:226:in `tsort_each' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/ruby-2.4.2/lib/ruby/2.4.0/tsort.rb:205:in `tsort_each' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:58:in `run_initializers' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/application.rb:353:in `initialize!' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/config/environment.rb:5:in `<top (required)>' 
Jan 16 07:41:04 mars-photos app/web.1:    config.ru:3:in `require' 
Jan 16 07:41:04 mars-photos app/web.1:    config.ru:3:in `block in <main>' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/builder.rb:55:in `instance_eval' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/builder.rb:55:in `initialize' 
Jan 16 07:41:04 mars-photos app/web.1:    config.ru:in `new' 
Jan 16 07:41:04 mars-photos app/web.1:    config.ru:in `<main>' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/builder.rb:49:in `eval' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/builder.rb:49:in `new_from_string' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/builder.rb:40:in `parse_file' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/puma-3.11.0/lib/puma/configuration.rb:318:in `load_rackup' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/puma-3.11.0/lib/puma/configuration.rb:243:in `app' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/puma-3.11.0/lib/puma/runner.rb:138:in `load_and_bind' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/puma-3.11.0/lib/puma/cluster.rb:397:in `run' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/puma-3.11.0/lib/puma/launcher.rb:183:in `run' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/puma-3.11.0/lib/puma/cli.rb:77:in `run' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/gems/puma-3.11.0/bin/puma:10:in `<top (required)>' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/bin/puma:23:in `load' 
Jan 16 07:41:04 mars-photos app/web.1:    /app/vendor/bundle/ruby/2.4.0/bin/puma:23:in `<top (required)>' 
Jan 16 07:41:04 mars-photos heroku/web.1:  Process exited with status 1 
Jan 16 07:41:04 mars-photos heroku/web.1:  State changed from starting to crashed 

So apparently pg isn't being loaded from the Gemfile, which is strange. Still looking into it.

corincerami commented 6 years ago

Ok the API should be back up now. Apologies for the downtime. Looks like the problem was that a new version of pg (1.0) was released between the previous deploy and the one last night. Looks like pg 1.0 is incompatible with the version of postgresql being used on Heroku, so I've locked the pg version of the API to ~> 0.21.

frankiescott commented 6 years ago

thanks a lot @chrisccerami !