Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Issue #9

Open
jwasinski opened this issue Nov 15, 2016 · 7 comments
Open

Docker Issue #9

jwasinski opened this issue Nov 15, 2016 · 7 comments

Comments

@jwasinski
Copy link

When running in docker, this bug happens.

2016-11-15T09:21:04.050617+00:00 app[web.1]: 
2016-11-15T09:21:04.050710+00:00 app[web.1]: /app/src/Option.ts:29
2016-11-15T09:21:04.050713+00:00 app[web.1]:       throw new TypeError("Some class must be created from defined value")
2016-11-15T09:21:04.050714+00:00 app[web.1]:             ^
2016-11-15T09:21:04.050779+00:00 app[web.1]: TypeError: Some class must be created from defined value
2016-11-15T09:21:04.050794+00:00 app[web.1]:     at new Some (/app/src/Option.ts:29:13)
2016-11-15T09:21:04.050795+00:00 app[web.1]:     at SafeSubscriber._next (/app/src/index.ts:143:22)
2016-11-15T09:21:04.050796+00:00 app[web.1]:     at SafeSubscriber.__tryOrUnsub (/app/node_modules/@reactivex/rxjs/dist/cjs/src/Subscriber.ts:238:10)
2016-11-15T09:21:04.050797+00:00 app[web.1]:     at SafeSubscriber.next (/app/node_modules/@reactivex/rxjs/dist/cjs/src/Subscriber.ts:190:14)
2016-11-15T09:21:04.050798+00:00 app[web.1]:     at Subscriber._next (/app/node_modules/@reactivex/rxjs/dist/cjs/src/Subscriber.ts:135:22)
2016-11-15T09:21:04.050799+00:00 app[web.1]:     at Subscriber.next (/app/node_modules/@reactivex/rxjs/dist/cjs/src/Subscriber.ts:95:12)
2016-11-15T09:21:04.050799+00:00 app[web.1]:     at Subject.next (/app/node_modules/@reactivex/rxjs/dist/cjs/src/Subject.ts:61:17)
2016-11-15T09:21:04.050800+00:00 app[web.1]:     at /app/src/index.ts:136:25
2016-11-15T09:21:04.050801+00:00 app[web.1]:     at GoogleSpreadsheet.addWorksheet (/app/node_modules/google-spreadsheet/index.js:214:38)
2016-11-15T09:21:04.050801+00:00 app[web.1]:     at SafeSubscriber._next (/app/src/index.ts:132:24)
2016-11-15T09:21:04.069900+00:00 app[web.1]: 

@cloudify
Copy link
Member

cloudify commented Nov 15, 2016

It looks like the reference to the KPIs worksheet was null, could you post the logs?

Is there a KPIs worksheet found message in the logs?

@cloudify
Copy link
Member

I see, it may be that the API call for creating the KPIs worksheet failed, I assume you have the following in your logs: KPIs worksheet not found, creating KPIs worksheet.

Make sure that the spreadsheet is shared with write permission to the service account you created. It looks like the service account is unable to create the worksheet.

@cloudify
Copy link
Member

I'll add some code to log the error in case the API call fails.

@cloudify
Copy link
Member

@jwasinski, I've released v1.0.6, it should give you a better error message to understand the problem.

@jwasinski
Copy link
Author

jwasinski commented Nov 15, 2016

Great, to get around the issue:

  1. Moved to heroku
  2. Pre-populated spreadsheet with column titles for both sheets
  3. Put in 2 test KPIs, left data empty
  4. Spreadsheet File > Share (editable to anyone with link)
  5. Spreadsheet File > Publish

Now it works nicely, can ping the bot via slack, but this issue arises.

2016-11-15T11:43:11.248544+00:00 app[web.1]: info: ** No persistent storage method specified! Data may be lost when process shuts down.
2016-11-15T11:43:11.273904+00:00 app[web.1]: info: ** Setting up custom handlers for processing Slack messages
2016-11-15T11:43:11.278048+00:00 app[web.1]: info: ** API CALL: https://slack.com/api/rtm.start
2016-11-15T11:43:11.289162+00:00 app[web.1]: Starting Kippino 1.0.6
2016-11-15T11:43:11.289284+00:00 app[web.1]: Not using service account credentials, spreadsheet must be published on the web
2016-11-15T11:43:11.435152+00:00 app[web.1]: notice: ** BOT ID: kpi ...attempting to connect to RTM!
2016-11-15T11:43:11.462657+00:00 app[web.1]: notice: RTM websocket opened
2016-11-15T11:43:11.463827+00:00 app[web.1]: Bot is up, triggering reload of users
2016-11-15T11:43:11.465957+00:00 app[web.1]: info: ** API CALL: https://slack.com/api/users.list
2016-11-15T11:43:11.534201+00:00 app[web.1]: Loaded doc: KPI by [email protected]
2016-11-15T11:43:11.534670+00:00 app[web.1]: KPIs worksheet found
2016-11-15T11:43:11.534796+00:00 app[web.1]: Got KPIs worksheet
2016-11-15T11:43:11.534953+00:00 app[web.1]: Data worksheet found
2016-11-15T11:43:11.535054+00:00 app[web.1]: Got Data worksheet
2016-11-15T11:43:11.535218+00:00 app[web.1]: Triggering reload of KPIs
2016-11-15T11:43:21.536954+00:00 app[web.1]: Loading KPI rows
2016-11-15T11:43:21.760747+00:00 app[web.1]: KPIs loaded [4]
2016-11-15T11:43:21.761355+00:00 app[web.1]: Loading data rows
2016-11-15T11:44:08.032592+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2016-11-15T11:44:08.032705+00:00 heroku[web.1]: Stopping process with SIGKILL
2016-11-15T11:44:08.218417+00:00 heroku[web.1]: State changed from starting to crashed
2016-11-15T11:44:08.201713+00:00 heroku[web.1]: Process exited with status 137

@cloudify
Copy link
Member

This is heroku complaining that the bot doesn't bind to a port, in fact it doesn't 😃

Let me see if I can disable this on the heroku config.

Btw it should work now if you deploy somewhere else as you did before.

@cloudify
Copy link
Member

The issue with heroku killing the bot is like these:

you just need to run a worker instead of a web app...

Let me see if this can be configured in the Heroku button... (not sure)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants