fbsamples / messenger-bot-samples

Messenger Bot Samples
Other
555 stars 441 forks source link

Not working on mobile #14

Closed jackysatpal closed 7 years ago

jackysatpal commented 7 years ago

I followed all the instructions of chat-extensions but when I try to invite other friends to edit the list then on the mobile I get a message like

Any idea what's wrong?

Also my heroku hosting is giving me this error "Internal Server Error" Link: https://still-plateau-77702.herokuapp.com/

nagendraK6 commented 7 years ago

Did you whitelist your url https://still-plateau-77702.herokuapp.com/ using https://developers.facebook.com/docs/messenger-platform/webview/extensions

nagendraK6 commented 7 years ago

can you please share the server logs looks like somewhere the heroku server is throwing exception ?

jackysatpal commented 7 years ago

Sure. here are the logs:

In the logs you can see url is whitelisted.

2017-05-30T21:00:37.398012+00:00 heroku[web.1]: Restarting 2017-05-30T21:00:37.398712+00:00 heroku[web.1]: State changed from up to starting 2017-05-30T21:00:38.205761+00:00 heroku[web.1]: Stopping all processes with SIGTERM 2017-05-30T21:00:38.458177+00:00 heroku[web.1]: Process exited with status 143 2017-05-30T21:00:40.833496+00:00 heroku[web.1]: Starting process with command npm start 2017-05-30T21:00:43.109380+00:00 app[web.1]: 2017-05-30T21:00:43.109402+00:00 app[web.1]: > chat-extensions@0.1.0 start /app 2017-05-30T21:00:43.109403+00:00 app[web.1]: > node ./bin/www 2017-05-30T21:00:43.109404+00:00 app[web.1]: 2017-05-30T21:00:46.317843+00:00 app[web.1]: DJSJSDKSJDKSDJKSDJSKDJSKDJ 2017-05-30T21:00:46.317860+00:00 app[web.1]: alkfsjKJSLDKSjlkajLKDJslkdjs 2017-05-30T21:00:46.357201+00:00 app[web.1]: Listening on Port 45740 2017-05-30T21:00:46.689210+00:00 heroku[web.1]: State changed from starting to up 2017-05-30T21:00:46.613185+00:00 app[web.1]: Failed calling Messenger API endpoint thread_settings 500 Internal Server Error { message: 'Tried accessing nonexisting field (whitelisted_domains) on node type (Page)', 2017-05-30T21:00:46.613203+00:00 app[web.1]: type: 'FacebookApiException', 2017-05-30T21:00:46.613204+00:00 app[web.1]: code: 100, 2017-05-30T21:00:46.613205+00:00 app[web.1]: fbtrace_id: 'AxbQlu0yuVN', 2017-05-30T21:00:46.613206+00:00 app[web.1]: original_response: { result: 'Successfully updated whitelisted domains' } } { fields: 'whitelisted_domains' } 2017-05-30T21:00:46.613333+00:00 app[web.1]: Retrying Request: 5 left 2017-05-30T21:00:46.805464+00:00 app[web.1]: Failed calling Messenger API endpoint thread_settings 500 Internal Server Error { message: 'Tried accessing nonexisting field (whitelisted_domains) on node type (Page)', 2017-05-30T21:00:46.805467+00:00 app[web.1]: type: 'FacebookApiException', 2017-05-30T21:00:46.805468+00:00 app[web.1]: code: 100, 2017-05-30T21:00:46.805468+00:00 app[web.1]: fbtrace_id: 'FtaVYWxVqPT', 2017-05-30T21:00:46.805469+00:00 app[web.1]: original_response: { result: 'Successfully updated whitelisted domains' } } { fields: 'whitelisted_domains' } 2017-05-30T21:00:46.805490+00:00 app[web.1]: Retrying Request: 4 left 2017-05-30T21:00:46.900368+00:00 app[web.1]: Successfully sent message to thread_settings endpoint: {"result":"Successfully added new_thread's CTAs"} 2017-05-30T21:00:47.002251+00:00 app[web.1]: Failed calling Messenger API endpoint thread_settings 500 Internal Server Error { message: 'Tried accessing nonexisting field (whitelisted_domains) on node type (Page)', 2017-05-30T21:00:47.002254+00:00 app[web.1]: type: 'FacebookApiException', 2017-05-30T21:00:47.002255+00:00 app[web.1]: code: 100, 2017-05-30T21:00:47.002256+00:00 app[web.1]: fbtrace_id: 'AvHLLkJeVs8', 2017-05-30T21:00:47.002257+00:00 app[web.1]: original_response: { result: 'Successfully updated whitelisted domains' } } { fields: 'whitelisted_domains' } 2017-05-30T21:00:47.002273+00:00 app[web.1]: Retrying Request: 3 left 2017-05-30T21:00:47.047359+00:00 app[web.1]: Successfully sent message to thread_settings endpoint: {"result":"Successfully added structured menu CTAs"} 2017-05-30T21:00:47.168570+00:00 app[web.1]: Failed calling Messenger API endpoint thread_settings 500 Internal Server Error { message: 'Tried accessing nonexisting field (whitelisted_domains) on node type (Page)', 2017-05-30T21:00:47.168582+00:00 app[web.1]: type: 'FacebookApiException', 2017-05-30T21:00:47.168583+00:00 app[web.1]: code: 100, 2017-05-30T21:00:47.168584+00:00 app[web.1]: fbtrace_id: 'FtV3eui4u3P', 2017-05-30T21:00:47.168584+00:00 app[web.1]: original_response: { result: 'Successfully updated whitelisted domains' } } { fields: 'whitelisted_domains' } 2017-05-30T21:00:47.168589+00:00 app[web.1]: Retrying Request: 2 left 2017-05-30T21:00:47.335464+00:00 app[web.1]: Failed calling Messenger API endpoint thread_settings 500 Internal Server Error { message: 'Tried accessing nonexisting field (whitelisted_domains) on node type (Page)', 2017-05-30T21:00:47.335467+00:00 app[web.1]: type: 'FacebookApiException', 2017-05-30T21:00:47.335468+00:00 app[web.1]: code: 100, 2017-05-30T21:00:47.335469+00:00 app[web.1]: fbtrace_id: 'HkxxKubPD8h', 2017-05-30T21:00:47.335470+00:00 app[web.1]: original_response: { result: 'Successfully updated whitelisted domains' } } { fields: 'whitelisted_domains' } 2017-05-30T21:00:47.335474+00:00 app[web.1]: Retrying Request: 1 left 2017-05-30T21:00:47.522683+00:00 app[web.1]: Failed calling Messenger API endpoint thread_settings 500 Internal Server Error { message: 'Tried accessing nonexisting field (whitelisted_domains) on node type (Page)', 2017-05-30T21:00:47.522696+00:00 app[web.1]: type: 'FacebookApiException', 2017-05-30T21:00:47.522697+00:00 app[web.1]: code: 100, 2017-05-30T21:00:47.522698+00:00 app[web.1]: fbtrace_id: 'ENyGBLXQYyF', 2017-05-30T21:00:47.522699+00:00 app[web.1]: original_response: { result: 'Successfully updated whitelisted domains' } } { fields: 'whitelisted_domains' } 2017-05-30T21:00:47.522825+00:00 app[web.1]: Retrying Request: 0 left 2017-05-30T21:00:47.524094+00:00 app[web.1]: No more retries left. { endPoint: 'thread_settings', 2017-05-30T21:00:47.524096+00:00 app[web.1]: messageDataArray: 2017-05-30T21:00:47.524097+00:00 app[web.1]: { setting_type: 'domain_whitelisting', 2017-05-30T21:00:47.524098+00:00 app[web.1]: whitelisted_domains: [ '

https://still-plateau-77702.herokuapp.com

' ], 2017-05-30T21:00:47.524098+00:00 app[web.1]: domain_action_type: 'add' }, 2017-05-30T21:00:47.524099+00:00 app[web.1]: queryParams: { fields: 'whitelisted_domains' } } 2017-05-30T21:01:05.391722+00:00 heroku[router]: at=info method=GET path="/lists/5" host=still-plateau-77702.herokuapp.com request_id=fb655859-bf9b-40e6-8a0e-cbbdb3567a19 fwd="172.56.35.5" dyno=web.1 connect=1ms service=30ms status=200 bytes=1364 protocol=https 2017-05-30T21:01:05.536661+00:00 heroku[router]: at=info method=GET path="/bundle.js" host=still-plateau-77702.herokuapp.com request_id=64326431-fca2-4a33-99d6-ce22474499c8 fwd="172.56.35.5" dyno=web.1 connect=1ms service=64ms status=200 bytes=1745577 protocol=https 2017-05-30T21:01:05.393980+00:00 app[web.1]: GET /lists/5 200 14.837 ms - 1161 2017-05-30T21:01:24.315448+00:00 heroku[router]: at=info method=GET path="/lists/5" host=still-plateau-77702.herokuapp.com request_id=447811f3-e7bc-4d4e-8324-9ff488d2a184 fwd="172.56.35.5" dyno=web.1 connect=0ms service=4ms status=304 bytes=151 protocol=https 2017-05-30T21:01:24.314627+00:00 app[web.1]: GET /lists/5 304 1.370 ms - - 2017-05-30T21:01:24.385162+00:00 heroku[router]: at=info method=GET path="/bundle.js" host=still-plateau-77702.herokuapp.com request_id=ee398d60-ea53-4a28-a140-a4f1cf639d73 fwd="172.56.35.5" dyno=web.1 connect=0ms service=3ms status=304 bytes=240 protocol=https 2017-05-30T21:03:07.026276+00:00 heroku[router]: at=info method=GET path="/" host=still-plateau-77702.herokuapp.com request_id=d01070b0-4954-4d23-98ba-a2b0f2768d63 fwd="199.201.64.135" dyno=web.1 connect=1ms service=7ms status=500 bytes=404 protocol=https 2017-05-30T21:03:07.025917+00:00 app[web.1]: GET / 500 2.989 ms - 148 2017-05-30T21:03:07.038155+00:00 app[web.1]: ReferenceError: /app/views/index.ejs:27 2017-05-30T21:03:07.038158+00:00 app[web.1]: 25| window.attachApp( 2017-05-30T21:03:07.038158+00:00 app[web.1]: 26| context.psid, 2017-05-30T21:03:07.038159+00:00 app[web.1]: >> 27| <%= listId %>, 2017-05-30T21:03:07.038160+00:00 app[web.1]: 28| "<%= socketAddress %>", 2017-05-30T21:03:07.038160+00:00 app[web.1]: 29| context.thread_type); 2017-05-30T21:03:07.038161+00:00 app[web.1]: 30| }, function error(err) { 2017-05-30T21:03:07.038165+00:00 app[web.1]: 2017-05-30T21:03:07.038166+00:00 app[web.1]: listId is not defined 2017-05-30T21:03:07.038167+00:00 app[web.1]: at eval (eval at compile (/app/node_modules/ejs/lib/ejs.js:524:12), :22:26) 2017-05-30T21:03:07.038168+00:00 app[web.1]: at returnedFn (/app/node_modules/ejs/lib/ejs.js:555:17) 2017-05-30T21:03:07.038168+00:00 app[web.1]: at tryHandleCache (/app/node_modules/ejs/lib/ejs.js:203:34) 2017-05-30T21:03:07.038169+00:00 app[web.1]: at View.exports.renderFile [as engine] (/app/node_modules/ejs/lib/ejs.js:412:10) 2017-05-30T21:03:07.038170+00:00 app[web.1]: at View.render (/app/node_modules/express/lib/view.js:128:8) 2017-05-30T21:03:07.038170+00:00 app[web.1]: at tryRender (/app/node_modules/express/lib/application.js:640:10) 2017-05-30T21:03:07.038171+00:00 app[web.1]: at Function.render (/app/node_modules/express/lib/application.js:592:3) 2017-05-30T21:03:07.038171+00:00 app[web.1]: at ServerResponse.render (/app/node_modules/express/lib/response.js:966:7) 2017-05-30T21:03:07.038172+00:00 app[web.1]: at /app/routes/index.js:15:7 2017-05-30T21:03:07.038172+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5) 2017-05-30T21:03:07.038173+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/route.js:137:13) 2017-05-30T21:03:07.038173+00:00 app[web.1]: at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3) 2017-05-30T21:03:07.038174+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5) 2017-05-30T21:03:07.038174+00:00 app[web.1]: at /app/node_modules/express/lib/router/index.js:281:22 2017-05-30T21:03:07.038174+00:00 app[web.1]: at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12) 2017-05-30T21:03:07.038175+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/index.js:275:10)

jackysatpal commented 7 years ago

Tried running locally using yarn and ngrok and it is working now. Thanks for all the help!

So closing the issue.