romanstr
05/31/2023, 8:56 AM<cfquery name="qryUpdateFTs" datasource="#pvtDSNInnovare#">
UPDATE Policys2PrFeesTaxes
SET
CommissionGANB = <cfqueryparam cfsqltype="CF_SQL_DECIMAL" value="6 5" scale="2">
WHERE
Policy2PrFeeTaxID=<cfqueryparam cfsqltype="CF_SQL_INTEGER" value="2">
</cfquery>
In debug I see (and in database):
UPDATE Policys2PrFeesTaxes
SET
CommissionGANB = 45082
WHERE
Policy2PrFeeTaxID=2
ACF gives error "*Invalid data 6 5 for CFSQLTYPE CF_SQL_DECIMAL."*
Is it bug in Lucee? What's the conversion algorithm converts "6 5" to "45082". I see incorrect value "36865.00" in database and need to understand what user has entered.zackster
05/31/2023, 4:40 PMzackster
05/31/2023, 4:52 PMzackster
05/31/2023, 6:49 PMgsr
05/31/2023, 7:13 PMAbdul Raheem
05/31/2023, 8:36 PM<cfset tesseract = createObject("java", "net.sourceforge.tess4j.Tesseract")>
<cfdump var="#tesseract#">
but it's throwing the error in the native dump.cfc file.
Lucee 5.3.10.120 Error (java.lang.NoClassDefFoundError)
Message com/sun/jna/Pointer
Stacktrace The Error Occurred in
/Dump.cfc: line 111
called from /var/www/wwwroot/scanmagic.cfm: line 4
What could be the possible fix?Adam Cameron
Adam Cameron
Charles Robertson
06/01/2023, 12:45 PMfunction foo(){
var local = {};
local = {
strReturn = {
criteria = {}
},
strCompetenceTemplate = “”,
aCriteria = [],
iGlobalCnt = 0,
lSelected = ""
};
WriteDump(var=local.strReturn);
}
When I try this, I get an error saying that the local scope is empty.zackster
06/02/2023, 9:21 AMAdam Cameron
sessionCookie
settings to be included in the getApplicationMetadata()
result? It does on CF.
Second: given it's not exposed there, how can I determine the values for this @ runtime? Is it hidden away somewhere else?gsr
06/02/2023, 6:06 PMzackster
06/03/2023, 10:50 AMmjclemente
06/05/2023, 2:37 PMERROR: canceling statement due to user request;lucee.runtime.exp.DatabaseException
Adam Cameron
Adam Cameron
https://i2.paste.pics/f08e330be91f100167fd18306e70f89c.png▾
John Wilson
06/06/2023, 5:06 PMzackster
06/06/2023, 7:54 PMchapmandu
06/07/2023, 6:53 AMv = foo()["bar"] ?: "xxx";
v = foo().bar ?: "xxx";
https://trycf.com/gist/b7f329f163d1cb6389394516275fb816/lucee5?theme=monokaizackster
06/07/2023, 12:10 PMdswitzer
06/07/2023, 12:14 PMdanlance
06/07/2023, 12:19 PM"WARN","XNIO-1 task-17","06/07/2023","12:31:57","cftrace","[1686137517872 ms (1st trace)] [/usr/local/lib/serverHome/WEB-INF/lucee-web/components/org/lucee/cfml/Query.cfc @ line: 30]- [arguments.sql=""{EXAMPLE SQL}""] "
This does not appear to be every trace which is logged - however it is significant enough for us to see over 2.47 Million requests logged in the last 4 weeks on one of the busier applications we host!
Can anyone advise what we can do stop this being logged?
Also - 1686137517872 ms
which this query has been logged as taking, equates to ~53.5 years… which is quite impressive… I hadn’t realised our application had been running that long! (or that Lucee was that old… or AWS… or the internet in general really!!!)
Digging into the code for the cfquery tag,I did find the following lines - but they appear to be in a different format, and appear to be referring to and writing to datasource.log
https://github.com/lucee/Lucee/blob/5.3.10.120/core/src/main/java/lucee/runtime/tag/Query.java#L778-L782
datasource.log???
Well, that’s not something which we have configured within log shipping for our production environments - as this was not a file which Lucee produced by default at the time we initially configured our log shipping with an earlier version of lucee (probably 1 5.1 variant)
So I fired up a new local instance of the application, and then checked the lucee web logs folder… and… 82,000 log file lines just from starting the app and hitting a few pages.
This does indeed appear to be logging every single SQL request to to the datasource log file.
Looking at the the following logic from Lucee’s Query.java:
Log log = ThreadLocalPageContext.getLog(pageContext, "datasource");
if (log.getLogLevel() >= Log.LEVEL_INFO) {
<http://log.info|log.info>("query tag", "executed [" + sqlQuery.toString().trim() + "] in " + DecimalFormat.call(pageContext, exe / 1000000D) + " ms");
}
Ok, so If I read this correctly…
It appears that
• Lucee is retrieving the log object for datasource.log
• Lucee is comparing the configured logLevel for datasource.log to Log.LEVEL_INFO and if datasource.log logLevel is higher than Info, then write the query to the datasource.log file
Ok - so, next I look at the implementation of the Log interface to see how the log levels would be compared:
https://github.com/lucee/Lucee/blob/5.3.10.120/loader/src/main/java/lucee/commons/io/log/Log.java#L24-L46
Ok - so, LEVEL_INFO = 1;
So if the datasource.log log level is set to anything other than LEVEL_TRACE
then every SQL statement needs to be logged to datasource.log??????? 🤦
So - please tell me, am I interpreting that correctly?
If datasource.log is configured to LEVEL_TRACE then nothing will be logged, but if it’s configured to LEVEL_INFO / LEVEL_DEBUG / LEVEL_WARN / LEVEL_ERROR / LEVEL_FATAL then nothing will be logged???
If that’s correct, then isn’t that the wrong way round - if we set a log level to LEVEL_WARN - doesn’t that mean “only log entries to the file which are of LEVEL_WARN or above?” I.e. the higher the value, the less should be logged?
It feels like there is a bug with the logic here… and the condition has been reversed. Can I just get confirmation that my understanding (not being primarily a java developer) is correct here?
I suspect that a similar logic error may be responsible for the copious (all though not as extensive) logging to the trace.log - but haven’t identified the specific location where that takes place… if anyone can enlighten me, that would be appreciated.Adam Cameron
// C.cfc
component {
static {
final static.usingLiteral = {
subKey = "value"
}
final static.usingDots.subKey = "value"
}
}
<!--- test.cfm --->
<cfscript>
writeDump(C::usingLiteral)
writeDump(C::usingDots)
</cfscript>
https://i2.paste.pics/2b8ae9c245d64cf917bbbadb9872af4b.png▾
Mauro caresimo
06/07/2023, 12:59 PMdavla
06/07/2023, 1:11 PMzackster
06/07/2023, 1:12 PMdavla
06/07/2023, 1:17 PMdavla
06/07/2023, 1:54 PMzackster
06/07/2023, 5:11 PMgavinbaumanis
06/07/2023, 11:53 PMCaused by: org.hibernate.TransactionException: JDBC commit failed
... 53 more
Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 389,215 milliseconds ago. The last packet sent successfully to the server was 389,215 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
Previously I did a lot of research / googling and found that the people that had "fixed" the issue were stating that they manually reset the connection pool every 6 hours. (I don't exactly remember but it was something about the (DB?) default connection timeout)
And ultimately started running a scheduled task every 6 hours (5h 55m) that calls dbPoolClear().
It "seemed" to work - but the messages are back.
At the same time as implementing the scheduled task, I also changed the timeouts in the Lucee / Datasource settings to;
Connection limit (max): 100
Connection idle timeout (in minutes) : 5
Connection timeout : 15
I thought, all the above fixed my problem - but I am seeing the "The last packet successfully received from the server was XXX milliseconds" again and thought I better ask, again for some help / recommendations.
• Is there was anything I had misconfigured (above)
• Is there some other Datasource setting I should check / change?
• Any non Datasource setting changes I should check / complete.