i have a problem with my website that i am deploying in heroku it keep showing me the Application error, i hope you can help me. It was working fine earlier when i haven't use passport(passport-google-oauth20) for login and also working fine after deploying it to the heroku, but as i added the login functionality and used the passport-google-oauth20 and then after i got error in heroku after deployement. Below are the errors that i got after i did heroku logs.
2020-03-26T21:23:11.336401+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=damp-island-39260.herokuapp.com request_id=881a9140-87be-4198-8584-9106cfd50d32 fwd="47.30.149.89" dyno= connect= service= status=503 bytes= protocol=https
2020-03-26T22:29:55.100663+00:00 heroku[web.1]: State changed from crashed to starting
2020-03-26T22:30:01.529559+00:00 heroku[web.1]: State changed from starting to crashed
2020-03-26T22:30:01.418449+00:00 app[web.1]: Warning: connect.session() MemoryStore is not
2020-03-26T22:30:01.418467+00:00 app[web.1]: designed for a production environment, as it will leak
2020-03-26T22:30:01.418467+00:00 app[web.1]: memory, and will not scale past a single process.
2020-03-26T22:30:01.450145+00:00 app[web.1]: /app/node_modules/passport-oauth2/lib/strategy.js:86
2020-03-26T22:30:01.450147+00:00 app[web.1]: if (!options.clientID) { throw new TypeError('OAuth2Strategy requires a clientID option'); }
2020-03-26T22:30:01.450148+00:00 app[web.1]: ^
2020-03-26T22:30:01.450148+00:00 app[web.1]:
2020-03-26T22:30:01.450149+00:00 app[web.1]: TypeError: OAuth2Strategy requires a clientID option
2020-03-26T22:30:01.450149+00:00 app[web.1]: at Strategy.OAuth2Strategy (/app/node_modules/passport-oauth2/lib/strategy.js:86:34)
2020-03-26T22:30:01.450150+00:00 app[web.1]: at new Strategy (/app/node_modules/passport-google-oauth20/lib/strategy.js:52:18)
2020-03-26T22:30:01.450150+00:00 app[web.1]: at Object. (/app/app.js:94:14)
2020-03-26T22:30:01.450150+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1158:30)
2020-03-26T22:30:01.450151+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
2020-03-26T22:30:01.450152+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:1002:32)
2020-03-26T22:30:01.450152+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:901:14)
2020-03-26T22:30:01.450153+00:00 app[web.1]: at Function.executeUserEntryPoint as
runMain
2020-03-26T22:30:01.450153+00:00 app[web.1]: at internal/main/run_main_module.js:18:47
2020-03-27T01:17:54.296425+00:00 heroku[web.1]: State changed from crashed to starting
2020-03-27T01:18:00.310473+00:00 heroku[web.1]: State changed from starting to crashed
2020-03-27T01:18:00.203117+00:00 app[web.1]: Warning: connect.session() MemoryStore is not
2020-03-27T01:18:00.203132+00:00 app[web.1]: designed for a production environment, as it will leak
2020-03-27T01:18:00.203132+00:00 app[web.1]: memory, and will not scale past a single process.
2020-03-27T01:18:00.234027+00:00 app[web.1]: /app/node_modules/passport-oauth2/lib/strategy.js:86
2020-03-27T01:18:00.234028+00:00 app[web.1]: if (!options.clientID) { throw new TypeError('OAuth2Strategy requires a clientID option'); }
2020-03-27T01:18:00.234029+00:00 app[web.1]: ^
2020-03-27T01:18:00.234029+00:00 app[web.1]:
2020-03-27T01:18:00.234030+00:00 app[web.1]: TypeError: OAuth2Strategy requires a clientID option
2020-03-27T01:18:00.234030+00:00 app[web.1]: at Strategy.OAuth2Strategy (/app/node_modules/passport-oauth2/lib/strategy.js:86:34)
2020-03-27T01:18:00.234031+00:00 app[web.1]: at new Strategy (/app/node_modules/passport-google-oauth20/lib/strategy.js:52:18)
2020-03-27T01:18:00.234031+00:00 app[web.1]: at Object. (/app/app.js:94:14)
2020-03-27T01:18:00.234032+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1158:30)
2020-03-27T01:18:00.234032+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
2020-03-27T01:18:00.234032+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:1002:32)
2020-03-27T01:18:00.234033+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:901:14)
2020-03-27T01:18:00.234033+00:00 app[web.1]: at Function.executeUserEntryPoint as
runMain
2020-03-27T01:18:00.234034+00:00 app[web.1]: at internal/main/run_main_module.js:18:47
I really don't know how to check what goes wrong. Anyone please guide me.
How are you setting the client id? If you're using an environment variable, then you probably need to set it on heroku with:
heroku config:set MY_VARIABLE_NAME=my_value
I don't know much about oauth2 the way you're doing it, but the key error here: "OAuth2Strategy requires a clientID option" seems to suggest your client id isn't being set properly (which is why I think it's a .env problem.
Also, if you google for "OAuth2Strategy requires a clientID option" you can find a few helpful sites too.
Good luck!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
i have a problem with my website that i am deploying in heroku it keep showing me the Application error, i hope you can help me. It was working fine earlier when i haven't use passport(passport-google-oauth20) for login and also working fine after deploying it to the heroku, but as i added the login functionality and used the passport-google-oauth20 and then after i got error in heroku after deployement. Below are the errors that i got after i did heroku logs.
2020-03-26T21:23:11.336401+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=damp-island-39260.herokuapp.com request_id=881a9140-87be-4198-8584-9106cfd50d32 fwd="47.30.149.89" dyno= connect= service= status=503 bytes= protocol=https
2020-03-26T22:29:55.100663+00:00 heroku[web.1]: State changed from crashed to starting
2020-03-26T22:30:01.529559+00:00 heroku[web.1]: State changed from starting to crashed
2020-03-26T22:30:01.418449+00:00 app[web.1]: Warning: connect.session() MemoryStore is not
2020-03-26T22:30:01.418467+00:00 app[web.1]: designed for a production environment, as it will leak
2020-03-26T22:30:01.418467+00:00 app[web.1]: memory, and will not scale past a single process.
2020-03-26T22:30:01.450145+00:00 app[web.1]: /app/node_modules/passport-oauth2/lib/strategy.js:86
2020-03-26T22:30:01.450147+00:00 app[web.1]: if (!options.clientID) { throw new TypeError('OAuth2Strategy requires a clientID option'); }
2020-03-26T22:30:01.450148+00:00 app[web.1]: ^
2020-03-26T22:30:01.450148+00:00 app[web.1]:
2020-03-26T22:30:01.450149+00:00 app[web.1]: TypeError: OAuth2Strategy requires a clientID option
2020-03-26T22:30:01.450149+00:00 app[web.1]: at Strategy.OAuth2Strategy (/app/node_modules/passport-oauth2/lib/strategy.js:86:34)
2020-03-26T22:30:01.450150+00:00 app[web.1]: at new Strategy (/app/node_modules/passport-google-oauth20/lib/strategy.js:52:18)
2020-03-26T22:30:01.450150+00:00 app[web.1]: at Object. (/app/app.js:94:14)
2020-03-26T22:30:01.450150+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1158:30)
2020-03-26T22:30:01.450151+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
2020-03-26T22:30:01.450152+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:1002:32)
2020-03-26T22:30:01.450152+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:901:14)
2020-03-26T22:30:01.450153+00:00 app[web.1]: at Function.executeUserEntryPoint as runMain
2020-03-26T22:30:01.450153+00:00 app[web.1]: at internal/main/run_main_module.js:18:47
2020-03-27T01:17:54.296425+00:00 heroku[web.1]: State changed from crashed to starting
2020-03-27T01:18:00.310473+00:00 heroku[web.1]: State changed from starting to crashed
2020-03-27T01:18:00.203117+00:00 app[web.1]: Warning: connect.session() MemoryStore is not
2020-03-27T01:18:00.203132+00:00 app[web.1]: designed for a production environment, as it will leak
2020-03-27T01:18:00.203132+00:00 app[web.1]: memory, and will not scale past a single process.
2020-03-27T01:18:00.234027+00:00 app[web.1]: /app/node_modules/passport-oauth2/lib/strategy.js:86
2020-03-27T01:18:00.234028+00:00 app[web.1]: if (!options.clientID) { throw new TypeError('OAuth2Strategy requires a clientID option'); }
2020-03-27T01:18:00.234029+00:00 app[web.1]: ^
2020-03-27T01:18:00.234029+00:00 app[web.1]:
2020-03-27T01:18:00.234030+00:00 app[web.1]: TypeError: OAuth2Strategy requires a clientID option
2020-03-27T01:18:00.234030+00:00 app[web.1]: at Strategy.OAuth2Strategy (/app/node_modules/passport-oauth2/lib/strategy.js:86:34)
2020-03-27T01:18:00.234031+00:00 app[web.1]: at new Strategy (/app/node_modules/passport-google-oauth20/lib/strategy.js:52:18)
2020-03-27T01:18:00.234031+00:00 app[web.1]: at Object. (/app/app.js:94:14)
2020-03-27T01:18:00.234032+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1158:30)
2020-03-27T01:18:00.234032+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
2020-03-27T01:18:00.234032+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:1002:32)
2020-03-27T01:18:00.234033+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:901:14)
2020-03-27T01:18:00.234033+00:00 app[web.1]: at Function.executeUserEntryPoint as runMain
2020-03-27T01:18:00.234034+00:00 app[web.1]: at internal/main/run_main_module.js:18:47
I really don't know how to check what goes wrong. Anyone please guide me.
node.js express heroku mongoose
How are you setting the client id? If you're using an environment variable, then you probably need to set it on heroku with:
heroku config:set MY_VARIABLE_NAME=my_value
I don't know much about oauth2 the way you're doing it, but the key error here: "OAuth2Strategy requires a clientID option" seems to suggest your client id isn't being set properly (which is why I think it's a .env problem.
Also, if you google for "OAuth2Strategy requires a clientID option" you can find a few helpful sites too.
Good luck!