Z-Push error with iOS mail app

Encountering an error when trying to sync emails in a specific folder. Is there a way I can identify the specific message in the mailbox causing the issue?

13/01/2025 07:56:32 [1487379] [ERROR] [xxx@domain.com] LoopDetection->ProcessLoopDetectionPreviousConnectionFailed(): Command 'Sync' at 13/01/2025 07:01:44 with pid '1480052' terminated unexpectedly or is still running.
13/01/2025 07:56:32 [1487379] [ERROR] [xxx@domain.com] Please check your logs for this PID and errors like PHP-Fatals or Apache segmentation faults and report your results to the Z-Push dev team.
13/01/2025 10:05:36 [1504137] [WARN] [xxx@domain.com] Mobile loop detected! Messages sent to the mobile will be restricted to 2 items in order to identify the conflict
13/01/2025 10:05:36 [1504137] [ERROR] [xxx@domain.com] Ignored broken message (SyncMail). Reason: '2' Folderid: 'i/cd5dbd26' message id '8775'
13/01/2025 10:05:36 [1504137] [FATAL] [xxx@domain.com] Fatal error: /usr/local/lib/z-push/lib/core/streamer.php:309 - Uncaught TypeError: strlen(): Argument #1 ($str) must be of type string, array given in /usr/local/lib/z-push/lib/core/streamer.php:309
Stack trace:
#0 /usr/local/lib/z-push/lib/core/streamimporter.php(171): Streamer->Encode()
#1 /usr/local/lib/z-push/lib/default/diffbackend/exportchangesdiff.php(167): ImportChangesStream->ImportMessageChange()
#2 /usr/local/lib/z-push/lib/request/sync.php(1199): ExportChangesDiff->Synchronize()
#3 /usr/local/lib/z-push/lib/request/sync.php(956): Sync->syncFolder()
#4 /usr/local/lib/z-push/lib/request/requestprocessor.php(116): Sync->Handle()
#5 /usr/local/lib/z-push/index.php(107): RequestProcessor::HandleRequest()
#6 {main}
  thrown (1)

I have tried the following, but no change in behavior:

ubuntu@mail01:~$ sudo /usr/local/lib/z-push/z-push-admin.php -a clearloop

System wide loop detection data removed: OK

ubuntu@mail01:~$ sudo /usr/local/lib/z-push/z-push-admin.php -a fixstates

Validating and fixing states (this can take some time):
	11:58:47 Checking username casings: Processed: 1 - Converted: 0 - Removed: 0
	11:58:47 Checking available devicedata & user linking: Processed: 1 - Fixed: 0
	11:58:47 Checking for unreferenced (obsolete) state files: Processed: 84 - Deleted: 0
	11:58:47 Checking for hierarchy folder data state: Devices: 1 - Processed: 1 - Fixed: 0 - Device+User without hierarchy: 0
	11:58:47 Checking flags of shared folders: Devices: 1 - Devices with additional folders: 0 - Fixed: 0

You can try using WBXML logging. This should produce the Imap email headers.Note that this generates alot of logging.

1 Like

Maybe you can remove the device and readd it. See if the problem goes away.
Read here iPad Profile won't log in - #3 by stylnchris

Thanks for the tip on the debug logging. I took a few guesses and deleted what was likely the problematic message, and the sync errors stopped.

These are the steps I used to enable z-push debug logging for anyone stumbling across this in the future.

sudo nano /usr/local/lib/z-push/config.php

Change define('LOGLEVEL', LOGLEVEL_ERROR); to define('LOGLEVEL', LOGLEVEL_WBXML);

Re-run the tail

sudo tail -f /var/log/z-push/z-push-error.log

This looks to be the issue in an invoice email from eBay. The encoding is not utf-8 as it should be. Maybe some bit was flipped along the way. Thanks eBay :roll_eyes:

<html>
  <head>
    <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8=
">
  </head>

I may open an issue with z-push to see if they can just treat no encoding as utf-8 anyway, but who knows what kind of can of worms that could open.

2 Likes