libpq version 17.2 - 17.5 pdo errors
libpq version 17.2 - 17.5 pdo errors

in DataTables 2
Yesterday a server that hosts my app was upgraded from libpq version 17.2 to version 17.5 and I'm seeing the following error:
DataTables warning: table id=reservation-list - An SQL error occurred: SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block
This is an app that I haven't touched in a long time so I'm quite rusty with debugging datatables. Any help or suggestions are appreciated.
Answers
In the Editor server libraries you can add
.Debug(true)
before.Process()
to see the generated query. Use the browser's network inspector to view the JSON response. See the debug() docs for more details.This thread has that error and Allan has provided some troubleshooting steps. If the steps don't help then post the results of the troubleshooting steps.
Kevin
The message that is in the JSON response from the server is pasted below. The weird things is that I set my postgres server to log all statements, then pasted the query that it logged from the datatables request into pgAdmin and it ran without errors. Similarly, the query in the error message below works in pgAdmin. So it's not a matter of invalid SQL.
2.2.2 is a bit out of date. It would be worth updating the server-side libraries to 2.4.3which you can get from npm or here. I'm not immediately aware of a fix that has gone in, but its always worth trying the latest
.
I'll try updating my libpq and seeing what happens, hopefully tomorrow.
Allan
This is looking more and more like a server configuration issue, not a datatables issue. I don't want to create unnecessary noise on this forum (but I do appreciate any suggestions). The server where the issue turned up is running postgres 15 and showed a libpq version change of 17.2 to 17.5. However when I test on a server with libpg version of 17.0.
The server with libpq 17.2 to 17.5 is using the apt.postgresql.org repo. The server with libpq 17.0 is using the standard Ubuntu 24.04 repo.
I meant to say that when I test on a server with libpg 17.0 all is good.
I'm not immediately seeing anything at this end unfortunately. Could you try adding:
immediately before the
->process(...)
call and see if that provides any extra information? It isn't ideal, as you do want transactions for rolling back, but I wonder if it might tell us a little more about what is going on.Allan
I'm closing this thread, at least for the time being. The issue exists on only one computer which is in production and which I have limited ability to do trouble shooting on. Thank you very much for the replies, they have been helpful.
Okay - thanks for the update. Let me know if you find out what is wrong with that specific machine - I'm curious
Allan