Code Monkey home page Code Monkey logo

gaps's People

Contributors

alvinlai avatar antifuchs avatar bfirsh avatar bkrausz avatar davehusen avatar dhusen-stripe avatar gdb avatar holic avatar kevin-stripe avatar paxan avatar richardlitt avatar rlk-stripe avatar shale-stripe avatar shalecraig avatar ukd1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gaps's Issues

No default set for size of 'group' collection thread pool

I've been seeing a fair bit of crashes due to mongo connection timeout.

[1] Finding all groups containing email (page: 0): uri="https://www.googleapis.com/admin/directory/v1/groups?domain=pulse-dev.net&userKey=firmware_analytics%40pulse-dev.net"
/gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/connection/pool.rb:261:in `block in checkout': could not obtain connection within 5.0 seconds. The max pool size is currently 1; consider increasing the pool size or timeout. (Mongo::ConnectionTimeoutError)
    from /gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/connection/pool.rb:259:in `loop'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/connection/pool.rb:259:in `checkout'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/mongo_client.rb:516:in `checkout_reader'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/cursor.rb:620:in `checkout_socket_from_connection'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/cursor.rb:547:in `block in send_initial_query'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/functional/logging.rb:55:in `block in instrument'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/functional/logging.rb:20:in `instrument'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/functional/logging.rb:54:in `instrument'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/cursor.rb:544:in `send_initial_query'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/cursor.rb:529:in `refresh'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/cursor.rb:136:in `next'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/collection.rb:329:in `find_one'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/plucky-0.6.6/lib/plucky/query.rb:85:in `find_one'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/identity_map.rb:129:in `find_one'
    from /gaps/lib/gaps/db/user.rb:32:in `lister'
    from /gaps/lib/gaps/db/group.rb:155:in `memberships'
    from /gaps/lib/gaps/db/group.rb:286:in `block (2 levels) in warm_transitive_closure_cache'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/thread-0.1.4/lib/thread/future.rb:27:in `call'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/thread-0.1.4/lib/thread/future.rb:27:in `block in initialize'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/thread-0.1.4/lib/thread/pool.rb:56:in `call'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/thread-0.1.4/lib/thread/pool.rb:56:in `execute'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/thread-0.1.4/lib/thread/pool.rb:384:in `block (2 levels) in spawn_thread'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/thread-0.1.4/lib/thread/pool.rb:351:in `loop'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/thread-0.1.4/lib/thread/pool.rb:351:in `block in spawn_thread'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `call'
    from /gaps/vendor/bundle/ruby/2.1.0/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context'

Heeding the error message's recommendation to increase the size of the thread pool, I looked into where the defaults are set. Turns out, only the 'cache' collection has a default (set to 10), but not the 'group' collection.

