<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>439769</bug_id>
          
          <creation_ts>2021-07-12 04:50:20 +0000</creation_ts>
          <short_desc>Akonadi fails with Mariadb 10.6.3</short_desc>
          <delta_ts>2021-08-10 13:16:13 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Frameworks and Libraries</classification>
          <product>Akonadi</product>
          <component>server</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>UPSTREAM</resolution>
          
          <see_also>https://bugreports.qt.io/browse/QTBUG-95071</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter>kelly</reporter>
          <assigned_to name="kdepim bugs">pim-bugs-null</assigned_to>
          <cc>arojas</cc>
    
    <cc>fabian</cc>
    
    <cc>fresh.road1272</cc>
    
    <cc>meniskus</cc>
    
    <cc>mr203010spam</cc>
    
    <cc>ricardo</cc>
    
    <cc>timonin</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2046492</commentid>
    <comment_count>0</comment_count>
    <who name="">kelly</who>
    <bug_when>2021-07-12 04:50:20 +0000</bug_when>
    <thetext>SUMMARY

Akonadi fails to run with Mariadb 10.6.3.  To me it looks like the QDateTime string format with the &quot;T&quot; and maybe the &quot;Z&quot; is invalid with Mariadb 10.6+.


STEPS TO REPRODUCE
1. Install Mariadb 10.6.3
2. delete ~/.local/share/akonadi
3. reboot machine
4. start kmail

OBSERVED RESULT

Errors in ~/.local/share/akonadi/Akonadi.error

2021-07-11T22:04:16 [CRITICAL] org.kde.pim.akonadiserver: DATABASE ERROR:
2021-07-11T22:04:16 [CRITICAL] org.kde.pim.akonadiserver:   Error code: &quot;1292&quot;
2021-07-11T22:04:16 [CRITICAL] org.kde.pim.akonadiserver:   DB error:  &quot;Incorrect datetime value: &apos;2021-07-12T04:04:16Z&apos; for column `akonadi`.`pimitemtable`.`datetime` at row 1&quot;
2021-07-11T22:04:16 [CRITICAL] org.kde.pim.akonadiserver:   Error text: &quot;Incorrect datetime value: &apos;2021-07-12T04:04:16Z&apos; for column `akonadi`.`pimitemtable`.`datetime` at row 1 QMYSQL: Unable to execute query&quot;
2021-07-11T22:04:16 [CRITICAL] org.kde.pim.akonadiserver:   Values: QMap((&quot;:0&quot;, QVariant(int, 0))(&quot;:1&quot;, QVariant(QString, &quot;152288&quot;))(&quot;:2&quot;, QVariant(QString, &quot;&quot;))(&quot;:3&quot;, QVariant(QString, &quot;&quot;))(&quot;:4&quot;, QVariant(qlonglong, 21))(&quot;:5&quot;, QVariant(qlonglong, 4))(&quot;:6&quot;, QVariant(QDateTime, QDateTime(2021-07-12 04:04:16.872 UTC Qt::UTC)))(&quot;:7&quot;, QVariant(QDateTime, QDateTime(2021-07-12 04:04:16.871 UTC Qt::UTC)))(&quot;:8&quot;, QVariant(bool, false))(&quot;:9&quot;, QVariant(qlonglong, 13241)))
2021-07-11T22:04:16 [CRITICAL] org.kde.pim.akonadiserver:   Query: &quot;INSERT INTO PimItemTable (rev, remoteId, remoteRevision, gid, collectionId, mimeTypeId, datetime, atime, dirty, size) VALUES (:0, :1, :2, :3, :4, :5, :6, :7, :8, :9)&quot;
2021-07-11T22:04:16 [WARN ] org.kde.pim.akonadiserver: Error during insertion into table &quot;PimItemTable&quot; &quot;Incorrect datetime value: &apos;2021-07-12T04:04:16Z&apos; for column `akonadi`.`pimitemtable`.`datetime` at row 1 QMYSQL: Unable to execute query&quot;
2021-07-11T22:04:16 [WARN ] org.kde.pim.akonadiserver: Error while handling command CreateItem on connection akonadi_imap_resource_0 (0xdd91b0)



EXPECTED RESULT

Kmail should start and run properly.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Kernel 5.12.16
(available in About System)
KDE Plasma Version: 5.22.3
KDE Frameworks Version: 5.84
Qt Version: 5.15.3 (from kde source tree)

ADDITIONAL INFORMATION</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2046501</commentid>
    <comment_count>1</comment_count>
    <who name="Antonio Rojas">arojas</who>
    <bug_when>2021-07-12 07:27:37 +0000</bug_when>
    <thetext>Qt issue

