Closed jerinsj closed 7 years ago
I am getting the same error, it looks like they've had this problem before, there is a reference to a #28 which was fixed but seems to have popped up again.
Are you checking message.watsonError before using message.watsonData in your code?
where can i check message.watsonError and message.watsonData and how do you know if that could be a problem?
Replace bot.reply line with
if (message.watsonError.) {
console.log(message.watsonError);
bot.reply(message, "I'm sorry, but for technical reasons I can't respond to your message");
} else {
bot.reply(message, message.watsonData.output.text.join('\n'));
}
I am going to try that and let you know, although i don't think that will get the bot to have a conversation.
No, but it will help to understand why your bot isn't working.
Yes my friend I tried that and this is the message that I see...
leading upto this... I used local tunnel set it to listen on port 5000, received URL for webhook, went on facebook and added the webhook, everything went well but that's the error message I get on the terminal...
oh wow! the bot responded " I'm sorry but for technical reasons cant respond to your message.
It looks like you get Forbidden response from Watson. Check if you are setting correct username, password and workspace_id.
Good Day Guys,
I've had the same initial issue with @jerinsj. And the error logs say "ERCD-NOCONFIG"
you can print this by following below:
Further research suggests that this points to having incorrect username, password, or workspace_id like what @Naktibalda said. BUT, here's the issue with the Botkit I've found:
I've tried adding in the credentials manually and they don't work. as seen here:
I also noticed that in the Application details in Bluemix, the conversation service was binded and a different set of credentials were given, I tried them also and to no success. I've read from a different post that this might be due to the version_date
sending the wrong POST request format like "https://gateway.watsonplatform.net/conversation/api/v1/workspaces/{workspace_id}/message?version=`ConversationV1.VERSION_DATE_2017_05_26`".
May I request help? or can someone teach me how to see the POST requests my botkit is sending to the Watson API endpoint?
reference: Experience And this thread - https://github.com/watson-developer-cloud/botkit-middleware/issues/46 (Can anyone teach me how the guy in this thread was able to generate the POST request logs of his botkit? Thanks)
@kkarlallan I see 2 unrelated pieces of code. The first screenshot is a complete code of a very minimal bot which does nothing.
Second screenshot creates middleware object. Is there a third file which plugs the first two together?
URL in the error log looks completely wrong too.
My advice is not to use Watson middleware example code as a starting point for your bot. Use botkit starter kit instead and plug Watson middleware to it.
Hey @Naktibalda . I fixed my problem and I'm guessing this will fix @jerinsj 's problem too. Thanks for putting a bit of time into this. This was quite embarrassing.
Here's the absurd solution: In the .env file. Delete the commented "#US-South" on line 2. Voila!
This took me 3 days to find out. What a life. *sigh
But seriously though, I used this as my botkit starter and just updated the Watson Credentials: https://github.com/watson-developer-cloud/botkit-middleware/tree/master/examples/multi-bot
I suggest there be a comment inside the env file there that states "delete this later on -> #US-South" or something like that since it creates a fuss.
Thanks for hearing me out. Hope this helps other newbies like me.
To recreate the error by the way is:
Debug:
Everything's now working fine. Crying in bliss
Awesome! that was exactly the problem. Thanks. I am so excited to be talking with my bot for the very first time.
@kkarlallan sorry for that, I assumed that # comments work like in programming languages and didn't test them.
Can anyone tell me what the fatal type error means and how i can get the facebook bot to reply back. I used localtunnel just to try out the facebook bot, here's how that looks in the visual code terminal....