I addressed this in my site.yaml, but it would perhaps make sense to set a better default in `config.yaml'

google-api-client Error

Hey,

I took this for a spin locally, and while running it directly I hit this google server error twice. I know it happened once while I was re-categorizing a list. Any ideas?

/Users/danny/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/google-api-client-0.7.1/lib/google/api_client.rb:620:in `block in execute!': Backend Error (Google::APIClient::ServerError)
    from /Users/danny/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/retriable-1.4.1/lib/retriable/retry.rb:27:in `perform'
    from /Users/danny/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/retriable-1.4.1/lib/retriable.rb:9:in `retriable'
    from /Users/danny/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/google-api-client-0.7.1/lib/google/api_client.rb:595:in `execute!'
    from /Users/danny/gaps/lib/gaps/requestor.rb:160:in `request'
    from /Users/danny/gaps/lib/gaps/requestor.rb:119:in `get_group_settings'
    from /Users/danny/gaps/lib/gaps/db/group.rb:95:in `update_config'
    from /Users/danny/gaps/lib/gaps/db/group.rb:187:in `block (2 levels) in refresh'
    from /Users/danny/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/thread-0.1.4/lib/thread/future.rb:27:in `call'
    from /Users/danny/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/thread-0.1.4/lib/thread/future.rb:27:in `block in initialize'
    from /Users/danny/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/thread-0.1.4/lib/thread/pool.rb:56:in `call'
    from /Users/danny/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/thread-0.1.4/lib/thread/pool.rb:56:in `execute'
    from /Users/danny/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/thread-0.1.4/lib/thread/pool.rb:384:in `block (2 levels) in spawn_thread'
    from /Users/danny/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/thread-0.1.4/lib/thread/pool.rb:351:in `loop'
    from /Users/danny/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/thread-0.1.4/lib/thread/pool.rb:351:in `block in spawn_thread'
    from /Users/danny/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `call'
    from /Users/danny/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context'

Corrupted session state

Steps to Recreate

  1. Be GSuite admin
  2. Create new project here: https://console.developers.google.com/apis/library
  3. On same page, search for and enable Admin SDK, Google+ API and Group Settings API
  4. Configure consent screen here: https://console.developers.google.com/apis/credentials/consent
  5. Create credentials here: https://console.developers.google.com/apis/credentials
  6. Select OAuth Client ID, choose Web Application as application type (take note of ID & secret)
  7. Clone https://github.com/stripe/gaps
  8. Edit docker-compose.yml to look like:
version: '2'
services:
  web:
    build: .
    ports:
      - 3500:3500
    links:
      - mongo
    environment:
      - MONGODB_URL=mongodb://mongo/mongo
      - RACK_ENV=development
      - FAVICON_URL=
      - GAPS_URL=http://localhost:3500
      - ORG_DOMAIN=example.com
      - ORG_NAME=Example
      - OAUTH_CLIENT_ID=<CLIENT ID> # replace
      - OAUTH_CLIENT_SECRET=<CLIENT SECRET> # replace
      - OAUTH_REDIRECT_URL=http://localhost:3500/oauth2callback
      - SESSION_SECRET=123

  mongo:
    image: mongo
  1. Run docker-compose up
  2. Navigate to http://localhost:3500/
  3. Click Sign In
  4. Select GSuite admin user
  5. Click ALLOW
  6. Observe error message:
You seem to have corrupted session state. Try logging in again?

Looks like something went wrong :(
  1. Be sad ๐Ÿ˜ž

Browsers

  • Safari 10.1 (12603.1.30.0.34)
  • Chrome 58.0.3029.110 (64-bit) (macOS)

Missing authorization code after admin token has expired

After a first sign in to Gaps with the domain's admin account and a successful fetch of the associated groups, the app crashes with the following stacktrace:

/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/signet-0.5.1/lib/signet/oauth_2/client.rb:906:in `generate_access_token_request': Missing authorization code. (ArgumentError)
    from /.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/signet-0.5.1/lib/signet/oauth_2/client.rb:930:in `fetch_access_token'
    from /.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/signet-0.5.1/lib/signet/oauth_2/client.rb:956:in `fetch_access_token!'
    from /dev/gaps/lib/gaps/db/user.rb:241:in `do_refresh'
    from /dev/gaps/lib/gaps/db/user.rb:101:in `client'
    from /dev/gaps/lib/gaps/requestor.rb:135:in `user_client'
    from /dev/gaps/lib/gaps/requestor.rb:143:in `get_client'
    from /dev/gaps/lib/gaps/requestor.rb:155:in `request'
    from /dev/gaps/lib/gaps/requestor.rb:193:in `block in request_all'
    from /.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/core_ext/range/each.rb:7:in `each'
    from /.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/core_ext/range/each.rb:7:in `each_with_time_with_zone'
    from /dev/gaps/lib/gaps/requestor.rb:189:in `request_all'
    from /dev/gaps/lib/gaps/requestor.rb:42:in `group_list'
    from /dev/gaps/lib/gaps/db/group.rb:177:in `refresh'
    from /dev/gaps/lib/gaps/db/group.rb:157:in `boot'
    from bin/gaps_server.rb:366:in `block in main'
    from /.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `call'
    from /.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context'

I can't figure why but It seems that the refresh token isn't set in client.authorization when fetch_access_token! is called.

Any idea on the root cause?

Anyway, thanks for this great tool, very helpful in managing our mailing lists :)

Heroku Mongo Authentication

When using the Heroku and MongoLabs for running this application, we're getting failure when trying to authenticate the user.

2015-11-22T20:41:58.936994+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/connection/pool.rb:320:in `block in check_auths'
2015-11-22T20:41:58.936996+00:00 app[web.1]:    from /app/vendor/ruby-2.1.5/lib/ruby/2.1.0/set.rb:263:in `each'
2015-11-22T20:41:58.936931+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/functional/authentication.rb:205:in `issue_authentication': Failed to authenticate user

This doesn't reproduce locally, most likely due to differences in the mongo versions. I'm running mongo v3.0.6 locally.

Has anyone else been experiencing this issue?

Gaps keeps crashing with BackendError

I have a test instance of gaps deployed on our internal server for evaluation. It is deployed inside a docker container following the instructions found in the README. Nothing exotic about the configuration.

The application doesn't seem to be able to run more than a couple of hours before it crashes with the following trace:

== Sinatra has ended his set (crowd applauds)
/gaps/vendor/bundle/ruby/2.1.0/gems/google-api-client-0.7.1/lib/google/api_client.rb:620:in `block in execute!': Backend Error (Google::APIClient::ServerError)
        from /gaps/vendor/bundle/ruby/2.1.0/gems/retriable-1.4.1/lib/retriable/retry.rb:27:in `perform'
        from /gaps/vendor/bundle/ruby/2.1.0/gems/retriable-1.4.1/lib/retriable.rb:15:in `retriable'
        from /gaps/vendor/bundle/ruby/2.1.0/gems/google-api-client-0.7.1/lib/google/api_client.rb:595:in `execute!'
        from /gaps/lib/gaps/requestor.rb:160:in `request'
        from /gaps/lib/gaps/requestor.rb:119:in `get_group_settings'
        from /gaps/lib/gaps/db/group.rb:95:in `update_config'
        from /gaps/lib/gaps/db/group.rb:187:in `block (2 levels) in refresh'
        from /gaps/vendor/bundle/ruby/2.1.0/gems/thread-0.1.4/lib/thread/future.rb:27:in `call'
        from /gaps/vendor/bundle/ruby/2.1.0/gems/thread-0.1.4/lib/thread/future.rb:27:in `block in initialize'
        from /gaps/vendor/bundle/ruby/2.1.0/gems/thread-0.1.4/lib/thread/pool.rb:56:in `call'
        from /gaps/vendor/bundle/ruby/2.1.0/gems/thread-0.1.4/lib/thread/pool.rb:56:in `execute'
        from /gaps/vendor/bundle/ruby/2.1.0/gems/thread-0.1.4/lib/thread/pool.rb:384:in `block (2 levels) in spawn_thread'
        from /gaps/vendor/bundle/ruby/2.1.0/gems/thread-0.1.4/lib/thread/pool.rb:351:in `loop'
        from /gaps/vendor/bundle/ruby/2.1.0/gems/thread-0.1.4/lib/thread/pool.rb:351:in `block in spawn_thread'
        from /gaps/vendor/bundle/ruby/2.1.0/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `call'
        from /gaps/vendor/bundle/ruby/2.1.0/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context'

Configatron::UndefinedKeyError - Key not found: oauth (for locked configatron)

Not sure if this belongs here or in chalk-config.

I'm running this locally without Docker or Heroku or the dev script. Just regular ol' bundle exec bin/gaps_server.rb behind Unicorn and nginx. Unfortunately I get the following error:

2015-10-28 22:02:20 - Configatron::UndefinedKeyError - Key not found: oauth (for locked configatron):
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/configatron-4.5.0/lib/configatron/store.rb:44:in `block in []'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/configatron-4.5.0/lib/configatron/store.rb:73:in `call'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/configatron-4.5.0/lib/configatron/store.rb:73:in `fetch'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/configatron-4.5.0/lib/configatron/store.rb:42:in `[]'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/configatron-4.5.0/lib/configatron/store.rb:164:in `do_lookup'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/configatron-4.5.0/lib/configatron/store.rb:126:in `method_missing'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/configatron-4.5.0/lib/configatron/root_store.rb:54:in `method_missing'
        /srv/www/gaps/releases/20151028213059/lib/gaps/requestor.rb:18:in `base_client'
        /srv/www/gaps/releases/20151028213059/bin/gaps_server.rb:45:in `block in <class:GapsServer>'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in `call'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in `block in compile!'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1014:in `[]'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1014:in `block in process_route'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in `catch'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in `process_route'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:965:in `block in filter!'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:965:in `each'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:965:in `filter!'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1083:in `block in dispatch!'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `block in invoke'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `catch'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `invoke'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1081:in `dispatch!'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in `block in call!'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `block in invoke'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `catch'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `invoke'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in `call!'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:894:in `call'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/rack-1.6.4/lib/rack/commonlogger.rb:33:in `call'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:218:in `call'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:211:in `call'
        /srv/www/gaps/releases/20151028213059/lib/gaps/third/healthcheck.rb:15:in `call'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/rack-1.6.4/lib/rack/nulllogger.rb:9:in `call'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:181:in `call'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:2021:in `call'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in `block in call'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1795:in `synchronize'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in `call'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:580:in `process_client'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:674:in `worker_loop'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:529:in `spawn_missing_workers'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:140:in `start'
        /home/deploy/.bundler/gaps/ruby/2.1.0/gems/unicorn-4.9.0/bin/unicorn_rails:209:in `<top (required)>'
        /home/deploy/.bundler/gaps/ruby/2.1.0/bin/unicorn_rails:23:in `load'
        /home/deploy/.bundler/gaps/ruby/2.1.0/bin/unicorn_rails:23:in `<main>'

It seems to be loading site.yaml correctly (otherwise it would error telling me to create the file), and the file itself seems to be valid.

I tried hardcoding the full path to site.yml in the source code, but I still get the same error.

NoMethodError - undefined method `collection' for nil:NilClass

