[Solved] Bookmarks App, MDB Versions and "SQLSTATE[42000]" Errors

Sharing in the hope that this will be useful for others and that I’m not replicating an existing warning.

Just recently decided to migrate my NextCloud instance from a MariaDB instance hosted on a RaspberryPi4B (family server setup) to one hosted on our (QNAP TVS-672XT) NAS box.

I got the basic platform up and running without any difficulties, but when I tried to use the “Bookmark” application and to re-establish synchronisation of bookmarks via the Floccus browser plug-in, I got an error message (in the NextCloud log files),

{“reqId”:“AHoJlm63ZMprqP8GF31l”,“level”:3,“time”:“2022-08-31T12:38:06+00:00”,“remoteAddr”:“172.16.104.1”,“user”:“admin”,“app”:“index”,“method”:“GET”,“url”:“/index.php/apps/bookmarks/public/rest/v2/bookmark?url=http%3A%2F%2Fedition.cnn.com%2F”,“message”:“An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘RECURSIVE folder_tree(item_id, parent_folder, type, idx) AS ( SELECT cast(1 as U’ at line 1”,“userAgent”:"Mozilla/5.0 (X11; Linux x86_64; rv:104.0)

I did all the basic checking and the only thing which I spotted that might have explained this was that my original (Pi4) hosted copy of MariaDB was running v10, while the default installed version on the QNAP NAS was v5.

Long story short… it was the MariaDB version that caused the problem with the Bookmark app. In the event that you come across this problem - or this error with another NextCloud function, it might be worth checking your SQL Versions and confirming with the NextCloud App Team whether they have any dependency requirements.