6.0.0-alpha14
6/23/25

[#11742] ActiveSync Horde5 errors on PostgreSQL
Summary ActiveSync Horde5 errors on PostgreSQL
Queue Synchronization
Queue Version Git master
Type Bug
State Resolved
Priority 2. Medium
Owners jan (at) horde (dot) org, mrubinsk (at) horde (dot) org
Requester horde (at) albasoft (dot) com
Created 11/22/2012 (4596 days ago)
Due
Updated 12/02/2012 (4586 days ago)
Assigned 11/22/2012 (4596 days ago)
Resolved 12/02/2012 (4586 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
12/02/2012 10:26:03 PM Michael Rubinsky Comment #7
State ⇒ Resolved
Reply to this comment

[Show Quoted Text - 11 lines]
For the mailmap table, message_uid is the IMAP UID of the message, so 
it is indeed an integer.

Fixed in Git.

12/02/2012 10:24:51 PM Git Commit Comment #6 Reply to this comment
Changes have been made in Git (master):

commit 53b6c57e961361e06f144e2fd4cb3a19b39fe5a5
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Sun Dec 2 17:22:45 2012 -0500

     Bug: 11742 Message uids are integers for IMAP messages.

  .../15_horde_activesync_integerimapuidfield.php    |   22 
++++++++++++++++++++
  1 files changed, 22 insertions(+), 0 deletions(-)

http://git.horde.org/horde-git/-/commit/53b6c57e961361e06f144e2fd4cb3a19b39fe5a5
11/26/2012 10:44:08 AM Jan Schneider Comment #5 Reply to this comment

[Show Quoted Text - 9 lines]
This one is left.
11/22/2012 12:50:15 PM horde (at) albasoft (dot) com Comment #4 Reply to this comment
I have updated database schema through admin UI.
On pgsql now table 'horde_activesync_mailmap'  columns 'sync_read', 
'sync_deleted' and 'sync_flagged' have changed their types to 'boolean'.

Previously reported log shows no insert error now on same operation:

2012-11-22T13:47:40+01:00 DEBUG: I      <Modify>
2012-11-22T13:47:40+01:00 DEBUG: I       <ServerEntryId>
2012-11-22T13:47:40+01:00 DEBUG: I        206708
2012-11-22T13:47:40+01:00 DEBUG: I       </ServerEntryId>
2012-11-22T13:47:40+01:00 DEBUG: I       <Data>
2012-11-22T13:47:40+01:00 DEBUG: I        <POOMMAIL:Read>
2012-11-22T13:47:40+01:00 DEBUG: I         1
2012-11-22T13:47:40+01:00 DEBUG: I        </POOMMAIL:Read>
2012-11-22T13:47:40+01:00 DEBUG: I       </Data>
2012-11-22T13:47:40+01:00 DEBUG: Updating state during flags
2012-11-22T13:47:41+01:00 DEBUG: I      </Modify>
2012-11-22T13:47:41+01:00 DEBUG: I     </Commands>
2012-11-22T13:47:41+01:00 DEBUG: [androidcxxxxxxxxxx] Processed 1 
incoming changes
2012-11-22T13:47:41+01:00 DEBUG: I    </Folder>
2012-11-22T13:47:41+01:00 DEBUG: Creating new sync_cache entry for: INBOX
2012-11-22T13:47:41+01:00 DEBUG: I   </Folders>
2012-11-22T13:47:41+01:00 DEBUG: I  </Synchronize>

Thank you
11/22/2012 11:36:51 AM Jan Schneider Comment #3
State ⇒ Feedback
Priority ⇒ 2. Medium
Assigned to Michael Rubinsky
Assigned to Jan Schneider
Reply to this comment
horde_activesync_mailmap.sync_read is defined as 'integer', but code 
tries to insert a boolean ('t') instead of integer, and so it fails. 
Errors disappear if I change table column data type to 'boolean'.
Please try if what I committed fixed this.
Something similar happens with horde_activesync_mailmap.message_uid, 
defined as 'string' (or char var 255 on pgsql) and code tries to 
insert an integer. I think this duplicates email on each sync. 
Errors disappear if I change table column data type to 'integer', 
and email sync works as expected.
In this case the UID could indeed be a string, AFAICS. I wonder where 
it's getting an integer from. Michael may provide some insight, after 
his vacation.
11/22/2012 11:34:40 AM Jan Schneider Comment #2 Reply to this comment
commit 3fc2ffc946618932cdda3b128a8cc6313ff7f524
Author: Jan Schneider <jan@horde.org>
Date:   Thu Nov 22 12:21:27 2012 +0100

     [jan] Fix boolean table columns (Bug #11742).

  framework/ActiveSync/lib/Horde/ActiveSync/State/Sql.php           |    6 +-
  .../Horde/ActiveSync/13_horde_activesync_booleanfields.php        |   
  42 +++++
  framework/ActiveSync/package.xml                                  |   10 +-
  3 files changed, 52 insertions(+), 6 deletions(-)
  create mode 100644 
framework/ActiveSync/migration/Horde/ActiveSync/13_horde_activesync_booleanfields.php

http://git.horde.org/horde-git/-/commit/3fc2ffc946618932cdda3b128a8cc6313ff7f524
11/22/2012 09:55:18 AM horde (at) albasoft (dot) com Comment #1
Priority ⇒ 3. High
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Queue ⇒ Synchronization
Summary ⇒ ActiveSync Horde5 errors on PostgreSQL
Type ⇒ Bug
Reply to this comment
I'm running ActiveSync on Groupware 5.0.1 using postgresql-8.4.9 as 
default backend.
I have activated email sync with 12.1 version. There are some errors 
related to data typing.

horde_activesync_mailmap.sync_read is defined as 'integer', but code 
tries to insert a boolean ('t') instead of integer, and so it fails. 
Errors disappear if I change table column data type to 'boolean'.

Something similar happens with horde_activesync_mailmap.message_uid, 
defined as 'string' (or char var 255 on pgsql) and code tries to 
insert an integer. I think this duplicates email on each sync. Errors 
disappear if I change table column data type to 'integer', and email 
sync works as expected.

Where's the problem, data type definition or code?

This is device log for both cases:
------------------
2012-11-22T10:34:51+01:00 DEBUG: I      <Modify>
2012-11-22T10:34:51+01:00 DEBUG: I       <ServerEntryId>
2012-11-22T10:34:51+01:00 DEBUG: I        206679
2012-11-22T10:34:51+01:00 DEBUG: I       </ServerEntryId>
2012-11-22T10:34:51+01:00 DEBUG: I       <Data>
2012-11-22T10:34:51+01:00 DEBUG: I        <POOMMAIL:Read>
2012-11-22T10:34:51+01:00 DEBUG: I         1
2012-11-22T10:34:51+01:00 DEBUG: I        </POOMMAIL:Read>
2012-11-22T10:34:51+01:00 DEBUG: I       </Data>
2012-11-22T10:34:51+01:00 DEBUG: Updating state during flags
2012-11-22T10:34:51+01:00 ERR: SQLSTATE[22P02]: Invalid text 
representation: 7 ERROR:  invalid input syntax for integer: "t"
LÍNEA 1: ...c0a80102}281', 'androidcxxxxxxxxxx', 'INBOX', 'username', 't')

------------------

2012-11-12T22:39:31+01:00 DEBUG: [32445] Found 3 message changes in INBOX.
2012-11-12T22:39:31+01:00 DEBUG: [32445] Checking for PIM initiated changes.
2012-11-12T22:39:31+01:00 DEBUG: _isPIMChange: 205157, Array
(
     [read] => 1
     [flagged] => 0
)
, flags
2012-11-12T22:39:31+01:00 ERR: SQLSTATE[42883]: Undefined function: 7 
ERROR:  operator does not exist: character varying = integer
LINEA 1: ...sync_devid = 'androidcxxxxxxxxxx' AND message_uid = 205157 A...
------------------

Saved Queries