Quick Installation Guide
Quick and dirty installation guide on how to get started with Botstackjs.
https://github.com/cama/botstackjs/blob/master/README.md#installation
Hello cama,
What could be the reasons this error after launching index.js, .env - ok, modules - ok
Terminal = ' file: 'util.js', function: 'exports._exceptionWithHostPort', line: 1045, method: '_exceptionWithHostPort', native: false }, { column: 14, file: 'net.js', function: 'TCPConnectWrap.afterConnect [as oncomplete]', line: 1087, method: 'afterConnect [as oncomplete]', native: false } ], stack: [ 'Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379', ' at Object.exports._errnoException (util.js:1022:11)', ' at exports._exceptionWithHostPort (util.js:1045:20)', ' at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1087:14)' ] }'
Debugger = `2017-02-22T11:45:02.876Z - error: uncaughtException: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379 { date: 'Wed Feb 22 2017 13:45:02 GMT+0200 (FLE Standard Time)', process: { pid: 7616, uid: null, gid: null, cwd: 'c:\FB_Cust_Automation', execPath: 'C:\Program Files\nodejs\node.exe', version: 'v6.9.5', argv: [ 'C:\Program Files\nodejs\node.exe', 'c:\FB_Cust_Automation\index.js' ], memoryUsage: { rss: 132177920, heapTotal: 103837696, heapUsed: 57976824 } }, os: { loadavg: [ 0, 0, 0 ], uptime: 12182.0241738 }, trace: [ { column: 11, file: 'util.js', function: 'Object.exports._errnoException', line: 1022,
I am running VS code on windows 10, node.js, git for windows and modules - latest versions
express.listen(80) is creating a server normally btw
What do I need to configure on the AWS system, except bucket name?
Hello, @Danail-Irinkov .
Yet BotStackJS depends on Redis. In the future we will make this dependency optional.
So now you need to start Redis to solve this issue.
Thank you very much, I am trying to use virtual box to start redis server in ubuntu :)
Thanks Danail for giving Botstackjs a go. Let me know if you have any more challenges getting it working. I've created an issue to make REDIS optional and use MongoDb for Sessions. It will simplify deployment and meet most use cases. https://github.com/cama/botstackjs/issues/3
@Danail-Irinkov Would a demo repo that extends BotstackJS be useful?
https://github.com/cama/botstackjs/issues/4
We could possible stand up a shared mongoDB\REdis instance so all you have to do is deploy the code to a Heroku instance, update a few env variables like API.AI and be up and running.
Cam
Hello Cam,
great to hear from you :)
I did already start a redis server on my machine, have a look at the screenshot :)
ngrok is a free SSL tunneling service and works fine with app.listen()
But since I am completely new to this field, I struggle to find info on the specifics of how I should connect all the modules of everything.
Can you please explain to me what all the modules are used for in BotStackJS?
Why(What for) do you use?
AWS? S3? Redis? API.ai? Dashbot? Bot-metrics(kinda obvious) DynamoDB? (should be installed on the redis server? I am not quite sure what do I need to do to set it up and running :))
I pretty much have read half the code to be able to start it to this stage that the screenshot shows, so I have a decent Idea already, but It will be very helpful to know definitely why do we need the services :)
Kind regards, Dan
On 23 February 2017 at 01:53, Cameron McGrane [email protected] wrote:
@Danail-Irinkov https://github.com/Danail-Irinkov Would a demo repo that extends BotstackJS be useful?
#4 https://github.com/cama/botstackjs/issues/4
We could possible stand up a shared mongoDB\REdis instance so all you have to do is deploy the code to a Heroku instance, update a few env variables like API.AI and be up and running.
Cam
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cama/botstackjs/issues/2#issuecomment-281844437, or mute the thread https://github.com/notifications/unsubscribe-auth/AYjPquVrsTfcjpnsN44CbgqiITahYezMks5rfMp_gaJpZM4MFyDi .
Is there an easy way to skip the Api-ai event processing and redirect it to code in node.js? So I can experiment with FB webview quicker? and then to turn it back to api.ai?
On 23 February 2017 at 13:02, Danail Irinkov [email protected] wrote:
Hello Cam,
great to hear from you :)
I did already start a redis server on my machine, have a look at the screenshot :)
ngrok is a free SSL tunneling service and works fine with app.listen()
But since I am completely new to this field, I struggle to find info on the specifics of how I should connect all the modules of everything.
Can you please explain to me what all the modules are used for in BotStackJS?
Why(What for) do you use?
AWS? S3? Redis? API.ai? Dashbot? Bot-metrics(kinda obvious) DynamoDB? (should be installed on the redis server? I am not quite sure what do I need to do to set it up and running :))
I pretty much have read half the code to be able to start it to this stage that the screenshot shows, so I have a decent Idea already, but It will be very helpful to know definitely why do we need the services :)
Kind regards, Dan
On 23 February 2017 at 01:53, Cameron McGrane [email protected] wrote:
@Danail-Irinkov https://github.com/Danail-Irinkov Would a demo repo that extends BotstackJS be useful?
#4 https://github.com/cama/botstackjs/issues/4
We could possible stand up a shared mongoDB\REdis instance so all you have to do is deploy the code to a Heroku instance, update a few env variables like API.AI and be up and running.
Cam
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cama/botstackjs/issues/2#issuecomment-281844437, or mute the thread https://github.com/notifications/unsubscribe-auth/AYjPquVrsTfcjpnsN44CbgqiITahYezMks5rfMp_gaJpZM4MFyDi .
Hi @Danail-Irinkov . Yes, you can override class method textMessage or / and postbackMessage and add your custom behaviour.
Thank you :) I got to know the code a lot better now. I managed to start running it and post some custom replies and buttons. It will happen shortly :)
On 27 February 2017 at 14:46, webus [email protected] wrote:
Hi @Danail-Irinkov https://github.com/Danail-Irinkov . Yes, you can override class method textMessage or / and postbackMessage and add your custom behaviour.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cama/botstackjs/issues/2#issuecomment-282710092, or mute the thread https://github.com/notifications/unsubscribe-auth/AYjPqmYHnaK0yaypL2DxPKq44N0sID47ks5rgsWmgaJpZM4MFyDi .
Hi Dan
Here is the updated list of what's in and out why we to use and whether you need them:
In
S3 [optional] - scalable storage for media like images and video REDIS - scalable in memory cache for storing session state. It's in the backlog to make this optional and by default use Mongodb for session state API.AI - Natural Language Programming DASHBOT [optional] - Third party analytics and broadcast platform Botmetrics [optional] - Third party analytic platform. Less features than Dashbot but has a useful bot for checking metrics.
Out
Dynamos - Removed. Using Mongodb
Hope this helps.
Cam
Dear Cam,
thank you, yes it helps a lot.
It is a big mess when you first get into bots, because of all the competing services you can use ==> I wasnt sure how exactly the BotStack is depending on them.
However now I began to understand.
I faced two bugs though, I guess you know about one of them - the fallback function and the other one is serving static files on localhost.
-
fallback(message, senderID) { log.debug("Unknown message", { module: "botstack:fallback", senderId: senderID, message: message }); //fb.reply(fb.textMessage("Ops, internal short circuit... Shutting down... :("), senderID);* ----why does it happen that when this line is active it loops constantly?* };
-
This is inside the Class BotStack:
this.server.get('/images/', (req, res, next) => { //res.send(__dirname + '/images') let serveData = { directory: './images', -------- I cannot understand where is the root for this restify function and it just won't serve an html from a subfolder. I tried for 2 hours different debugging things and couldn't find it... file: 'images.html', } restify.serveStatic(serveData), });
Kind regards, Dan
On 27 February 2017 at 23:10, Cameron McGrane [email protected] wrote:
Hi Dan
Here is the updated list of what's in and out why we to use and whether you need them:
In
S3 [optional] - scalable storage for media like images and video REDIS - scalable in memory cache for storing session state. It's in the backlog to make this optional and by default use Mongodb for session state API.AI - Natural Language Programming DASHBOT [optional] - Third party analytics and broadcast platform Botmetrics [optional] - Third party analytic platform. Less features than Dashbot but has a useful bot for checking metrics.
Out
Dynamos - Removed. Using Mongodb
Hope this helps.
Cam
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cama/botstackjs/issues/2#issuecomment-282854291, or mute the thread https://github.com/notifications/unsubscribe-auth/AYjPqpGnDOgShSHXiK1_aX6I35-VK9afks5rgzvBgaJpZM4MFyDi .
Hi @Danail-Irinkov
- fallback(message, senderID) { log.debug("Unknown message", { module: "botstack:fallback", senderId: senderID, message: message }); //fb.reply(fb.textMessage("Ops, internal short circuit... Shutting down... :("), senderID);* ----why does it happen that when this line is active it loops constantly?* };
This happens when Facebook sends messages that BotStackJS not yet able to handle correctly. Typically, this is a service message from facebook. In the future we will properly handle.
- This is inside the Class BotStack: this.server.get('/images/', (req, res, next) => { //res.send(__dirname + '/images') let serveData = { directory: './images', -------- I cannot understand where is the root for this restify function and it just won't serve an html from a subfolder. I tried for 2 hours different debugging things and couldn't find it... file: 'images.html', } restify.serveStatic(serveData), });
Under the hood BotStackJS uses Restify, perhaps you should read the documentation on restify.serveStatic
Usually the root directory is the directory where you run node for execution.
BotStackJS can serve static files for you. All you just need to set 2 environment variables: BOTSTACK_STATIC and BOTSTACK_URL.
For example, you can set this value: BOTSTACK_STATIC=./media
And next create public path inside media (it's Restify issue). After this you can get your files by this URL for example : http://localhost:3000/public/myfile.png
BOTSTACK_URL reserved for future use. You can setup this variable with empty value: BOTSTACK_URL=
Thank you, for the help a lot :), I also thought it was a restify issue :) A small bug report: in session.js:
let clearOldSessions = co(function* () { let not = new Date(); //possible bug with now=undefined, I guess it should be 'now' here :) let sessionsSize = yield client.hlenAsync("sessions"); let sessions = yield client.hgetallAsync("sessions"); for (senderId in sessions) { let data = JSON.parse(sessions[senderId]); if (Math.abs(now - data.lastUsed) > maxSessionAge_ms) { client.hdelAsync("sessions", senderId); } } let sessionsSizeNow = yield client.hlenAsync("sessions"); console.log('Session Size ' + sessionsSizeNow + ' items. Removed ' + (sessionsSize - sessionsSizeNow) + ' items'); });
On 1 March 2017 at 14:39, webus [email protected] wrote:
Hi @Danail-Irinkov https://github.com/Danail-Irinkov
- fallback(message, senderID) { log.debug("Unknown message", { module: "botstack:fallback", senderId: senderID, message: message }); //fb.reply(fb.textMessage("Ops, internal short circuit... Shutting down... :("), senderID);* ----why does it happen that when this line is active it loops constantly?* };
This happens when Facebook sends messages that BotStackJS not yet able to handle correctly. Typically, this is a service message from facebook. In the future we will properly handle.
- This is inside the Class BotStack: this.server.get('/images/', (req, res, next) => { //res.send(__dirname + '/images') let serveData = { directory: './images',
-------- I cannot understand where is the root for this restify function and it just won't serve an html from a subfolder. I tried for 2 hours different debugging things and couldn't find it... file: 'images.html', } restify.serveStatic(serveData), });
Under the hood BotStackJS uses Restify https://github.com/restify/node-restify, perhaps you should read the documentation on restify.serveStatic https://github.com/restify/node-restify/blob/c7aa7786a4cb6a2d8fe2862c46aca1f726ff8f7c/docs/pages/components/plugins.md#serve-static
Usually the root directory is the directory where you run node for execution.
BotStackJS can serve static files for you. All you just need to set 2 environment variables: BOTSTACK_STATIC and BOTSTACK_URL.
For example, you can set this value: BOTSTACK_STATIC=./media And next create public path inside media (it's Restify issue). After this you can get your files by this URL for example : http://localhost:3000/public/myfile.png
BOTSTACK_URL reserved for future use. You can setup this variable with empty value: BOTSTACK_URL=
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cama/botstackjs/issues/2#issuecomment-283329414, or mute the thread https://github.com/notifications/unsubscribe-auth/AYjPqri7HSmYl2P06ck97bQtC3df_1meks5rhWcFgaJpZM4MFyDi .