<?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>373782</bug_id>
          
          <creation_ts>2016-12-17 18:34:00 +0000</creation_ts>
          <short_desc>akonadi failed to append item</short_desc>
          <delta_ts>2017-01-03 22:10:54 +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>Neon</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>grave</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="pipapo">piral</reporter>
          <assigned_to name="kdepim bugs">pim-bugs-null</assigned_to>
          <cc>bernhard+kde</cc>
    
    <cc>dvratil</cc>
    
    <cc>jsalatas</cc>
    
    <cc>kde</cc>
    
    <cc>lacsilva</cc>
    
    <cc>nicolas</cc>
          
          <cf_commitlink>https://commits.kde.org/akonadi/85c5f22b836805ecd20a7ac8eaae0a6861bdcd24</cf_commitlink>
          <cf_versionfixedin>5.4.1</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>65</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1645598</commentid>
    <comment_count>0</comment_count>
    <who name="pipapo">piral</who>
    <bug_when>2016-12-17 18:34:00 +0000</bug_when>
    <thetext>After the upgrade to neon LTS with akonadi 4:16.12.0-0neon+16.04+build2 kmail does not recieve or send mails. After creating a new user I get the message &quot;failed to append item&quot;. In aconadiconsole there was a hint about mysql incorrect datetime values. After some research I found this:
sql-mode=&quot;ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_AUTO_CREATE_USER&quot;
I put this line to ~.local/share/mysql.cnf and akonadi was able to write to the database again. This options can also be found as comment under
# TODO: make Akonadi work with those settings enabled</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1645600</commentid>
    <comment_count>1</comment_count>
    <who name="Bernhard Scheirle">bernhard+kde</who>
    <bug_when>2016-12-17 18:50:09 +0000</bug_when>
    <thetext>I also encounter this bug (KDE Neon User Edition - 16.12 update)

