Skip to content

Error: Require an oauthToken or token option #406

@MichaelRumpler

Description

@MichaelRumpler

I tried to set up a staticman instance on Heroku, but I'm missing something.

The Heroku instance runs at https://staticman-mr.herokuapp.com/. When I open that url, it says "Hello from Staticman version 3.0.0!".

But when I try to submit a comment from my blog, then I get this in the Heroku log:

2021-03-01T17:34:37.714485+00:00 app[web.1]: /app/lib/GitHub.js:33
2021-03-01T17:34:37.714497+00:00 app[web.1]: throw new Error('Require an oauthToken or token option')
2021-03-01T17:34:37.714498+00:00 app[web.1]: ^
2021-03-01T17:34:37.714499+00:00 app[web.1]:
2021-03-01T17:34:37.714499+00:00 app[web.1]: Error: Require an oauthToken or token option
2021-03-01T17:34:37.714500+00:00 app[web.1]: at /app/lib/GitHub.js:33:15
2021-03-01T17:34:37.714500+00:00 app[web.1]: at new GitHub (/app/lib/GitHub.js:46:7)
2021-03-01T17:34:37.714501+00:00 app[web.1]: at Object.module.exports.create (/app/lib/GitServiceFactory.js:11:14)
2021-03-01T17:34:37.714501+00:00 app[web.1]: at /app/lib/Staticman.js:32:35
2021-03-01T17:34:37.714501+00:00 app[web.1]: at new Staticman (/app/lib/Staticman.js:46:7)
2021-03-01T17:34:37.714502+00:00 app[web.1]: at module.exports (/app/controllers/process.js:126:27)
2021-03-01T17:34:37.714503+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2021-03-01T17:34:37.714503+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/route.js:137:13)
2021-03-01T17:34:37.714504+00:00 app[web.1]: at /app/server.js:169:14
2021-03-01T17:34:37.714504+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2021-03-01T17:34:37.714504+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/route.js:137:13)
2021-03-01T17:34:37.714505+00:00 app[web.1]: at /app/server.js:144:14
2021-03-01T17:34:37.714505+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2021-03-01T17:34:37.714506+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/route.js:137:13)
2021-03-01T17:34:37.714506+00:00 app[web.1]: at /app/server.js:129:14
2021-03-01T17:34:37.714506+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2021-03-01T17:34:37.714507+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/route.js:137:13)
2021-03-01T17:34:37.714507+00:00 app[web.1]: at module.exports. (/app/node_modules/express-brute/index.js:142:36)
2021-03-01T17:34:37.714508+00:00 app[web.1]: at module.exports.MemoryStore.set (/app/node_modules/express-brute/lib/MemoryStore.js:28:35)
2021-03-01T17:34:37.714508+00:00 app[web.1]: at module.exports. (/app/node_modules/express-brute/index.js:127:17)
2021-03-01T17:34:37.714508+00:00 app[web.1]: at module.exports.MemoryStore.get (/app/node_modules/express-brute/lib/MemoryStore.js:38:35)
2021-03-01T17:34:37.714509+00:00 app[web.1]: at module.exports. (/app/node_modules/express-brute/index.js:82:15)
2021-03-01T17:34:37.732294+00:00 app[web.1]: npm ERR! code 1
2021-03-01T17:34:37.732902+00:00 app[web.1]: npm ERR! path /app
2021-03-01T17:34:37.739796+00:00 app[web.1]: npm ERR! command failed
2021-03-01T17:34:37.740081+00:00 app[web.1]: npm ERR! command sh -c node index.js
2021-03-01T17:34:37.754082+00:00 app[web.1]:
2021-03-01T17:34:37.754401+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-03-01T17:34:37.754634+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-03-01T17_34_37_741Z-debug.log
2021-03-01T17:34:37.722918+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=POST path="/v3/entry/github/MichaelRumpler/MichaelRumpler.github.io/master/comments" host=staticman-mr.herokuapp.com request_id=bc3aad82-ac22-434d-90f6-83a855d3fa4c fwd="77.116.29.22" dyno=web.1 connect=0ms service=45ms status=503 bytes=0 protocol=https
2021-03-01T17:34:37.822591+00:00 heroku[web.1]: Process exited with status 1
2021-03-01T17:34:37.910338+00:00 heroku[web.1]: State changed from up to crashed

I did set the Heroku config variables GITHUB_TOKEN and RSA_PRIVATE_KEY. From the error message I assume that it doesn't find the GITHUB_TOKEN.

When I go to github.com/settings/tokens of my Staticman App user, I see that the Personal Access Token was never used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions