socialpiranha
socialpiranha

Reputation: 172

500 Error when hitting route /api/profile/twitter for IBM Watson Personality Insights application

I have forked and cloned this repo: https://github.com/watson-developer-cloud/personality-insights-nodejs

I've added my Consumer Key & Secret in the credentials.json file like it states in the README but I'm getting a 500 Error. I think the issue is that I need to include my Access Token & Access Token Secret, but it's unclear where I would include that.

Here is the 500 Error I get (Note: I replaced the sensitive paths and variables) :

GET /auth/twitter? 302 227.700 ms - 0
error: Error: Failed to find request token in session
    at SessionStore.get (/project/node_modules/passport-oauth1/lib/requesttoken/session.js:13:44)
    at Strategy.OAuthStrategy.authenticate (/project/node_modules/passport-oauth1/lib/strategy.js:214:33)
    at Strategy.authenticate (/project/node_modules/passport-twitter/lib/strategy.js:87:40)
    at attempt (/project/node_modules/passport/lib/middleware/authenticate.js:348:16)
    at authenticate (/project/node_modules/passport/lib/middleware/authenticate.js:349:7)
    at Layer.handle [as handle_request] (/project/node_modules/express/lib/router/layer.js:95:5)
    at next (/project/node_modules/express/lib/router/route.js:131:13)
    at Route.dispatch (/project/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/project/node_modules/express/lib/router/layer.js:95:5)
    at /project/node_modules/express/lib/router/index.js:277:22
    at Function.process_params (/project/node_modules/express/lib/router/index.js:330:12)
    at next (/project/node_modules/express/lib/router/index.js:271:10)
    at Function.handle (/project/node_modules/express/lib/router/index.js:176:3)
    at router (/project/node_modules/express/lib/router/index.js:46:12)
    at Layer.handle [as handle_request] (/project/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/project/node_modules/express/lib/router/index.js:312:13) 'url:' '/auth/twitter/callback?oauth_token=SOME_TOKEN&oauth_verifier=SOME_VERIFIER' 'Error:' code=500, code=undefined, error=undefined
GET /auth/twitter/callback?oauth_token=SOME_TOKEN&oauth_verifier=SOME_VERIFIER 500 6.464 ms - 23

I also get a 401 Error when I am trying to access others' tweets without Oauth, specifically I get this error:

error: { code: 401,
error: 'Unauthorized: Access is denied due to invalid credentials' }     'url:' '/api/profile/twitter' 
'Error:' code=401, code=401, error=There was a problem processing the personality. Please check your credentials. 

Upvotes: 0

Views: 170

Answers (1)

chughts
chughts

Reputation: 4737

Are you sure that you are getting the 401 on the Twitter call? The instructions for setting up the Twitter access are in the instructions to the repo at the link you provide, under the heading 'Setting Up Twitter Application'.

Upvotes: 0

Related Questions