Dotclear

Vous n'êtes pas identifié(e).

Annonce

#1 2021-09-28 14:48:23

Colin Burchall
Membre
Inscription : 2021-09-28

SQLite error message

Using IIS v7.5, PHP v8.0.11 x64, SQLite v3.33 and dotclear 2.19

Everything I've tested so far works. I can update settings in the dashboard and the blog follows these settings, and I can edit the blog.  Adding comments works on the blog.  My problem is that every time I update a setting in the dashboard and save it, I receive the following error message:

SQLSTATE[HY000]: General error: 1 cannot commit - no transaction is active

This is in an orange banner with a bug icon under the breadcrumb heading of the dashboard, and the settings showing underneath in the dashboard are not updated.  If I refresh the page, I can then see the updated settings and when I view the blog, the settings are applied.

Can anyone help with this please, I don't know where to look to resolve it.  Thanks.

Hors ligne

#2 2021-10-02 16:32:40

Colin Burchall
Membre
Inscription : 2021-09-28

Re : SQLite error message

I have now worked around this issue, and here is the solution for anyone else who may encounter it.

Initially, I was unable to log in to the dashboard, with Dotclear reporting that it couldn't find a dc_session table.  This was resolved by setting "session.auto_start = 1" in PHP.INI however this was incorrect and conflicted with Dotclear's session handling.  This session conflict was throwing exceptions everywhere, preventing the dc_session table from being updated, causing a foreign key constraint violation on the dc_notice table update due to an empty dc_session table, and leaving no transaction to commit.

So why the problem logging in to the dashboard?  Once I set "session.auto_start = 0" again, this recurred so I stepped through the code to see what's happening.  What I found is that an attempt is being made to VACUUM the dc_session table, and SQLite doesn't support vacuuming tables, only the entire database.  It was interpreting the table name as a schema-name and throwing a fatal exception.  I figured I can manually vacuum the database periodically, so commented out the line that initiates a vacuum. 

This line can be found here:

inc\libs\clearbricks\session.db\class.session.db.php

Line 229, comment out as follows:

227:    private function _optimize()
228:   {
229:    //    $this->con->vacuum($this->table);
230:   }

Hors ligne

#3 2021-10-03 06:25:15

Franck
Footer de merde
Lieu : Paris
Inscription : 2004-11-09
Site Web

Re : SQLite error message

> SQLite doesn't support vacuuming tables, only the entire database

Good to know, I'm going to fix this issue for the next version!

Thank's for tips about that :-)


Dotclear addicted since 2004

Hors ligne

#4 2021-10-03 06:58:54

Franck
Footer de merde
Lieu : Paris
Inscription : 2004-11-09
Site Web

Re : SQLite error message

I push a commit about this issue: https://git.dotclear.org/dev/clearbrick … 502509eb12

tldr: only do a vacuum at db closing if required.

It will be on the next release of Dotclear.

As vacuum is not very efficient (unless you delete a lot of data in db), I think that you can keep your modification (line 229) but put a reminder to remove it juste before applying next update (or the update will fail).


Dotclear addicted since 2004

Hors ligne

#5 2021-10-03 09:56:07

Colin Burchall
Membre
Inscription : 2021-09-28

Re : SQLite error message

Thank you Franck, and you are very welcome.  I'm glad to have been able to help out. 

Greetings from Australia!

Hors ligne

Vous n'êtes pas identifié(e).

Pied de page des forums

Sites map