AI Zone Admin Forum Add your forum

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

CS: writing some files to postgres
 
 

I thought postgres was working, but I started closing down the log writing and I decoded the postgres bytecode and I noticed it was not updating postrges with the user data. And it was throwing errors to the log file. “Postgres filessys write failed “

Well, i have been stuck trying to get postgres to work.
One file is writing to postgres, but this file is not.
not working: USERS/topic_100125174_harry.txt
working: USERS/topic_100125174_share.txt

BUG: Wed Jun 05 23:46:36 2019: input:1 Postgres filessys write failed for USERS/topic_100125174_harry.txt caller:100125174 callee:harry at in sentence: hey ya
Postgres filessys write failed for USERS/topic_100125174_harry.txt
MinReleaseStackGap 79MB MinHeapAvailable 80MB
MaxBuffers used 7 of 80

However, I am writing to postgres. 
USERS/topic_100125174_share.txt
jul2116 Jun05’19-23:46:36 Jun05’19-23:46:36 0 |
1 1 0 DY 0 96 96 0 # start, input#, no rejoinder, #0topics, #1topics, layer2
~introductions ~common_questions_all #pending
#`end topics
$cs_trace=0
$cs_time=0
#`end variables
0 #set flags
#`end fact sets
#`end user facts 0
#context
hey ya
#`end user
What is new with you?
#`end chatbot

This is a deep mystery to me. I am not sure what could be wrong here. Do you have any thoughts, maybe?

 

 
  [ # 1 ]

I do not think this will be a real issue, as it appears to be only server traffic and not the actual user traffic.

I am going to add Noserverlog to the cs-init.txt file,  so I do not store a user-bot log.

 

 
  [ # 2 ]

noserver log refers to server log in LOGS. 
nouserlog refers to user logs in USERS except that bugs are still reported to user logs (i will fix that next release)

I dont know what you mean by server traffic

 

 
  [ # 3 ]

I guess i am calling this file server traffic
USERS/topic_100125174_harry.txt
I dont know if this file is essential, because i am not able to write it to postgres.
I am writing the error that is above.
The other file,
USERS/topic_100125174_share.txt
Is writing to postgres,  which is great and it is a mystery why half of it works.
In any event, i cant tell if the file that is written is correct.
And if anything critical seems to be missing.

I will have to test it today and see if it is retaining the variables by doing a few volleys and checking :variables.

 

 

 
  [ # 4 ]

USERS/topic_*  are essential
and you are using shared bot capability which is why _share file exists

 

 
  [ # 5 ]

It seems to be working.

MY TEST: I opened up the web interface for three physically different servers, with different IP addresses, all pointing to the same postgres.
I sent the same message using the same name to all three.
All three messages show up in the postgres USERS/topic_1742251328_share.txt
There is no USERS/topic_1742251328_botname.txt file in postgres or the server USERS or LOGS directory.
I only see USERS/log-1742251328.txt

Maybe it is retrieving the _share file from postgres in all cases?
I do not know if there is a better way, but this seems to be working.
I guess it would be faster to write _botname file to local disk in each volley. And use this, if we could somehow identify that it is the latest USERS/topic_* by the volley count.  If not, go to postgres and get _share.
It would almost always be faster to do this, but I dont know if CS has this built in.
In any case, I don’t know how I can test that it does not work.
Also, memory for new facts works between the servers. It remembers my name across servers, when supplied….

So, maybe it is working (?)

USERS/topic_1742251328_share.txt
jul2116 Jun07’19-14:46:48 Jun07’19-14:47:12 0 |
1 3 ~introductions WPb F39R?Is*Ok3 DY 0 390 390 0 # start, input#, rejoindertopic,rejoinderid (a:  ( [ ~yes ~goodness ] $share_name?~boynameus ) Ok ^pick ( ~mmm ) great ^pick ( ~mmm ) $sh…  ),checksum
~cs_activities ~introductions #pending
#`end topics
$share_name=bang
$cs_trace=0
$cs_time=0
#`end variables
0 #set flags
#`end fact sets
#`end user facts 0
#context
hi
hey
bang
#`end user
XXX You do yoga XXX
XXX That is great. how are you called? XXX
XXX I will call you bang. Ok there?  XXX  
#`end chatbot

 

 
  login or register to react