Hi,
I've been eagerly attempting to get a very simple bot to work with the bot framework since I saw the keynote. While getting the bots to work locally is fairly straight forward, I can't seem to get them functioning in the cloud.
I've been playing around with the NodeJs framework - and I basically started mimicking the simple botConnector example: https://github.com/Microsoft/BotBuilder/blob/master/Node/examples/hello-BotConnectorBot/app.js
However, it fails with a 500 and no further information.
From what I can gather it throws an error in the processMessage function and hits the catch statement.
(I tried deploying both to azure, google app engine and heroku - all with the same result)
{
"error": {
"code": "ServiceError",
"message": "*Sorry, CvrBot isn't available right now.*",
"statusCode": 500
}
}
I'm really excited to get this up and running :)
What is your bot id (appId) ?
Also, does it work with the emulator? ( http://aka.ms/bf-bc-emulator )
Similar issue. I get a 403 if accessing the botbuilder using the botframework.com botconnector.
I think the issue lies within BotConnectorBot.js @ line 39 - 43
if (req.headers && req.headers.hasOwnProperty('authorization')) {
var tmp = req.headers['authorization'].split(' ');
var buf = new Buffer(tmp[1], 'base64');
var cred = buf.toString().split(':');
if (cred[0] == _this.options.appId && cred[1] == _this.options.appSecret) {
I can use my bot with _no issues at all when using the emulator_ because the emulator sends a different header than the botframework.com botconnector and BotConnectorBot.js cannot find the "authorization" header in the message from the botconnector
{ authorization: 'Basic QWxleFJhc3BiFmYWFkOA==',
'content-type': 'application/json; charset=utf-8',
host: 'alexamin.de',
'content-length': '1441',
expect: '100-continue' }
{ 'x-correlating-operationid': 'syn24nvZHgU=fgtEjkT3aCTepT+wIU=',
'content-type': 'application/json; charset=utf-8',
host: 'alexamin.de',
'content-length': '1077',
expect: '100-continue' }
Could this be the issue?
Are you registering an https endpoint? We only send the auth headers when using HTTPS, because otherwise we would be exposing your secret. But your code is still checking for the basic auth. Either remove basic auth (if you want an unsecure bot) or add register as HTTPS.
I switched my server to https, now i have the authorization header but also get nothing but a 403 & "Sorry Bot isn't available right now". Still works in the emulator though!
*_Correction: no 403! Just the error message. *_
Did you update your sample with AppId and AppSecret from your bot's registration portal page? Is Emulator using appId/AppSecret from portal?
Yes, I'm using my own AppID & my own App Secret from the registration portal in my NodeJS script and emulator
is this alexr*bot ? with appSecret ending in d8?, I can't seem to hit your https://removed.de:removed/api/messages registration. Is that the right url?
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 52.29.235.61:YOURPORT
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at BotFrameworkEmulator.SessionModel.
Yes thats all correct. What do you mean you cant seem to hit the endpoint? I can reach it on my browser & postman. It's running on ubuntu on an aws machine
BTW: You can point the emulator directly to your endpoint, using your appId/appSecret to validate your bot directly.
Yes that works, my emulator is pointed at my endpoint and its working :/
really? hmmm.. let me spelunk in our logs and see if I can suss this out. Sorry for the trouble
No worries haha, this is fun :)
I'm experiencing the same thing, my bot's appId is makobot. Using HTTPS as well.

btw: when not using HTTPS, slack also receives a 403. Webchat always receives a 403 and the emulator always works
aha
You registration is wrong
Use the url that you have in the screenshot you sent me. I was able to talk to it, and what you had in your registration doesn't match that.
Are you talking about the endpoint on the registration page? Those are 1:1 the same

My bot IS receiving data from the microsoft backend. But isnt responding to it. It gets stuck before it reaches my code
It can take 5 minutes for our caches to clear. The data you just received was probably me using postman.
are you setting "Type" : "Message" on your reply?
I can reproduce this though. When i try to contact my bot through slack, i receive data. (I put a console.log in BotConnectorBot.js)
Can I control that? I thought slack was directly hooked up to botframework.com
Leave your bot up, I'm going to run the connector in my debugger and figure out what is going on. :(
Sure!
oh crud.
{"code":"InternalError","message":"Invalid Bot Framework Message"}
Yes, I get that too now. It's all stock though. I copied the sample from http://docs.botframework.com/builder/node/overview/#navtitle and installed the nodejs library using npm install --save botbuilder
yes, well, we came in pretty hot and I'm guessing our node guy broke something at the last minute. I will track him down and get it resolved.
Wooo awesome!
@tomlm If you need another bot to test...
appId: makobot
ok
I have figured out the problem
Somehow we had a regression in our switch and it is sending the json Pascal cased instead of camelCased. I will have to push a new connector build so it is probably an hour for me to resolve this.
I just updated the service and your bot is working now. Let me know if you have any more issues, and THANK YOU for your patience.
@kolanos makobot is working now too.
Hi @tomlm ,
Thx for reacting so swiftly! I had to head off to bed (european time).
I still seem to be having the problem.
My appId is: cvrbot
I've tried running it on https with my primay appSecret and appId, I've tried running it on http without the credentials and the middleware. But I still keep getting the 503 message.
Any clues?
This is what my server is logging:
at=error code=H12 desc="Request timeout" method=POST path="/api/messages" host=stark-bastion-61581.herokuapp.com request_id=cdebdbb9-e486-450e-9519-40cddeea682b fwd="137.135.87.153" dyno=web.1 connect=0ms service=30002ms status=503 bytes=0
The request is hitting the endpoint, but it doesn't get through the listen call.
Do the server have to use a specific port for it to work? ('ve tried with the different ones you are using throughout the examples)
I am getting 503 just trying to talk to your endpoint. There is something wrong with your web configuration.
Right you are @tomlm - thx a bunch!
@tomlm Could you please post some sample curl (with json data) for an endpoint?
The emulator is essentially a fancy wrapper around CURL. Look at the JSON data there, it is the raw json
Hello tomlm,
I got the same kind of issue, when accessing form Test Bot Connection (BotConnector Framework page):
{
"error": {
"code": "ServiceError",
"message": "_Sorry, CheckServiceAvailabilityApp is having a problem responding right now._",
"statusCode": 500
}
}
And it is not working in Emulator as well. (403 Forbiden).
I need your help to resolve it. And my bot id is:checkserviceavailability
Could you please reply to me as early as possible.
Thanks and Regards
Giri G.
You endpoint is registered as HTTP and we only send the security headers if your HTTPS.
Either register an HTTPS endpoint, or disable the check for appid/appsecret
From: giriganapathy [mailto:[email protected]]
Sent: Monday, May 2, 2016 4:44 AM
To: Microsoft/BotBuilder [email protected]
Cc: Tom Laird-McConnell Tom.[email protected]; Mention [email protected]
Subject: Re: [Microsoft/BotBuilder] Publishing simple NodeJs BotConnector example fails (#8)
Hello tomlm,
I got the same kind of issue, when accessing form Test Bot Connection (BotConnector Framework page):
{
"error": {
"code": "ServiceError",
"message": "Sorry, CheckServiceAvailabilityApp is having a problem responding right now.",
"statusCode": 500
}
}
And it is not working in Emulator as well. (403 Forbiden).
I need your help to resolve it. And my bot id is:checkserviceavailability
Could you please reply to me as early as possible.
Thanks and Regards
Giri G.
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHubhttps://github.com/Microsoft/BotBuilder/issues/8#issuecomment-216215259
Hello Tomlm,
As per your advice, i have commented the below line:
//server.use(bot.verifyBotFramework({ "appId": process.env.appId, "appSecret": process.env.appSecret }));
In spite of the above, i am still getting the same error:
"error": { "code": "ServiceError", "message": "Sorry, CheckServiceAvailabilityApp is having a problem responding right now.", "statusCode": 500
could you please also confirm whether the below service deployed in azure is really working:
http://checkserviceavailabilityvz.azurewebsites.net/api/messages
I would like to see the basic code running, before i start in-depth coding.
Appreciate your help on this. I am eagerly waiting for your reply.
Hello Tomlm,
Ignore my previous message. After disabled the appId/appSecret, as below:
server.use(bot.verifyBotFramework());
It worked in web-chat (using iframe with src pointing to my bot).
"type": "Message",
"id": "3OxiAkxtxAd",
"conversationId": "5ah4oXFz54O97ZG2Nm7RBBWP8pJX56X41Mk4L24kVENB3if",
"created": "2016-05-03T08:57:13.2238746Z",
"language": "en",
"text": "Hello...What is your name?",
"attachments": [],
"from": {
"name": "CheckServiceAvailabilityApp ",
"channelId": "test",
"address": "checkserviceavailability",
"id": "checkserviceavailability",
"isBot": true
},
"to": {
"name": "devportal",
"channelId": "test",
"address": "devportal",
"id": "JMQ0KLCKN6R",
"isBot": false
},
"replyToMessageId": "1wPLnMgp1XK",
"participants": [
{
"name": "devportal",
"channelId": "test",
"address": "devportal",
"id": "JMQ0KLCKN6R",
"isBot": false
},
{
"name": "CheckServiceAvailabilityApp ",
"channelId": "test",
"address": "checkserviceavailability",
"id": "checkserviceavailability",
"isBot": true
}
],
"totalParticipants": 2,
"mentions": [],
"channelConversationId": "checkserviceavailability",
"hashtags": []
Kindly help here.
That is by design. 😁
Sent from my tumbs
From: giriganapathymailto:[email protected]
Sent: 5/3/2016 2:04 AM
To: Microsoft/BotBuildermailto:[email protected]
Cc: Tom Laird-McConnellmailto:[email protected]; Mentionmailto:[email protected]
Subject: Re: [Microsoft/BotBuilder] Publishing simple NodeJs BotConnector example fails (#8)
Hello Tomlm,
Ignore my previous message. After disabled the appId/appSecret, as below:
server.use(bot.verifyBotFramework());
It worked in web-chat (using iframe with src pointing to my bot).
However, it is not working in "Test connection to your bot" section. Instead of textual response, it is sending entire json as below:
"type": "Message",
"id": "3OxiAkxtxAd",
"conversationId": "5ah4oXFz54O97ZG2Nm7RBBWP8pJX56X41Mk4L24kVENB3if",
"created": "2016-05-03T08:57:13.2238746Z",
"language": "en",
"text": "Hello...What is your name?",
"attachments": [],
"from": {
"name": "CheckServiceAvailabilityApp ",
"channelId": "test",
"address": "checkserviceavailability",
"id": "checkserviceavailability",
"isBot": true
},
"to": {
"name": "devportal",
"channelId": "test",
"address": "devportal",
"id": "JMQ0KLCKN6R",
"isBot": false
},
"replyToMessageId": "1wPLnMgp1XK",
"participants": [
{
"name": "devportal",
"channelId": "test",
"address": "devportal",
"id": "JMQ0KLCKN6R",
"isBot": false
},
{
"name": "CheckServiceAvailabilityApp ",
"channelId": "test",
"address": "checkserviceavailability",
"id": "checkserviceavailability",
"isBot": true
}
],
"totalParticipants": 2,
"mentions": [],
"channelConversationId": "checkserviceavailability",
"hashtags": []
}
Kindly help here.
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHubhttps://github.com/Microsoft/BotBuilder/issues/8#issuecomment-216473269
oh ok. thanks. I am able to test my chat in web chat. Its working perfectly.
One quick question: How to customize the web chat header. It is showing "Chat" with the background blue. I would like to change the text "Chat"...So can u please guide me here.
Hello tomlm,
Need your help again. I have registered a new bot. For some reason it is not working properly. Here is the behavior:
Web chat related issues.
Test the bot section:
It is saying always that 👍 I am sorry, i did not understand your answser.
Bot Emulator:
It is perfectly working in BotEmulator.
Other information:
App Id: VZChatBotApp
I have disabled the bot appId & secret keys as below in my code, since I use only http endpoint
server.use(bot.verifyBotFramework());
Please help me here...
Regards,
Giri G.
with respect to webchat, I noticed the below behavior:
it worked after deleting the below cookies, and refreshed the page:
ARRAffinity
UserId
To make the webchat work, I am deleting the above cookies everytime.
Can u please guide me here...
Regards,
Giri G
@tomlm My app works fine when I publish it to web but I get "403 forbidden" in emulator.
It used to work fine before in same project.
Not sure what is happening. I reinstalled emulator and rebuilt project but it doesnt help.
That only happens if appid/appsecret is mismatched between the appid/appsecret and your bot
From: dat nguyen [mailto:[email protected]]
Sent: Wednesday, May 11, 2016 7:52 AM
To: Microsoft/BotBuilder [email protected]
Cc: Tom Laird-McConnell Tom.[email protected]; Mention [email protected]
Subject: Re: [Microsoft/BotBuilder] Publishing simple NodeJs BotConnector example fails (#8)
@tomlmhttps://github.com/tomlm My app works fine when I publish it to web but I get "403 forbidden" in emulator.
It used to work fine before in same project.
Not sure what is happening. I reinstalled emulator and rebuilt project but it doesnt help.
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHubhttps://github.com/Microsoft/BotBuilder/issues/8#issuecomment-218483895
I am getting the same issue {"code":"InternalError","message":"Invalid Bot Framework Message"}
Can you tell me how to resolve it
Hello. Trying to setup a BotConnectorBot using node.js. The bot is responding fine over webchat and using the emulator.
Trying to have it receive and respond to Skype messages (connected the channel), I am getting 403 errors.
I am using an https endpoint in all cases. Any tips?
Running a skype bot directly works without problems
Hello, Tomlm, I can't get bot respond on webchat, I deploy my node.js and running on heroku, also can get this "ChatConnector: message received." respond, but my bot not have any messages for me, can you help me results the issues please, thank you so much.


i have built a simple nodejs bot with the example given but it give me 401 authorization error in emulator when irun it with ngrok https address
Hi guys,
Im getting this error
When trying to test my connection to the bot...I have appended /api/messages correctly as far as i can i don't see the error @tomlm
Hi guys, can anyone please help me solve this problem . . i am getting an ECONNREFUSED error:
C:\Users\geektrainer\Demos\node_modules>node hello.js
restify listening to http://[::]:3978
WARN: ChatConnector: receive - emulator running without security enabled.
ChatConnector: message received.
Error: connect ECONNREFUSED 127.0.0.1:9000
at Object.exports._errnoException (util.js:1026:11)
at exports._exceptionWithHostPort (util.js:1049:20)
at TCPConnectWrap.afterConnect as oncomplete
when we deploy our Bot application with Heroku.. which URL we need to give at message end point box..?
I found the error resulted in using, /api/messages, instead of /API/messages
@UsamaAslam The response to a ping should be something like res.sendStatus(200); in node or Request.CreateResponse(HttpStatusCode.OK); in c#.
Note: this GitHub issue is closed. Please post your question on Stack Overflow if you continue to have trouble with the Skype channel. The Microsoft Bot Framework team prefers that how to questions be submitted on Stack Overflow. The official Bot Framework Github repo is the preferred platform for submitting bug fixes and feature requests.
Most helpful comment
ok
I have figured out the problem
Somehow we had a regression in our switch and it is sending the json Pascal cased instead of camelCased. I will have to push a new connector build so it is probably an hour for me to resolve this.