I'm concerned about posting an issue here because it doesn't seem anyone is paying any attention.

Regardless, I've been trying to set up a Gaps server and I get an internal server error. The log looks like this:

10.1.0.65 - - [09/Nov/2015:18:49:21 +0000] "GET / HTTP/1.0" 302 - 0.0095
10.1.0.65 - - [09/Nov/2015:18:49:21 +0000] "GET /subs HTTP/1.0" 303 - 0.0010
2015-11-09 18:49:21 - NoMethodError - undefined method `collection' for nil:NilClass:
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/persistence.rb:58:in `collection'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/querying.rb:51:in `query'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/sci.rb:70:in `query'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/identity_map.rb:61:in `query'
        /srv/www/gaps/releases/20151109063442/lib/gaps/db/user.rb:32:in `lister'
        /srv/www/gaps/releases/20151109063442/bin/gaps_server.rb:102:in `block in <class:GapsServer>'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in `call'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in `block in compile!'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `[]'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `block (3 levels) in route!'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:993:in `route_eval'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `block (2 levels) in route!'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1014:in `block in process_route'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in `catch'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in `process_route'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:972:in `block in route!'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:971:in `each'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:971:in `route!'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1084:in `block in dispatch!'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `block in invoke'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `catch'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `invoke'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1081:in `dispatch!'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in `block in call!'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `block in invoke'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `catch'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `invoke'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in `call!'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:894:in `call'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/commonlogger.rb:33:in `call'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:218:in `call'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:211:in `call'
        /srv/www/gaps/releases/20151109063442/lib/gaps/third/healthcheck.rb:15:in `call'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/nulllogger.rb:9:in `call'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:181:in `call'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:2021:in `call'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in `block in call'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1795:in `synchronize'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in `call'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/puma-2.14.0/lib/puma/configuration.rb:78:in `call'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/puma-2.14.0/lib/puma/server.rb:541:in `handle_request'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/puma-2.14.0/lib/puma/server.rb:388:in `process_client'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/puma-2.14.0/lib/puma/server.rb:270:in `block in run'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/puma-2.14.0/lib/puma/thread_pool.rb:106:in `call'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/puma-2.14.0/lib/puma/thread_pool.rb:106:in `block in spawn_thread'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/logging-2.0.0/lib/logging/diagnostic_context.rb:448:in `call'
        /srv/www/gaps/releases/20151109063442/vendor/bundle/ruby/2.1.0/gems/logging-2.0.0/lib/logging/diagnostic_context.rb:448:in `block in create_with_logging_context'
10.1.0.65 - - [09/Nov/2015:18:49:21 +0000] "GET /login HTTP/1.0" 500 30 0.0015

My gems look like:

# bundle exec gem list

*** LOCAL GEMS ***

activemodel (4.2.4)
activesupport (4.2.4)
addressable (2.3.8)
autoparse (0.3.3)
bson (1.12.3)
bson_ext (1.12.3)
builder (3.2.2)
bundler (1.5.3)
chalk-config (0.2.1)
chalk-log (0.1.3)
coderay (1.1.0)
configatron (4.5.0)
domain_name (0.5.25)
einhorn (0.6.4)
erubis (2.7.0)
extlib (0.9.16)
faraday (0.9.2)
gmail-britta (0.1.6)
google-api-client (0.8.6)
googleauth (0.4.2)
haml (3.1.8)
http-cookie (1.0.2)
i18n (0.7.0)
json (1.8.3)
jwt (1.5.2)
kgio (2.10.0)
launchy (2.4.3)
little-plugger (1.1.4)
logging (2.0.0)
lspace (0.13)
mail (2.6.3)
memoist (0.12.0)
metaclass (0.0.4)
method_source (0.8.2)
mime-types (2.6.2)
minitest (5.8.2)
mocha (1.1.0)
mongo (1.12.3)
mongo_mapper (0.13.1)
multi_json (1.11.2)
multipart-post (2.0.0)
netrc (0.10.3)
plucky (0.6.6)
pry (0.10.3)
puma (2.14.0)
rack (1.6.4)
rack-flash3 (1.0.5)
rack-protection (1.5.3)
rack_csrf (2.5.0)
raindrops (0.15.0)
rake (10.4.2)
rest-client (1.8.0)
retriable (1.4.1)
signet (0.6.1)
sinatra (1.4.6)
slop (3.6.0)
thread (0.2.2)
thread_safe (0.3.5)
tilt (2.0.1)
tzinfo (1.2.2)
unf (0.1.4)
unf_ext (0.0.7.1)
unicorn (4.9.0)

The mongo part of my site.yaml is stupidly simple:

db:
  # Which database name to use.
  database: test
  # URL to connect to your MongoDB instance (where all state is
  # persisted). Note that Gaps stores some interesting state, such as
  # people's filter configuration and group categorization.
  mongodb_url: mongodb://localhost:27017

And the database contains actual data... I did a mongodump of our working Gaps install and mongorestored it in an attempt to fix this issue.

Missing authorization code: After changing admin password and revoking access

I was consistently getting the error below. It started right after I changed the password on the admin account and restarted prod (running in docker). I did not get this error locally after changing the password... I checked and my google app twitch-gaps doesn't have offline permission from my gmail account. I tried revoking access and now I pretty expectedly get the same missing authorization code. I think the quickest fix on my end would be for me to delete existing credentials. Where are they stored?

[2015-02-21 03:04:34.719315] [1] Refreshing expired token: user=""
== Sinatra has ended his set (crowd applauds)
/gaps/vendor/bundle/ruby/2.1.0/gems/signet-0.5.1/lib/signet/oauth_2/client.rb:906:in generate_access_token_request': Missing authorization code. (raised from thread pool) (ArgumentError) from /gaps/vendor/bundle/ruby/2.1.0/gems/signet-0.5.1/lib/signet/oauth_2/client.rb:930:infetch_access_token'
from /gaps/vendor/bundle/ruby/2.1.0/gems/signet-0.5.1/lib/signet/oauth_2/client.rb:956:in fetch_access_token!' from /gaps/lib/gaps/db/user.rb:241:indo_refresh'
from /gaps/lib/gaps/db/user.rb:101:in client' from /gaps/lib/gaps/requestor.rb:131:inlister_client'
from /gaps/lib/gaps/requestor.rb:141:in get_client' from /gaps/lib/gaps/requestor.rb:155:inrequest'
from /gaps/lib/gaps/requestor.rb:193:in block in request_all' from /gaps/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.8/lib/active_support/core_ext/range/each.rb:7:ineach'
from /gaps/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.8/lib/active_support/core_ext/range/each.rb:7:in each_with_time_with_zone' from /gaps/lib/gaps/requestor.rb:189:inrequest_all'
from /gaps/lib/gaps/requestor.rb:68:in membership_list' from /gaps/lib/gaps/requestor.rb:58:inblock in membership_list_for_group'
from /gaps/lib/gaps/db/cache.rb:68:in call' from /gaps/lib/gaps/db/cache.rb:68:inblock in cache_lookup'
from /gaps/vendor/bundle/ruby/2.1.0/gems/thread-0.1.4/lib/thread/pool.rb:56:in call' from /gaps/vendor/bundle/ruby/2.1.0/gems/thread-0.1.4/lib/thread/pool.rb:56:inexecute'
from /gaps/vendor/bundle/ruby/2.1.0/gems/thread-0.1.4/lib/thread/pool.rb:384:in block (2 levels) in spawn_thread' from /gaps/vendor/bundle/ruby/2.1.0/gems/thread-0.1.4/lib/thread/pool.rb:351:inloop'
from /gaps/vendor/bundle/ruby/2.1.0/gems/thread-0.1.4/lib/thread/pool.rb:351:in block in spawn_thread' from /gaps/vendor/bundle/ruby/2.1.0/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:incall'
from /gaps/vendor/bundle/ruby/2.1.0/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context'

docker-runner pulls out of date image

The stripeoss/gaps image in the docker registry was last updated on 12/10/2014. Since then, a number of bugs have been fixed. Can we get an updated image?

Which mongo docker image is the Dockerfile assumed to work with?

The Dockerfile is otherwise downloading the latest docker image of mongo which is having some issues with mongomapper.

Mongo::OperationFailure - Database command 'insert' failed: Unknown option to insert command: w:
/gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/db.rb:564:in rescue in command' /gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/db.rb:560:in command'
/gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/collection_writer.rb:314:in block in send_write_command' /gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/functional/logging.rb:55:in block in instrument'
/gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/functional/logging.rb:20:in instrument' /gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/functional/logging.rb:54:in instrument'
/gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/collection_writer.rb:313:in send_write_command' /gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/collection.rb:1091:in send_write'
/gaps/vendor/bundle/ruby/2.1.0/gems/mongo-1.11.1/lib/mongo/collection.rb:419:in insert' /gaps/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/querying.rb:136:in save_to_collection'
/gaps/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/associations.rb:88:in save_to_collection' /gaps/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/safe.rb:27:in save_to_collection'
/gaps/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/querying.rb:126:in create' /gaps/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/callbacks.rb:21:in block in create'
/gaps/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:82:in run_callbacks' /gaps/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/embedded_callbacks.rb:77:in run_callbacks'
/gaps/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/callbacks.rb:21:in create' /gaps/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/querying.rb:121:in create_or_update'
/gaps/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/callbacks.rb:17:in block in create_or_update' /gaps/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:113:in call'
/gaps/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:113:in call' /gaps/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in block in halting'
/gaps/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:86:in call' /gaps/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:86:in run_callbacks'
/gaps/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/embedded_callbacks.rb:77:in run_callbacks' /gaps/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/callbacks.rb:17:in create_or_update'
/gaps/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/querying.rb:103:in save' /gaps/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/dirty.rb:17:in block in save'
/gaps/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/dirty.rb:27:in clear_changes' /gaps/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/dirty.rb:17:in save'
/gaps/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/validations.rb:22:in save' /gaps/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/identity_map.rb:87:in save'
/gaps/vendor/bundle/ruby/2.1.0/gems/mongo_mapper-0.13.1/lib/mongo_mapper/plugins/querying.rb:108:in save!' /gaps/lib/gaps/db/user.rb:169:in persist'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.