AI Zone Admin Forum Add your forum

NEWS: survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Name undefined

Hello again. :D
I know I’m annoying with these new topics but there is no other options. Sorry.
So hmm, I have 2 bot in program-o. First bot in english and other in hungarian.
In the first bot recognize if the users did not give their names and so I get for name Seeker.
BUT if I test same thing with second bot then I get undefined instead Seeker or Anonymous.

Thanks I think you are very intelligent too, <get name="name"/>.

UserYou are smart
Thanks I think you are very intelligent tooSeeker

But with second bot I get this:

Thanks I think you are very intelligent too, undefined.

I went to admin panel in program-o and clicked to Current Bot: Lucy (which is under Home menu) and I wrote Anonymous to Unknown User and clicked to Update.
Is it a bug in program-o or I did something wrong?


  [ # 1 ]

I don’t think you did anything wrong, Kálmán. Out of curiosity, did you see this problem before or after you downloaded the latest version of Program O today? If before, are you still seeing the problem? I ask because I have over a dozen chatbots on my development install of Program O, some of them stand-alone chatbots, and some children of the main bot named FooBot. In all instances I’m seeing what I expect to see. If you’re still seeing “undefined” when you expect something else then chances are that there’s something in the error logs that may give an indication as to why. Please look in the logs folder for the file error.log (that’s the main log file for the chatbot). If it exists, either rename the file (to preserve those log entries for now) or delete it (your choice), then try talking to both bots again, using the same input of “you are smart”, and check again to see if there’s a new error log. If there is, I ask that you copy the file to error.log.txt and attach that file to your next post (click on “Advanced Reply” to get that option) and I’ll look into it. You’ll need to have that .txt file extension because the forum software won’t allow you to attach a .log file here for security reasons.

If there is no new error log then we’ll have to attack this problem from another angle.


  [ # 2 ]

I attached the errorlog.
Otherwise only these lines I get:

11/11/2017 20:18:54 PHP ERROR [Warning] -UnknownThe session id is too long or contains illegal charactersvalid characters are a-zA-Z0-and '-,' in Unknown on Line 0

/11/2017 20:18:54 PHP ERROR [Warning] -UnknownFailed to write session data (files). Please verify that the current setting of session.save_path is correct (C:\xampp\tmpin Unknown on Line 0 

I had this problem before also but I didn’t think to this too much.

Here is the bot settings:

Summary: With first bot works perfectly. I get Seeker text to <get name=“name” >. But if I try use in second bot then I don’t get Seeker, instead I get undefined.

File Attachments
error.txt  (File Size: 1KB - Downloads: 16)

  [ # 3 ]

Ok, next question. Which GUI are you using to test your bot with? Is it one of the default versions supplied by Program O, or one of your own design?

If it’s one of the three main GUI pages (HTML, XML or JSON) you can add a convo_id to the query string in order to bypass those two errors. Something like this would probably work:


This will set the default conversation ID (and thus, the session name) in such a way as to not trigger those errors. Then you can try again and see if you still get the same problem with the “undefined” user name.


  [ # 4 ]

Little better. Now I don’t get error.log file and those 2 lines but the undefined part is the same.
I tried with all 3 GUI and only with one works.
I tried so:

With HTML I get Seeker, so with works ok. Hmm cool but there is a solution that I can get json instead? Because my game get JSON values from program-o.


  [ # 5 ]

Hmm I can’t edit above post.
I attach the debug file. Probably you can see something.

I found this:

11-11-2017 21:19:05.08112[1][1] Elapsed time1.060 milliseconds
Found an error trying to identify the chatbot

Probably you can find more.
Plus I see now that if I add in url convo_id=test then the Conversion ID: right up side doesn’t change. Only in html/plain change.

File Attachments
8il12n69e8me7isg6jtmaeuatp.txt  (File Size: 56KB - Downloads: 10)

  [ # 6 ]

The debug file would actually be named test.txt if you’re using that conversation ID. this is how Program O tracks the individual users, along with their debug files.


  [ # 7 ]

I know. As before I mentioned. I added in url convo_id=test and with json GUI doesn’t change the ID, instead generate new id. This id thing only works with html/plain GUI.

Now I deleted the program-o and I did a fresh install. The result is same.
If you do so:
- Fresh install
Pattern: What is my name

Your name is <get name="name" />. 

- If you try then it works

Second step:
- Add a new bot and choose the second bot
- Add the same aiml
- Test it with second bot

Then you will get: Your name is undefined.


  [ # 8 ]

Let me try using the JSON GUI for testing this time, so that we’re on the same page, so to speak.

{time passes}

AHA!!! It seems that while the HTML and XML GUI pages both work as expected, the JSON GUI, however, is not. I’ll do some further testing to see why this is. Details soon. smile


  [ # 9 ]

Hmm very interesting.
If I change the Unknown name to other word and test with first bot then I don’t get the new value. BUT if I delete Program_O_JSON_GUI cookie in my browser and test again then I get the new value.

If I use json API then I get this:

{"convo_id":"MrAlicardteszt","usersay":"what is my name","botsay":"Your name is Ismeretlen2.","botData":{"convo_id":"MrAlicardteszt","bot_name":"Lucy","bot_id":"1","format":"json","unknown_user":"Anonymous","user_name":"Ismeretlen2","user_id":"4","totallines":1,"conversation_lines":"1","remember_up_to":"10","debugemail":"[email protected]","debug_level":"4","debugmode":1,"save_state":"session","default_aiml_pattern":"RANDOM PICKUP LINE","bot_parent_id":"1","rawSay":"what is my name","aimlData":{"id":"1","bot_id":"1","pattern":"WHAT IS MY NAME","thatpattern":"","topic":"","filename":"admin_added.aiml","template":"Your name is <get name=\"name\"\/>.","score":266,"current_that":"your name is ismeretlen2","aiml_id":"1","track_score":"current bot, no thatpattern to match, direct pattern match, direct word match: what, direct word match: is, direct word match: my, direct word match: name"}}} 

Program-o see that unknown_user is Anonymous but in sentence I get previous unknown user value. Before was Ismeretlen2.
You can see here: is my name&convo_id=MrAlicardteszt&format=json

If I try with second bot the JSON API, then there is no chance to get the value. a nevem&convo_id=MrAlicardteszt&format=json

[edited for security reasons}

I uploaded the program-o to webhost and now I use PHP 7.0 version. If I test this with xampp which has php 7.1.6 version also then I get the same result.


  [ # 10 ]

Very rarely do I ever need access to the admin page, so long as I have the URL to the chatbot itself, so posting a link to the admin page, along with the credentials to log in is a HUGE security risk. It might not be a bad idea to at least change the password for that login as soon as possible to avoid any potential problems.

I found the bug for this problem, and will be pushing the fix later this morning (it’s my “wake-up gaming time” right now, which is important to my sanity). As soon as I get the fix pushed I’ll create an issue on GitHub that references this thread, then post the URL to that issue here so that others can find it more easily.


  [ # 11 ]

Thank you for your efforts. You are my hero. :D
It’s ok, because I installed only for test purpose to the webhost. I didn’t plan to run the program-o on webhost, but thank you that you deleted the login part. smile


  [ # 12 ]

Hmm I think that I know what is the problem in theory.
I tested now all things on program-o.
- If convo_id is the same and recognized unknown name as Seeker then it will remains. So if you change in Currently bot to new unknown name then it will not update on currently clients the name.

I have this pattern and template:
Pattern: what is my name
Template: My name is <get name=“name” >.

And unknown name is: Seeker

If the user talk with the bot and first time ask the bot what is my name then the bot will save the user with configured unknown name.
But if you change the unknown name to Anonymous and after you ask again the chatbot with same convo_id as before then in users details will not update to new name instead stay with old name because it saved before and the program-o doesn’t update the name again, instead use the old name.
So yeah, when there is new client then the new value of unknown name will saved but doesn’t update.

I noticed this when I changed the save state to database and in database also doesn’t update the name part in client_properties table.

So undefined part also saved (I think) as client name somehow.
I think he has the same problem as I have:


  [ # 13 ]

After carefully looking at the problem I was able to trace this down to a bug in the code that hard-codes “undefined” without checking other possible options. This has been corrected in my latest update. I’ve also posted an issue about this at so that others can find this.

I’ve also looked at the other issue on GitHub that you linked to, and while the symptoms seem to be similar, they aren’t the same, so I don’t think that the fix for this issue will fix theirs. But I don’t have all the information I need yet, so we’ll just have to wait and see. smile

Anyway, please give the DEV branch a try on GitHub. the most recent update should take care of your issue. you can find it at


  [ # 14 ]

Cool. :D Now I don’t get everytime undefined with 2 bots. Thank you again. You saved my life again. :D


  [ # 15 ]

That’s what I’m here for. :D Please let me know if you run into any more difficulties.


  login or register to react