&gt; akonadictl restart
[...]
org.kde.pim.akonadiserver: DATABASE ERROR:
org.kde.pim.akonadiserver:   Error code: 1292
org.kde.pim.akonadiserver:   DB error:  &quot;Incorrect datetime value: &apos;0000-00-00 00:00:00&apos; for column &apos;datetime&apos; at row 1&quot;
org.kde.pim.akonadiserver:   Error text: &quot;Incorrect datetime value: &apos;0000-00-00 00:00:00&apos; for column &apos;datetime&apos; at row 1 QMYSQL3: Der Befehl konnte nicht ausgeführt werden&quot;
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;
org.kde.pim.akonadiserver: Error during insertion into table &quot;PimItemTable&quot; &quot;Incorrect datetime value: &apos;0000-00-00 00:00:00&apos; for column &apos;datetime&apos; at row 1 QMYSQL3: Der Befehl konnte nicht ausgeführt werden&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1645729</commentid>
    <comment_count>2</comment_count>
    <who name="John Salatas">jsalatas</who>
    <bug_when>2016-12-18 10:38:17 +0000</bug_when>
    <thetext>Same here :(

(In reply to Bernhard Scheirle from comment #1)
&gt; I also encounter this bug (KDE Neon User Edition - 16.12 update)
&gt; 
&gt; &gt; akonadictl restart
&gt; [...]
&gt; org.kde.pim.akonadiserver: DATABASE ERROR:
&gt; org.kde.pim.akonadiserver:   Error code: 1292
&gt; org.kde.pim.akonadiserver:   DB error:  &quot;Incorrect datetime value:
&gt; &apos;0000-00-00 00:00:00&apos; for column &apos;datetime&apos; at row 1&quot;
&gt; org.kde.pim.akonadiserver:   Error text: &quot;Incorrect datetime value:
&gt; &apos;0000-00-00 00:00:00&apos; for column &apos;datetime&apos; at row 1 QMYSQL3: Der Befehl
&gt; konnte nicht ausgeführt werden&quot;
&gt; org.kde.pim.akonadiserver:   Query: &quot;INSERT INTO PimItemTable (rev,
&gt; remoteId, remoteRevision, gid, collectionId, mimeTypeId, datetime, atime,
&gt; dirty, size) VALUES (:0, :1, :2, :3, :4, :5, :6, :7, :8, :9)&quot;
&gt; org.kde.pim.akonadiserver: Error during insertion into table &quot;PimItemTable&quot;
&gt; &quot;Incorrect datetime value: &apos;0000-00-00 00:00:00&apos; for column &apos;datetime&apos; at
&gt; row 1 QMYSQL3: Der Befehl konnte nicht ausgeführt werden&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1645885</commentid>
    <comment_count>3</comment_count>
    <who name="Bernhard Scheirle">bernhard+kde</who>
    <bug_when>2016-12-19 08:13:33 +0000</bug_when>
    <thetext>With no manual config changes^1

    SELECT @@sql_mode;

returns on my machine:
    ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION



If I now set sql_mode in `~/.local/share/akonadi/mysql.conf` to

    sql_mode=ONLY_FULL_GROUP_BY,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

(Only removed `STRICT_TRANS_TABLES`)
everything works fine again.

My first thought was that maybe an mysql update changed the default value of sql_mode and added STRICT_TRANS_TABLES to it.
But STRICT_TRANS_TABLES is enabled by default since mysql 5.7.5 ^2


^1: especially with no sql_mode in `~/.local/share/akonadi/mysql.conf`
^2: https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1645893</commentid>
    <comment_count>4</comment_count>
    <who name="John Salatas">jsalatas</who>
    <bug_when>2016-12-19 09:32:38 +0000</bug_when>
    <thetext>Bernhard Scheirle&apos;s suggestions to add 

sql_mode=ONLY_FULL_GROUP_BY,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

in 

~/.local/share/akonadi/mysql.conf 

works for me too.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1647415</commentid>
    <comment_count>5</comment_count>
    <who name="T Zachmann">t.zachmann</who>
    <bug_when>2016-12-25 17:42:14 +0000</bug_when>
    <thetext>*** Bug 373871 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1649192</commentid>
    <comment_count>6</comment_count>
    <who name="Kai Uwe Broulik">kde</who>
    <bug_when>2017-01-03 10:37:09 +0000</bug_when>
    <thetext>Seeing the same thing...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1649212</commentid>
    <comment_count>7</comment_count>
    <who name="Nicolas">nicolas</who>
    <bug_when>2017-01-03 11:50:28 +0000</bug_when>
    <thetext>*** This bug has been confirmed by popular vote. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1649246</commentid>
    <comment_count>8</comment_count>
    <who name="Daniel Vrátil">dvratil</who>
    <bug_when>2017-01-03 14:58:26 +0000</bug_when>
    <thetext>Assuming you all use Oracle MySQL, please state the version that you have.

The package will be called something like mysql-server (but depends on a distro).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1649247</commentid>
    <comment_count>9</comment_count>
    <who name="Nicolas">nicolas</who>
    <bug_when>2017-01-03 15:03:58 +0000</bug_when>
    <thetext>In my case it is Neon User Edition with mysql-server-core-5.7 version 5.7.16-0ubuntu0.16.04.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1649290</commentid>
    <comment_count>10</comment_count>
    <who name="Bernhard Scheirle">bernhard+kde</who>
    <bug_when>2017-01-03 19:04:27 +0000</bug_when>
    <thetext>
(In reply to Daniel Vrátil from comment #8)
&gt; Assuming you all use Oracle MySQL, please state the version that you have.

I&apos;m also using KDE Neon (User Edition).

$ mysqld-akonadi --version
/usr/sbin/mysqld  Ver 5.7.16-0ubuntu0.16.04.1 for Linux on x86_64 ((Ubuntu))

$ mysql --version
mysql  Ver 14.14 Distrib 5.7.16, for Linux (x86_64) using  EditLine wrapper

$ dpkg -s mysql-server-core-5.7 | grep -i version
Version: 5.7.16-0ubuntu0.16.04.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1649311</commentid>
    <comment_count>11</comment_count>
    <who name="Luis Silva">lacsilva</who>
    <bug_when>2017-01-03 21:16:40 +0000</bug_when>
    <thetext>Using KDE Neon Edition

&gt; mysqld-akonadi --version
/usr/sbin/mysqld  Ver 5.7.16-0ubuntu0.16.04.1 for Linux on x86_64 ((Ubuntu))

&gt; dpkg -s mysql-server-core-5.7 | grep -i version
Version: 5.7.16-0ubuntu0.16.04.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1649314</commentid>
    <comment_count>12</comment_count>
    <who name="John Salatas">jsalatas</who>
    <bug_when>2017-01-03 21:21:18 +0000</bug_when>
    <thetext># mysqld-akonadi --version
/usr/sbin/mysqld  Ver 5.7.16-0ubuntu0.16.04.1 for Linux on x86_64 ((Ubuntu))
# dpkg -l mysql-server-core
dpkg-query: no packages found matching mysql-server-core
# dpkg -l | grep mysql-server-core
ii  mysql-server-core-5.7                                       5.7.16-0ubuntu0.16.04.1                         amd64        MySQL database server binaries
# 



However the issue is resolved after applying Bernhard Scheirle&apos;s suggestion in Comment 3:

https://bugs.kde.org/show_bug.cgi?id=373782#c3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1649333</commentid>
    <comment_count>13</comment_count>
    <who name="Daniel Vrátil">dvratil</who>
    <bug_when>2017-01-03 22:10:54 +0000</bug_when>
    <thetext>Git commit 85c5f22b836805ecd20a7ac8eaae0a6861bdcd24 by Daniel Vrátil.
Committed on 03/01/2017 at 22:02.
Pushed by dvratil into branch &apos;Applications/16.12&apos;.

AKAPPEND: ensure we always insert with a valid date

Latest MySQL does not like null datetime for some reason, so make sure
we always have a valid date on INSERT.
FIXED-IN: 5.4.1

M  +5    -4    src/server/handler/akappend.cpp

https://commits.kde.org/akonadi/85c5f22b836805ecd20a7ac8eaae0a6861bdcd24</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>