I have now come to believe that it may be a Xojo issue. I have been trying to identify the root cause of another issue. There may be a connection. OK, step by step:
1- from the Postgresql logs:
2024-03-05 07:42:47.925 EST [3477] [inconnu]@[inconnu] LOG: connexion reçue : hÎte=172.16.99.104 port=58601
2024-03-05 07:42:47.961 EST [3477] postgres@GEOFF2_DEV LOG: connexion autorisée : utilisateur=postgres base de données GEOFF2_DEV application_name=DebugGeoff.exe
2024-03-05 07:42:47.972 EST [3477] postgres@GEOFF2_DEV ERREUR: erreur de syntaxe sur ou prÚs de « CONNECTION_CHECK » au caractÚre 1
2024-03-05 07:42:47.972 EST [3477] postgres@GEOFF2_DEV INSTRUCTION : CONNECTION_CHECK
2024-03-05 07:42:48.001 EST [3477] postgres@GEOFF2_DEV LOG: déconnexion : durée de la session : 0:00:00.076
The connection happens from my workstation, but then something fails. I donât think that it is my doing. More later
From the Xojo logs:
SyntaxError: Unexpected token '.'
at tryToEval (http://127.0.0.1:58183/framework/Xojo-xa59cf02ecb5cb05a.js:6:27116)
at parseResponse (http://127.0.0.1:58183/framework/Xojo-xa59cf02ecb5cb05a.js:6:26754)
at Object.success (http://127.0.0.1:58183/framework/Xojo-xa59cf02ecb5cb05a.js:6:25515)
at c (http://127.0.0.1:58183/framework/jquery-3-x27f3b64dee964807.5.1.min.js:2:28294)
at Object.fireWith [as resolveWith] (http://127.0.0.1:58183/framework/jquery-3-x27f3b64dee964807.5.1.min.js:2:29039)
at l (http://127.0.0.1:58183/framework/jquery-3-x27f3b64dee964807.5.1.min.js:2:79800)
at XMLHttpRequest.<anonymous> (http://127.0.0.1:58183/framework/jquery-3-x27f3b64dee964807.5.1.min.js:2:82254)
: startup: connected to sqlite db
: GEOFF2_DEV
: *************** not showing password
: postgres
: True
: startup: connection to PG database OK
: starting GoNext method
: reached checkpoint 1
: reached checkpoint 2
: reached checkpoint 3a
: Startup: killed existing connection
: startup: connected to sqlite db
: GEOFF2_DEV
: *************** not showing password
: postgres
: True
: startup: connection to PG database OK
: Startup: killed existing connection
: startup: connected to sqlite db
: GEOFF2_DEV
: *************** not showing password
: postgres
: True
07:58:24 : startup: connection to PG database OK
The token error is something I have been trying to resolve for a while. I canât figure it out. I thought that perhaps it had to do with my CSS file being incorrect, but this log is from a run without the CSS file. It comes from something else. Every new page triggers this error. Here, the login page was shown.
In the logs, the âGoNextâ method is called when the user enters UID and password, and the calculated hash code is successfully compared with the stored hash. Accessing the data in the database works. So, GoNext is called. It calls a succession of methods to load general session data. The first method called from GoNext loads menu texts (I converted everything else to localized constants, except menu texts. It is on the to do). The method fails. I added a call to the connection method, just to be 100% sure that the connection is still alive. From the logs, I know that it was. The method kills it and starts a new one.
I am pretty sure that this error in the Postgresql logs is not my doing. I could be wrong, though. 2024-03-05 07:42:47.972 EST [3477] postgres@GEOFF2_DEV ERREUR: erreur de syntaxe sur ou prÚs de « CONNECTION_CHECK » au caractÚre 1
I am getting close to creating a new issue with this, but perhaps it is my error. I am looking for insights before I proceed.
For reference, here is my connection method:
Dim DBName As String
Dim zz As String
Dim yy As String
Dim SVRStr As String
Dim IniPath As String
Dim mDb As SQLitedatabase
Dim SQL As String
Dim RS1 As RowSet
'' Kill the existing connection if it exists
If Me.IsConnected = True then
Me.Con.Close
Me.Isconnected = False
System.debuglog "Startup: killed existing connection"
End If
' Open parameter file
Inipath = App.ExePath + "GeoffParam.sqlite"
Me.IniPath = IniPath
Dim dbFile As New FolderItem(Inipath, FolderItem.pathModes.Native,False)
Try
mDb = New SQLiteDatabase
mDb.DatabaseFile = dbFile
mdb.CreateDatabase
System.debuglog " startup: connected to sqlite db"
Catch e As runtimeexception
MessageBox e.Message
End Try
' Get PostgreSQL parameters
SQL = "Select * from ConnParam where Environnement = '" + ZKey + "';"
RS1 = mDB.SelectSQL(SQL)
DBName = RS1.Column("dbname").StringValue
SVRStr = RS1.Column("serveur").stringvalue
zz = modutil.strzz(RS1.Column("Pass").StringValue)
zz = zz.Left(8)
yy = RS1.Column("uid").StringValue
System.Debuglog DBName
System.Debuglog zz
System.Debuglog yy
Me.Con = New PostgreSQLdatabase
Me.Con.Host = SVRSTR
Me.Con.UserName = yy
Me.Con.Password = zz
Me.Con.AppName = App.ExecutableFile.Name
Me.Con.DatabaseName = DBName
system.debuglog con.connect.ToString
Try
Me.Con.Connect
Self.IsConnected = True
System.debuglog "startup: connection to PG database OK"
Return True
Catch Error As DatabaseException
MessageBox("Error: " + error.Message)
System.debuglog "startup: connection to PG database Failed"
Return False
End Try
And the first failing method (it does the menu text retrieval)
'method called from checkpoint 3a
Dim B as Boolean
Dim RS1 As RowSet
'Make sure we are connected to the selected environment
B = Session.SetSessionConn(Session.ZENV)
'prepare to read the 50 records in the menu text table
Dim psGetMenuTxt As PostgreSQLPreparedStatement = Me.con.Prepare("Select txtid,texte FROM geoff.stxt WHERE langue = $1 ORDER BY txtid asc")
'Go.
psGetMenuTxt.bind(0, langue)
RS1 = psGetMenuTxt.SelectSQL
If rs1.RowCount >0 Then
Redim Me.MenuText(-1)
Me.Menutext.Add(langue)
While Not RS1.AfterLastRow
Me.MenuText.Add(DefineEncoding(rs1.Column("texte").value, encodings.UTF8))
rs1.MoveToNextRow
Wend
end if
rs1 = Nil
Bottom line: Please let me know if I do something to trigger the database error. Otherwise, it looks like a case for a new issue.
Thanks.
LD