fmbiete / Z-Push-contrib

Z-Push fork with changes that I will try to contrib
GNU Affero General Public License v3.0
134 stars 62 forks source link

Problem syncing mail with big attachment #191

Closed PhilPhonic closed 9 years ago

PhilPhonic commented 9 years ago

Hi,

I just updated my server from: debian 7 -> debian 8 apache 2.2 -> apache 2.4

Now, I'm seeing errors in my z-push.log:

26/05/2015 17:07:27 [ 3436] [ERROR] [user@example.com] LoopDetection->ProcessLoopDetectionPreviousConnectionFailed(): Command 'Sync' at 26/05/2015 16:51:59 with pid '2229' terminated unexpectedly or is still running. 26/05/2015 17:07:27 [ 3436] [ERROR] [user@example.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.

There are no errors in my apache-logs. I'm missing 1 email in my sent folder on my mobile. I think this is what causes the problem. There's a big file attached to that email (~16M).

I tried switching my LOGLEVEL to WBXML, but now, nothing's working anymore.

Now there's an error in my apache log:

[Tue May 26 17:19:13.718773 2015] [:error] [pid 3421] [client xxx.xxx.xxx.xxx:39500] PHP Parse error: syntax error, unexpected 'LOGAUTHFAIL' (T_STRING) in /var/www/z-push/config.php on line 150

Any suggestions?

//Edit: some more info: Client:

iPhone 5 - iOS 8

Server:

php.ini max_execution_time = 300 max_input_time = 60 memory_limit = 256M

//Edit2: finally got WEBXML running. Just forgot an apostrophe after WBXML in the config file. Problem now: where is it logging? I can't find anything

fmbiete commented 9 years ago

If you are sending a message with a big attachment from your mobile, make sure neither your apache/nginx nor php will timeout before it get complete. Usually that's the reason for the "pid XXX terminated unexpectedly"

Inside the docker folder you will find some configuration examples:

php.ini

max_execution_time = 900
max_input_time = 300
post_max_size = 20M
upload_max_filesize = 20M

nginx.conf

proxy_read_timeout 910;
client_max_body_size 20m;
fastcgi_read_timeout 910;
PhilPhonic commented 9 years ago

I'm not trying to send a mail. I'm just syncing mails to my mobile. And the big mail is inside the "Sent" folder.

I changed max_execution_time and max_input_time in php and TomeOut in apache2. Now, everything syncs just fine.

Weird thing is: on my debian 7 with apache 2.2 installed, these settings were: max_execution_time = 60 and max_input_time = 30 in php.

Thanks for your help.

Two more questions: 1: Where does WBXML log? I switched to WBXML, but in the "normal" /var/log/z-push/z-push.log nothing was logged. 2: If I'm sending a mail, it is not moved to my "Sent" folder. It gets sent, but it does not appear in "Sent".

//Edit:

The Problem is back. I removed the exchange completely from my phone, removed it from the z-push-state-db and added the exchange to my phone again. now, the same problem is back. this 1 mail is not synced with the same errors in my z-push-error.log

fmbiete commented 9 years ago
  1. in config.php you need to have something like this. All the messages go to the same file.
    define('LOGFILEDIR', '/var/log/z-push/');
    define('LOGFILE', LOGFILEDIR . 'z-push.log');
    define('LOGERRORFILE', LOGFILEDIR . 'z-push-error.log');
    define('LOGLEVEL', LOGLEVEL_WBXML);
    define('LOG_SYSLOG_ENABLED', false);
  1. Check:
  2. Your BackendIMAP config has the SENT folder configured correctly
  3. Your device syncs the SENT folder
  4. Your device tells z-push to SAVE_IN_SENT when sending a message (WBXML log will tell you this)

And about the error, you must search for any info about the crashed process, without any more info is very hard to find the cause.

PhilPhonic commented 9 years ago

I finally found something:

31/05/2015 08:53:46 [32104] [DEBUG] [mail@host.tld] BackendIMAP->saveSentMessage(): Outgoing mail saved in configured 'Sent' folder 'SENT' 31/05/2015 08:53:46 [32104] [DEBUG] [mail@host.tld] BackendIMAP->saveSentMessage(): saving message in Sent Items folder 31/05/2015 08:53:46 [32104] [ERROR] [mail@host.tld] BackendIMAP->saveSentMessage(): The email could not be saved to Sent Items folder. Check your configuration. 31/05/2015 08:53:46 [32104] [DEBUG] [mail@host.tld] Combined->Logoff() 31/05/2015 08:53:46 [32104] [DEBUG] [mail@host.tld] BackendIMAP->Logoff(): IMAP said: Mailbox doesn't exist: SENT 31/05/2015 08:53:46 [32104] [DEBUG] [mail@host.tld] BackendIMAP->Logoff(): IMAP said: [TRYCREATE] Mailbox doesn't exist: SENT 31/05/2015 08:53:46 [32104] [DEBUG] [mail@host.tld] BackendIMAP->Logoff(): IMAP connection closed

This is very confusing. The Sent folder's name definately is "Sent". It's configured that way in Thunderbird and works. The Sent folder is also synced to my mobile without any errors. If I send an email usind thunderbird, the sent message appears in "Sent" folder in thunderbird and also on my mobile.

//Edit: fixed it. seems there was a "bug" in the (a little older) z-push version I was using. I updated to the newest version and now it works! thanks!

PhilPhonic commented 9 years ago

now, with the new version, my inbox is broken. I deleted a message and now:

04/06/2015 15:38:34 [16233] [ERROR] [mail@domain.tld] LoopDetection->ProcessLoopDetectionPreviousConnectionFailed(): Command 'Sync' at 04/06/2015 > 15:38:21 with pid '16233' terminated unexpectedly or is still running. 04/06/2015 15:38:34 [16233] [ERROR] [mail@domain.tld] 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.

can't find any PHP or apache errors :-/

fmbiete commented 9 years ago

In the latest versions the config for BackendIMAP changed. Make sure you use the last and have configured correctly the IMAP folder settings.

I close this issue since I think that the original question was resolved.