AI Zone Admin Forum Add your forum
Cannot load default ChatScript bot on an EC2 instance
 
 
  [ # 31 ]

Just tried that.
Something went wrong, because this is the bot’s response.

Rose: , “msgmapKeyValueObjs”: { "keyValueObjs": [{ "key": "Server call to load bot data failed. I'll keep trying each volley for", "defaultMsg": "Server call to load bot data failed. I'll keep trying each volley for"} ] } , “resolvedMsg”: “Server call to load bot data failed. I’ll keep trying each volley for”, “pausedContextIds”: [] , “volley”: 5, “usedtime”: 2344} ] Server call to load bot data failed. I’ll keep trying each volley for Installed and Private/enterprise

 

 

 
  [ # 32 ]

What port did you start CS on? Did you open this port in the security group for that instance?  Did you turn on UFW?  (FIREWALL) if you did, did you add the exception?  Did you perhaps take the ip assigned to the server, then stop and start the ec2 instance?  If you aren’t using an elastic ip, the ip and dns will have changed and you will have to reflect this elsewhere.

Did you start the server using its private ip and CS PORT?

Did you update the ui.php to point to your servers PUBLIC address and CS Port and chosen bot name?
Lines 28-32 ui.php in BETTER
//  =============  user values ====
$host = “domain.or.ip.address.com”;  //  <<<<<<<<<<<<<<<<< YOUR CHATSCRIPT SERVER IP ADDRESS OR HOST-NAME GOES HERE
$port = portCSIsRunningOn;      // <<<<<<< your port number if different from 1024
$bot = “Harry”;    // <<<<<<< desired botname, or “” for default bot
//=========================


Do you get any errors related to permissions?

 

 
  [ # 33 ]

I have checked the security group and double checked the private and public IP addresses as well as the ports related to them.

in the /BETTER folder should it be mapped to the public IP? As I currently have them mapped to the private one instead.

 

 
  [ # 34 ]

Yes, from the web, you use the PUBLIC IP, you only use the private ip to spawn the server in terminal.  From OUTSIDE, you would have to use the public IP, and the same port your started CS on with your private IP.

 

 
  [ # 35 ]

Ok so far I done the following things:
- Updated all my packages
- Killed all the PID’s that relate to the LinuxChatScript64 process
- Checked and updated the IP addresses in both index.php (SIMPLE) & ui.php(BETTER) in the WEBINTERFACE directory.
  So they reflect the Public IP address.

To be honest I haven’t touched the UFW and for the time being I might stay away from it until I am a little bit more familiar.

What else can I do?

 

 
  [ # 36 ]

Try adding IPTABLES for the port you opened for CS.

sudo iptables -A INPUT -p tcp—dport 1024 -j ACCEPT

Also, check if ufw is off.  It should be by default.
sudo ufw status

Also, load up the SIMPLE web interface rather than BETTER making sure you change the servers public ip, or dns.  DO NOT PUT IN HTTP or HTTPS as this is a socket connection.  Just either the ip, or the domain (DNS).

if your domain is http://www.somedomain.com Use this for $ host.  Not http://www.somedomain.com, if ip, JUST the ip, no http or https.

index.php - SIMPLE
(NOTE: I am using a subdomain so its added.
$host = “somesubdomain.kadho.com”;  //  <<<<<<<<<<<<<<<<< YOUR CHATSCRIPT SERVER IP ADDRESS GOES HERE
$port = 1024;    // <<<<<<< your portnumber if different from 1024
$bot = “Harry”;  // <<<<<<< desired botname, or “” for default bot

Aside from that, you can give me access to it to fix.  Its a brand new instance so it shouldnt be a concern and you can always make an image of it first and make a new key/value pair to re launch after with.  Email me if youd like to go that route, there isn’t too much more I can do just speculating.

 

 
  [ # 37 ]

Reaquire TOPIC folder from latest github

 

 
  [ # 38 ]

So, to follow up, I have just finished fixing Timothy’s EC2 CS Server.

A few things to note in case others have troubles on AWS or just initial ubuntu setup.

- Be careful where you install the server.  Permissions will stop you from building, and you dont want to have to set bad permission practices just to brute force a goal.  If you install to /etc ,where things like apache2 and vsftpd, and other servers, you will have to run everything as sudo, including your crontab.

-It may seem like /var/www/html/ChatScript is a good place to put your files up quickly and be able to launch the server and edit the web interface from one place, but this really isn’t the place.  I fear I may have thrown you in earlier pastes of my setup showing I was using port 8080. I was only using that because I was testing an SSL ProxyPass.  In reality, the chatscript core should be on your file system outside of the web root.

AWS EC2 Setup Break Down

- Launch ubuntu instance (I use 16.04)
- Create a security group opening incoming tcp ports (80,443,1024)
- Create elastic ip.  The name is somewhat confusing, but this is basically a static ip.  If you dont use one, every time you stop and start your server, or it reboots, you will get a new IP and DNS and private IP and you will have to go change all of your settings.  Plus, if you every want to point a (CNAME) at it, youd want this static (elastic ip).
- Update apt-get, install apache2, install php, make sure php mod is enabled with apache2, restart apache2.
-Goto /var/www and set the www-data user/group to own the html folder and its children.
-Add ubuntu to www-data group and set permissions on the files in /var/www/html to allow group control.
-Add a crontab -e to make sure your CS instance persists.
-If using ufw, make sure to open the proper ports.
-Use git to clone the latest version of CS into the location of your preference.
-Set permissions on the files, the docs say you only have to do this on the LinuxChatScript64 file, but I had to do it on the entire ChatScript folder as there are dependencies and files created at start time, and it was failing to create the USERS and LOGS folders due to permissions and halting the server and keeping me from the first build.
Once you spawn your server, you can connect with the client, or just local to the CS server instance in the shell, and do your first build.  :build Harry.

To start your CS server correctly on AWS, DO NOT USE localhost, use your instance’s PRIVATE IP ADDRESS.
(e.g ./LinuxChatScript64 interface=172.00.0.000 port=1024) <- 172.00.0.000 being the PRIVATE IP associated to your amazon aws EC2 instance that CS server is running on.

-Put the front end files of your choice from WEBINTERFACES somewhere in your /var/www/html to your liking, edit the php files to point to your PUBLIC EC2 instance or DNS, and set the port CS is listening on, as well as a bot name.  If this doesnt work still, it’s likely you have a permission issue where ChatScript and its contents are still owned but root:root and www-data cannot execute the php.

I want to state that I am no linux expert, I have enough knowledge to make things work and get around, and I do strive for best practices, but please note that you must take special care on your own to make sure your system remains secure.

-Cheers!

Brian Hodge - Technical Director
Kadho Inc. / Kadho Sports

 

 < 1 2 3
3 of 3
 
  login or register to react