https://bugreports.qt.io/browse/QTBUG-95071</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2052007</commentid>
    <comment_count>2</comment_count>
    <who name="Antonio Rojas">arojas</who>
    <bug_when>2021-08-08 08:48:55 +0000</bug_when>
    <thetext>*** Bug 440717 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2052102</commentid>
    <comment_count>3</comment_count>
    <who name="Ricardo J. Barberis">ricardo</who>
    <bug_when>2021-08-08 19:04:57 +0000</bug_when>
    <thetext>I had already done a mysql_upgrade and akonadi&apos;s mysqld wouldn&apos;t start, so in case this helps other people with a broken akonadi, here&apos;s what I did (YMMV):


- Under &quot;[mysqld]&quot; in ~/.local/share/akonadi/mysql.conf I added:

&quot;innodb_force_recovery = 2&quot;

- Made sure it and akonadi were not running, and started mysqld with:

/usr/libexec/mysqld --defaults-file=/home/myuser/.local/share/akonadi/mysql.conf --datadir=/home/myuser/.local/share/akonadi/db_data/ --socket=/run/user/1000/akonadi/mysql.socket --pid-file=/run/user/1000/akonadi/mysql.pid &amp;

- Then I backed up akonadi&apos;s DB and deleted it after:

mysqldump -Q --socket=/run/user/1000/akonadi/mysql.socket --add-drop-table akonadi &gt; akonadi.sql
mysql--socket=/run/user/1000/akonadi/mysql.socket -e &quot;DROP DATABASE akonadi&quot;

- Stoped mysql:

mysqladmin -Q --socket=/run/user/1000/akonadi/mysql.socket shutdown

- Downgraded MariaDB 10.6.4 to 10.5.11 and started akonadi to recreate its database:

akonadictl start

- After a few seconds I stopped akonadi and restored the SQL dump:

/usr/libexec/mysqld --defaults-file=/home/myuser/.local/share/akonadi/mysql.conf --datadir=/home/myuser/.local/share/akonadi/db_data/ --socket=/run/user/1000/akonadi/mysql.socket --pid-file=/run/user/1000/akonadi/mysql.pid &amp;

mysql --socket=/run/user/1000/akonadi/mysql.socket -e akonadi &lt; akonadi.sql

- Shut down mysql, started akonadi again:

mysqladmin -Q --socket=/run/user/1000/akonadi/mysql.socket shutdown
akonadictl start

- Started kmail and everything looks good so far!


(Before trying all of this , out of caution, I made a backup of my mail folder and everything related to akonadi and kmail I found under ~/.cache/, ~/.config/ and ~/.local/)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2052185</commentid>
    <comment_count>4</comment_count>
    <who name="Christophe Marin">christophe</who>
    <bug_when>2021-08-09 08:51:43 +0000</bug_when>
    <thetext>*** Bug 440772 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2052220</commentid>
    <comment_count>5</comment_count>
    <who name="Stefan">meniskus</who>
    <bug_when>2021-08-09 12:06:45 +0000</bug_when>
    <thetext>Is it sure that this issue is related to MariaDB 1.6?

mysql --socket=/run/user/1000/akonadi/mysql.socket -e &quot;SELECT @@version;&quot;             
+-----------------+
| @@version       |
+-----------------+
| 10.5.10-MariaDB |
+-----------------+

Is this the current version of mariaDB what is used by akonadi?

I am running into the same today and have no idea whats changed since yesterday

I tried Ricados suggestion with 

&quot;innodb_force_recovery = 2&quot;

but after restarting akonadi, the same messages appear again and i can not send nor receives mails.


