6.0.0-beta1
7/20/25

[#12250] ActiveSync: PHP warning for empty folders
Summary ActiveSync: PHP warning for empty folders
Queue Synchronization
Queue Version Git master
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester thomas.jarosch (at) intra2net (dot) com
Created 05/14/2013 (4450 days ago)
Due
Updated 05/15/2013 (4449 days ago)
Assigned
Resolved 05/14/2013 (4450 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
05/15/2013 02:11:45 PM Michael Rubinsky Comment #7 Reply to this comment
That line of code doesn't even exist anymore, both the activesync and 
imap libraries have seen lots of changes since FRAMEWORK_5_0 so it's 
likely that this doesn't even happen anymore (I can't reproduce here). 
If you see this while testing with master code then please reopen.

The framework libraries will not be seeing any more bug fixes on the 
FRAMEWORK_5_0 branch.
05/15/2013 07:16:38 AM Thomas Jarosch Comment #6 Reply to this comment
Hi Michael,

why is

2013-05-14T10:42:16+02:00 WARN: HORDE [horde] PHP ERROR:
  array_combine() [<a
  href='function.array-combine'>function.array-combine</a>]: Both
  parameters should have an equal number of elements [pid 3162 on line
  3499 of
  "/datastore/DEVEL/horde/framework/Imap_Client/lib/Horde/Imap/Client/Base.php"

not a bug?

05/14/2013 09:22:23 PM Michael Rubinsky State ⇒ Not A Bug
 
05/14/2013 11:27:08 AM Thomas Jarosch Comment #5
Summary ⇒ ActiveSync: PHP warning for empty folders
Reply to this comment
That still leaves the problem that no messages are synced anymore.
Contacts f.e. work fine.
that problem turned out to be a PEBKAC:
It was only syncing messages of the last seven days, so the folders 
appeared empty.

Additionally the PHP error message for the empty folder fooled me...

05/14/2013 09:46:05 AM Thomas Jarosch Comment #4 Reply to this comment
I think I got it:
The PHP error message is only shown if the requested folder is empty.

That still leaves the problem that no messages are synced anymore.
Contacts f.e. work fine.

05/14/2013 09:31:13 AM Thomas Jarosch Comment #3 Reply to this comment
Ok, I've added this debug code:

--- a/framework/Imap_Client/lib/Horde/Imap/Client/Base.php
+++ b/framework/Imap_Client/lib/Horde/Imap/Client/Base.php
@@ -3496,6 +3496,15 @@ abstract class Horde_Imap_Client_Base 
implements Serializable
                  return $res['match'];
              }

+            $debug_str = sprintf("TOMJ: ids->ids: %s, 
res['match]->ids: %s", print_r($ids->ids, true), 
print_r($res['match']->ids, true));
+            $e = new LogicException('TOMJ2: Get me a nice stack trace');
+            $debug_str2 = $e->getTraceAsString();
+            $debug_str3 = sprintf("TOM3: convert: $convert, mailbox: 
%s", print_r($mailbox, true));
+
+            Horde::logMessage($debug_str);
+            Horde::logMessage($debug_str2);
+            Horde::logMessage($debug_str3);
+
              $map->update(array_combine($ids->ids, $res['match']->ids));
          }


Resulting output:
[pid 17730 on line 3506 of 
"/datastore/DEVEL/horde/framework/Imap_Client/lib/Horde/Imap/Client/Base.php"]
2013-05-14T11:24:59+02:00 INFO: HORDE [horde] TOMJ: ids->ids: Array
(
     [0] => 0
     [1] => 1
)
, res['match]->ids: Array
(
)
  [pid 17730 on line 3504 of 
"/datastore/DEVEL/horde/framework/Imap_Client/lib/Horde/Imap/Client/Base.php"]
2013-05-14T11:24:59+02:00 INFO: HORDE [horde] #0 
/datastore/DEVEL/horde/framework/Imap_Client/lib/Horde/Imap/Client/Base.php(2596): Horde_Imap_Client_Base->resolveIds(Object(Horde_Imap_Client_Mailbox), Object(Horde_Imap_Client_Ids), 
1)
#1 
/datastore/DEVEL/horde/framework/Imap_Client/lib/Horde/Imap/Client/Base.php(2481): Horde_Imap_Client_Base->_fetchWrapper(Object(Horde_Imap_Client_Mailbox), Object(Horde_Imap_Client_Fetch_Query), 
Array)
#2 
/datastore/DEVEL/horde/framework/ActiveSync/lib/Horde/ActiveSync/Imap/Adapter.php(328): Horde_Imap_Client_Base->fetch(Object(Horde_Imap_Client_Mailbox), Object(Horde_Imap_Client_Fetch_Query), 
Array)
#3 
/datastore/DEVEL/horde/framework/Core/lib/Horde/Core/ActiveSync/Driver.php(584): Horde_ActiveSync_Imap_Adapter->getMessageChanges(Object(Horde_ActiveSync_Folder_Imap), 
Array)
#4 
/datastore/DEVEL/horde/framework/ActiveSync/lib/Horde/ActiveSync/State/Sql.php(807): Horde_Core_ActiveSync_Driver->getServerChanges(Object(Horde_ActiveSync_Folder_Imap), 1368522038, 1368523499, 1368264299, 
false)
#5 
/datastore/DEVEL/horde/framework/ActiveSync/lib/Horde/ActiveSync/Sync.php(137): 
Horde_ActiveSync_State_Sql->getChanges(Array)
#6 
/datastore/DEVEL/horde/framework/ActiveSync/lib/Horde/ActiveSync/Request/Sync.php(621): Horde_ActiveSync_Sync->init(Object(Horde_ActiveSync_State_Sql), Object(Horde_ActiveSync_Connector_Exporter), 
Array)
#7 
/datastore/DEVEL/horde/framework/ActiveSync/lib/Horde/ActiveSync/Request/Base.php(218): 
Horde_ActiveSync_Request_Sync->_handle()
#8 
/datastore/DEVEL/horde/framework/ActiveSync/lib/Horde/ActiveSync.php(647): 
Horde_ActiveSync_Request_Base->handle()
#9 
/datastore/DEVEL/horde/framework/Rpc/lib/Horde/Rpc/ActiveSync.php(141): 
Horde_ActiveSync->handleRequest('Sync', '356938030416912')
#10 /datastore/DEVEL/horde/horde/rpc.php(156): 
Horde_Rpc_ActiveSync->getResponse(NULL)
#11 {main} [pid 17730 on line 3505 of 
"/datastore/DEVEL/horde/framework/Imap_Client/lib/Horde/Imap/Client/Base.php"]
2013-05-14T11:24:59+02:00 INFO: HORDE [horde] TOM3: convert: 2, 
mailbox: Horde_Imap_Client_Mailbox Object
(
     [_utf7imap:protected] => 1
     [_utf8:protected] => INBOX/Sufi
)
  [pid 17730 on line 3506 of 
"/datastore/DEVEL/horde/framework/Imap_Client/lib/Horde/Imap/Client/Base.php"]
2013-05-14T11:24:59+02:00 WARN: HORDE [horde] PHP ERROR: 
array_combine() [<a 
href='function.array-combine'>function.array-combine</a>]: Both 
parameters should have an equal number of elements [pid 17730 on line 
3508 of 
"/datastore/DEVEL/horde/framework/Imap_Client/lib/Horde/Imap/Client/Base.php"]

For the record:
I've cleared all horde caches and ActiveSync states. The backtrace is 
from my local tree running the backported bug #12224 fix, but as I 
said, it also failed with the vanilla commit mentioned earlier.

05/14/2013 09:15:10 AM Thomas Jarosch Comment #2
New Attachment: 356938030416912.txt Download
Reply to this comment
ActiveSync log from a Nokia N900. The iPad 4 shows the same behavior 
(does not show any messages, but displays the folder list).

05/14/2013 09:13:11 AM Thomas Jarosch Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ ActiveSync no longer syncs / PHP error
Queue ⇒ Synchronization
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
Hi,

I just discovered that ActiveSync no longer syncs my test box. This is 
what I get in the logs:
2013-05-14T10:42:16+02:00 WARN: HORDE [horde] PHP ERROR: 
array_combine() [<a 
href='function.array-combine'>function.array-combine</a>]: Both 
parameters should have an equal number of elements [pid 3162 on line 
3499 of 
"/datastore/DEVEL/horde/framework/Imap_Client/lib/Horde/Imap/Client/Base.php"

I'm not sure if it's related to upgrading to origin/FRAMEWORK_5_0 
HEAD, I've also tried a "vanilla" 
1b4fc14eeeab4a98e92538143eef3abaa9ad7dd5 commit without any local 
changes.

I'm pretty sure it was working last week, dimp shows the messages just 
fine. I'll try to add some debug logging to the mentioned PHP error 
line.

Thomas

Saved Queries