API fails after time. ArgumentError (A copy of API::APIGuard::HelperMethods has been removed from the module tree but is still active!)
After leaving my server/command line open for a while then trying to query the API for users and projects I get a 500
error.
Here is the full stack trace:
Started GET "/api/v3/user" for 127.0.0.1 at 2016-06-07 22:53:53 -0400
Started GET "/api/v3/projects" for 127.0.0.1 at 2016-06-07 22:53:53 -0400
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."authentication_token" = $1 ORDER BY "users"."id" DESC LIMIT 1 [["authentication_token", ""]]
User Load (0.7ms) SELECT "users".* FROM "users" WHERE "users"."authentication_token" = $1 ORDER BY "users"."id" DESC LIMIT 1 [["authentication_token", ""]]
Doorkeeper::AccessToken Load (0.3ms) SELECT "oauth_access_tokens".* FROM "oauth_access_tokens" WHERE "oauth_access_tokens"."token" = $1 LIMIT 1 [["token", "somefancytokeniwontpasteherebutialreadydidsoihopeitisntsavedsomewhere"]]
ArgumentError (A copy of API::APIGuard::HelperMethods has been removed from the module tree but is still active!):
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:479:in `load_missing_constant'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:184:in `const_missing'
/Users/jacobschatz/projects/gitlab-development-kit/gitlab/lib/api/api_guard.rb:94:in `validate_access_token'
/Users/jacobschatz/projects/gitlab-development-kit/gitlab/lib/api/api_guard.rb:63:in `doorkeeper_guard'
/Users/jacobschatz/projects/gitlab-development-kit/gitlab/lib/api/helpers.rb:14:in `current_user'
/Users/jacobschatz/projects/gitlab-development-kit/gitlab/lib/api/helpers.rb:116:in `authenticate!'
/Users/jacobschatz/projects/gitlab-development-kit/gitlab/lib/api/projects.rb:4:in `block in <class:Projects>'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/endpoint.rb:319:in `instance_eval'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/endpoint.rb:319:in `block (2 levels) in run_filters'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/endpoint.rb:318:in `each'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/endpoint.rb:318:in `block in run_filters'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/activesupport-4.2.6/lib/active_support/notifications.rb:166:in `instrument'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/endpoint.rb:317:in `run_filters'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/endpoint.rb:231:in `block in run'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/activesupport-4.2.6/lib/active_support/notifications.rb:166:in `instrument'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/endpoint.rb:219:in `run'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/endpoint.rb:201:in `block in call!'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/middleware/base.rb:24:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/middleware/base.rb:24:in `call!'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/middleware/base.rb:18:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/middleware/base.rb:24:in `call!'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/middleware/base.rb:18:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-oauth2-1.2.1/lib/rack/oauth2/server/resource.rb:20:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-oauth2-1.2.1/lib/rack/oauth2/server/resource/bearer.rb:8:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/middleware/error.rb:27:in `block in call!'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/middleware/error.rb:26:in `catch'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/middleware/error.rb:26:in `call!'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/middleware/base.rb:18:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-1.6.4/lib/rack/builder.rb:153:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/endpoint.rb:202:in `call!'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/endpoint.rb:190:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:152:in `block in call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:96:in `block in recognize'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:68:in `optimized_each'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:95:in `recognize'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:141:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/api.rb:114:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/api.rb:44:in `call!'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/grape-0.13.0/lib/grape/api.rb:39:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/actionpack-4.2.6/lib/action_dispatch/routing/mapper.rb:51:in `serve'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/actionpack-4.2.6/lib/action_dispatch/journey/router.rb:43:in `block in serve'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/actionpack-4.2.6/lib/action_dispatch/journey/router.rb:30:in `each'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/actionpack-4.2.6/lib/action_dispatch/journey/router.rb:30:in `serve'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/actionpack-4.2.6/lib/action_dispatch/routing/route_set.rb:817:in `call'
/Users/jacobschatz/projects/gitlab-development-kit/gitlab/lib/gitlab/middleware/go.rb:16:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-cors-0.4.0/lib/rack/cors.rb:80:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-attack-4.3.1/lib/rack/attack.rb:106:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/warden-1.2.6/lib/warden/manager.rb:35:in `block in call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/warden-1.2.6/lib/warden/manager.rb:34:in `catch'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/warden-1.2.6/lib/warden/manager.rb:34:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-1.6.4/lib/rack/etag.rb:24:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-1.6.4/lib/rack/conditionalget.rb:25:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/actionpack-4.2.6/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/actionpack-4.2.6/lib/action_dispatch/middleware/flash.rb:260:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:225:in `context'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:220:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/actionpack-4.2.6/lib/action_dispatch/middleware/cookies.rb:560:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/activerecord-4.2.6/lib/active_record/query_cache.rb:36:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/activerecord-4.2.6/lib/active_record/migration.rb:377:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/actionpack-4.2.6/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/actionpack-4.2.6/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/actionpack-4.2.6/lib/action_dispatch/middleware/reloader.rb:73:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/actionpack-4.2.6/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/better_errors-1.0.1/lib/better_errors/middleware.rb:84:in `protected_app_call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/better_errors-1.0.1/lib/better_errors/middleware.rb:79:in `better_errors_call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/better_errors-1.0.1/lib/better_errors/middleware.rb:56:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/actionpack-4.2.6/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/web-console-2.3.0/lib/web_console/middleware.rb:28:in `block in call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/web-console-2.3.0/lib/web_console/middleware.rb:18:in `catch'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/web-console-2.3.0/lib/web_console/middleware.rb:18:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/actionpack-4.2.6/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/railties-4.2.6/lib/rails/rack/logger.rb:38:in `call_app'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/railties-4.2.6/lib/rails/rack/logger.rb:20:in `block in call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/activesupport-4.2.6/lib/active_support/tagged_logging.rb:68:in `block in tagged'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/activesupport-4.2.6/lib/active_support/tagged_logging.rb:26:in `tagged'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/activesupport-4.2.6/lib/active_support/tagged_logging.rb:68:in `tagged'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/railties-4.2.6/lib/rails/rack/logger.rb:20:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/quiet_assets-1.0.3/lib/quiet_assets.rb:23:in `call_with_quiet_assets'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/request_store-1.3.0/lib/request_store/middleware.rb:9:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/actionpack-4.2.6/lib/action_dispatch/middleware/request_id.rb:21:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-1.6.4/lib/rack/methodoverride.rb:22:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-1.6.4/lib/rack/runtime.rb:18:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-1.6.4/lib/rack/lock.rb:17:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/actionpack-4.2.6/lib/action_dispatch/middleware/static.rb:120:in `call'
/Users/jacobschatz/projects/gitlab-development-kit/gitlab/lib/gitlab/middleware/static.rb:9:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-1.6.4/lib/rack/sendfile.rb:113:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/sentry-raven-0.15.6/lib/raven/integrations/rack.rb:53:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/railties-4.2.6/lib/rails/engine.rb:518:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/railties-4.2.6/lib/rails/application.rb:165:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/railties-4.2.6/lib/rails/railtie.rb:194:in `public_send'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/railties-4.2.6/lib/rails/railtie.rb:194:in `method_missing'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-1.6.4/lib/rack/urlmap.rb:66:in `block in call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-1.6.4/lib/rack/urlmap.rb:50:in `each'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/rack-1.6.4/lib/rack/urlmap.rb:50:in `call'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:580:in `process_client'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:674:in `worker_loop'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:529:in `spawn_missing_workers'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:140:in `start'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/gems/unicorn-4.9.0/bin/unicorn_rails:209:in `<top (required)>'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/bin/unicorn_rails:23:in `load'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/bin/unicorn_rails:23:in `<main>'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/bin/ruby_executable_hooks:15:in `eval'
/Users/jacobschatz/.rvm/gems/ruby-2.1.6/bin/ruby_executable_hooks:15:in `<main>'
Doorkeeper::AccessToken Load (0.3ms) SELECT "oauth_access_tokens".* FROM "oauth_access_tokens" WHERE "oauth_access_tokens"."token" = $1 LIMIT 1 [["token", "somefancytokeniwontpasteherebutialreadydidsoihopeitisntsavedsomewhere"]]
If I leave my localhost running for at least 1 hour unattended this happens (I think). Restarting fixes it.