SQLite Forum

Cache rebuild fails
Login

Cache rebuild fails

(1) By fantajista on 2020-06-01 09:23:00 [link] [source]

After installing the module with Drupal 8.8.6, I get the following error and cannot recover. I use SQLite ver3.7.17

Uncaught PHP Exception Drupal Core Database DatabaseExceptionWrapper: "SQLSTATE [HY000]: General error: 1 near" (": syntax error: INSERT OR REPLACE INTO {cache_config} (cid, expire, created, tags, checksum, data, serialized ) json_extract (value, "$ .cid") as cson, json_extract (value, "$ .expire") and json_extract (value, "$ .created") as expire, json_extract (value, "$ Select as .. serialized from json_each (: tags ".) json_extract (value," $ .checksum ") as tag, json_extract (value," $ .data ") as checksum, json_extract (value," $ .serialized ") as data), json_each. db_insert_placeholder_0 );

Furthermore, if you run drush cr, the following error will occur.

drush cr

Unable to load Zend OPcache-already loaded

Line 695 in Connection.php:

SQLSTATE [HY000]: General error: 1: near "(": Syntax error: INSERT OR REPLACE INTO {cache_config} (cid, expire, created, tags, checksum, data, serialize D) Select cson, json_extract (value, "$ .expir" as json_extract (value, "$ .cid") E ") expired, json_extract (value," $ .created ") created, json_extract (va Lue, as "$ .tags") tag, json_extract (value, "$ .checksum") as checksum, json _Extract (value, "$ .data") as data, json_extract (value, "$ .serialized") as s Serialized array from json_each (: db_insert_placeholder_0);

(2) By David Empson (dempson) on 2020-06-01 11:09:39 in reply to 1 [link] [source]

The syntax errors are almost certainly because of the use of JSON functions. JSON functions were added as an optional feature in SQLite 3.9.0 (2015-10-14). Your SQLite 3.7.17 (2013-05-20) is too old to support JSON at all.

Even SQLite 3.9.0 is way out of date. The current version as at this writing is SQLite 3.32.1 (2020-05-25).

Note also that even with a new enough version, SQLite needs to be built with the JSON1 option enabled. There is a compile option to do this for the SQLite amalgamation.

As I'm not familiar with the innards of Drupal I'm not sure where the use of JSON is coming from. Based on a quick bit of Google searching, it appears that Drupal 8.1.4 (in 2015 or 2016) required SQLite 3.7.11, and later versions of Drupal 8 didn't document a change to that requirement. (Drupal 9 appears to require a much later version of SQLite.)

Perhaps they failed to document a change to the SQLite requirements for later versions of Drupal 8.x?

Perhaps you have some Drupal plugin or feature enabled which requires JSON and that means you need a later SQLite version?

(3) By fantajista on 2020-06-02 01:44:51 in reply to 2 [link] [source]

Thank you very much. Does that mean you need to upgrade SQLite?

(4) By fantajista on 2020-06-02 02:51:19 in reply to 2 [source]

I changed the version of SQLite to the latest version.

# sqlite3 --version 3.32.1 2020-05-25 16:19:56 0c1fcf4711a2e66c813aed38cf41cd3e2123ee8eb6db98118086764c4ba83350

However, it remains 3.7.17 on the Drupal site.

Is Drupal not able to detect the version upgrade?

(5) By Stephan Beal (stephan) on 2020-06-02 09:07:10 in reply to 4 [link] [source]

Is Drupal not able to detect the version upgrade?

That's something you'll need to ask the drupal folks.