Operating System: openSUSE Tumbleweed 20210806
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.84.0
Qt Version: 5.15.2
Kernel Version: 5.13.6-1-default (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-3770K CPU @ 3.50GHz
Memory: 31.2 GiB of RAM
Graphics Processor: Mesa DRI Intel® HD Graphics 4000</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2052222</commentid>
    <comment_count>6</comment_count>
    <who name="Antonio Rojas">arojas</who>
    <bug_when>2021-08-09 12:13:05 +0000</bug_when>
    <thetext>(In reply to Stefan from comment #5)
&gt; Is it sure that this issue is related to MariaDB 1.6?
&gt; 
&gt; mysql --socket=/run/user/1000/akonadi/mysql.socket -e &quot;SELECT @@version;&quot;   
&gt; 
&gt; +-----------------+
&gt; | @@version       |
&gt; +-----------------+
&gt; | 10.5.10-MariaDB |
&gt; +-----------------+
&gt; 
&gt; Is this the current version of mariaDB what is used by akonadi?
&gt; 
&gt; I am running into the same today and have no idea whats changed since
&gt; yesterday

What do you mean by &quot;the same&quot;? The same symptoms doesn&apos;t mean it&apos;s the same issue. If you don&apos;t have the &quot;Incorrect datetime value&quot; in akonadi&apos;s output then your problem is a different one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2052227</commentid>
    <comment_count>7</comment_count>
    <who name="Stefan">meniskus</who>
    <bug_when>2021-08-09 12:19:50 +0000</bug_when>
    <thetext>Sorry, yes there are the same messages in ~/.local/share/akonadi/Akonadi.error

2021-08-09T13:16:05 [CRITICAL] org.kde.pim.akonadiserver:   Error code: &quot;1292&quot;
2021-08-09T13:16:05 [CRITICAL] org.kde.pim.akonadiserver:   DB error:  &quot;Incorrect datetime value: &apos;2021-08-09T11:16:05Z&apos; for column `akonadi`.`pimitemtable`.`atime` at row 1&quot;
2021-08-09T13:16:05 [CRITICAL] org.kde.pim.akonadiserver:   Error text: &quot;Incorrect datetime value: &apos;2021-08-09T11:16:05Z&apos; for column `akonadi`.`pimitemtable`.`atime` at row 1 QMYSQL: Die Abfrage konnte nicht ausgeführt werden&quot;
2021-08-09T13:16:05 [CRITICAL] org.kde.pim.akonadiserver:   Values: QMap((&quot;:0&quot;, QVariant(QDateTime, QDateTime(2021-08-09 11:16:05.608 UTC Qt::UTC)))(&quot;:1&quot;, QVariant(qlonglong, 46287)))
2021-08-09T13:16:05 [CRITICAL] org.kde.pim.akonadiserver:   Query: &quot;UPDATE PimItemTable SET atime = :0 WHERE ( ( PimItemTable.id = :1 ) )&quot;
2021-08-09T13:16:05 [WARN ] org.kde.pim.akonadiserver: Unable to update item access time
2021-08-09T13:16:05 [INFO ] org.kde.pim.akonadiserver.search: Executing search &quot;kontact-3240686485-SearchSession&quot;
2021-08-09T13:16:05 [INFO ] org.kde.pim.akonadiserver.search: Search  &quot;kontact-3240686485-SearchSession&quot; done (without remote search)
2021-08-09T13:16:08 [CRITICAL] org.kde.pim.akonadiserver: DATABASE ERROR:
2021-08-09T13:16:08 [CRITICAL] org.kde.pim.akonadiserver:   Error code: &quot;1292&quot;
2021-08-09T13:16:08 [CRITICAL] org.kde.pim.akonadiserver:   DB error:  &quot;Incorrect datetime value: &apos;2021-08-09T11:16:08Z&apos; for column `akonadi`.`pimitemtable`.`atime` at row 1&quot;
2021-08-09T13:16:08 [CRITICAL] org.kde.pim.akonadiserver:   Error text: &quot;Incorrect datetime value: &apos;2021-08-09T11:16:08Z&apos; for column `akonadi`.`pimitemtable`.`atime` at row 1 QMYSQL: Die Abfrage konnte nicht ausgeführt werden&quot;
2021-08-09T13:16:08 [CRITICAL] org.kde.pim.akonadiserver:   Values: QMap((&quot;:0&quot;, QVariant(int, 1))(&quot;:1&quot;, QVariant(QString, &quot;12512&quot;))(&quot;:10&quot;, QVariant(qlonglong, 44443))(&quot;:2&quot;, QVariant(QString, &quot;&quot;))(&quot;:3&quot;, QVariant(QString, &quot;&quot;))(&quot;:4&quot;, QVariant(qlonglong, 284))(&quot;:5&quot;, QVariant(qlonglong, 3))(&quot;:6&quot;, QVariant(QDateTime, QDateTime(2021-07-14 08:23:39.000 CEST Qt::LocalTime)))(&quot;:7&quot;, QVariant(QDateTime, QDateTime(2021-08-09 11:16:08.395 UTC Qt::UTC)))(&quot;:8&quot;, QVariant(bool, false))(&quot;:9&quot;, QVariant(qlonglong, 20637)))
2021-08-09T13:16:08 [CRITICAL] org.kde.pim.akonadiserver:   Query: &quot;UPDATE PimItemTable SET rev = :0, remoteId = :1, remoteRevision = :2, gid = :3, collectionId = :4, mimeTypeId = :5, datetime = :6, atime = :7, dirty = :8, size = :9 WHERE ( id = :10 )&quot;
2021-08-09T13:16:08 [WARN ] org.kde.pim.akonadiserver: Error during updating record with id 44443  in table &quot;PimItemTable&quot; &quot;Incorrect datetime value: &apos;2021-08-09T11:16:08Z&apos; for column `akonadi`.`pimitemtable`.`atime` at row 1 QMYSQL: Die Abfrage konnte nicht ausgeführt werden&quot;
2021-08-09T13:16:08 [WARN ] org.kde.pim.akonadiserver: Error while handling command CreateItem on connection akonadi_imap_resource_1 (0x55c06fcdd970)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2052228</commentid>
    <comment_count>8</comment_count>
    <who name="Antonio Rojas">arojas</who>
    <bug_when>2021-08-09 12:21:39 +0000</bug_when>
    <thetext>(In reply to Stefan from comment #7)
&gt; Sorry, yes there are the same messages in
&gt; ~/.local/share/akonadi/Akonadi.error

What&apos;s your mariadb client (not server) version?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2052230</commentid>
    <comment_count>9</comment_count>
    <who name="Antonio Rojas">arojas</who>
    <bug_when>2021-08-09 12:29:14 +0000</bug_when>
    <thetext>*** Bug 440781 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2052233</commentid>
    <comment_count>10</comment_count>
    <who name="Stefan">meniskus</who>
    <bug_when>2021-08-09 12:34:55 +0000</bug_when>
    <thetext>&gt; What&apos;s your mariadb client (not server) version?

Installed by zypper 

https://software.opensuse.org/package/mariadb-client

$ zypper se -s mariadb-client
Repository-Daten werden geladen...
Installierte Pakete werden gelesen...

S | Name           | Type  | Version     | Arch   | Repository
--+----------------+-------+-------------+--------+-----------------------
i | mariadb-client | Paket | 10.5.10-1.1 | x86_64 | Haupt-Repository (OSS)
i | mariadb-client | Paket | 10.5.10-1.1 | x86_64 | openSUSE-20210604-0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2052234</commentid>
    <comment_count>11</comment_count>
    <who name="Meinhard Ritscher">mr203010spam</who>
    <bug_when>2021-08-09 12:40:35 +0000</bug_when>
    <thetext>I was hit by this bug too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2052240</commentid>
    <comment_count>12</comment_count>
    <who name="Antonio Rojas">arojas</who>
    <bug_when>2021-08-09 13:07:37 +0000</bug_when>
    <thetext>(In reply to Stefan from comment #10)
&gt; &gt; What&apos;s your mariadb client (not server) version?
&gt; 
&gt; Installed by zypper 

Looks like opensuse packages mariadb-connector-c separately, instead of using the bundled one in mariadb. So you&apos;ll be affected if you update mariadb-connector-c to 3.2.3, regardless of the mariadb package version.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2052311</commentid>
    <comment_count>13</comment_count>
    <who name="Stefan">meniskus</who>
    <bug_when>2021-08-09 16:26:19 +0000</bug_when>
    <thetext>&gt; Looks like opensuse packages mariadb-connector-c separately, instead of using the bundled one in mariadb. So you&apos;ll be affected if you update mariadb-connector-c to 3.2.3, regardless of the mariadb package version.

Thank you very much for your analysis, your right.

This was a real monday-challenge for a common simple user like me. At first i was confused because no package &quot;mariadb-connector-c&quot; found on my machine. The package is (also?) called libmariadb3 (https://software.opensuse.org/package/libmariadb3)

cat /var/log/zypp/history | grep libmariadb3

2021-07-04 08:43:18|install|libmariadb3|3.1.13-2.1
2021-08-07 21:48:18|install|libmariadb3|3.2.3-1.1

sudo zypper install --oldpackage http://download.opensuse.org/tumbleweed/repo/oss/x86_64/libmariadb3-3.1.13-2.1.x86_64.rpm

After a reboot, the first sync takes a amount of time, but everything works as before the 2021-08-07.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2052397</commentid>
    <comment_count>14</comment_count>
    <who name="Thiago Macieira">thiago</who>
    <bug_when>2021-08-09 20:38:35 +0000</bug_when>
    <thetext>Fix in Qt: https://codereview.qt-project.org/c/qt/qtbase/+/363880</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2052525</commentid>
    <comment_count>15</comment_count>
    <who name="Christophe Marin">christophe</who>
    <bug_when>2021-08-10 13:16:13 +0000</bug_when>
    <thetext>*** Bug 440777 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>