Z-Push seems not to connect to Kopano

Hi,

I am trying to run Kopano and Z-Push on ArchLinux. So far everything works except for Z-Push. I have set Z-Push up according to some tutorials I have found on the internet, which basically comes down to changing the apache config for the php parameters needed as well as the Alias for ActiveSync and specifying the backend in z-push’s own config.

The issue is: when I check my setup by going to <serverURL>/Microsoft-Server-ActiveSync a login is shown but no matter what credentials I enter, the prompt just keeps reappearing. Credentials are obviously verified by using the Kopano WebApp but it also does not work with my iPhone, The logs show only very little information, even though I have set them to the most verbose settings.

/var/log/z-push/z-push.log

02/06/2018 21:31:44 [12011] [DEBUG] [#unknown] -------- Start
02/06/2018 21:31:44 [12011] [DEBUG] [#unknown] cmd='' devType='' devId='' getUser='unknown' from='myIP' version='' method='GET'
02/06/2018 21:31:44 [12011] [ INFO] [#unknown] AuthenticationRequiredException: Access denied. Please send authorisation information - code: 0 - file: /usr/share/webapps/z-push/index.php:56
02/06/2018 21:31:44 [12011] [ INFO] [#unknown] User-agent: 'unknown'
02/06/2018 21:31:44 [12011] [FATAL] [#unknown] Exception: (AuthenticationRequiredException) - Access denied. Please send authorisation information
02/06/2018 21:31:44 [12011] [DEBUG] [#unknown] ZPush::PrintZPushLegal()
02/06/2018 21:31:44 [12011] [WARN] [#unknown] IP: MyIP failed to authenticate user 'unknown'
02/06/2018 21:31:44 [12011] [DEBUG] [#unknown] TopCollector(): Initialized mutexid Resource id #41 and memid Resource id #42.
02/06/2018 21:31:44 [12011] [DEBUG] [#unknown] TopCollector initialised with IPC provider 'IpcSharedMemoryProvider' with type '20'
02/06/2018 21:31:44 [12011] [ INFO] [#unknown] cmd='' memory='2.36 MiB/2.00 MiB' time='0.01s' devType='' devId='' getUser='unknown' from='myIP' idle='0s' version='' method='GET' httpcode='401'
02/06/2018 21:31:44 [12011] [DEBUG] [#unknown] -------- End

/var/log/z-push/z-push-error.log

03/06/2018 01:38:00 [  847] [WARN] [#unknown] IP: myIP failed to authenticate user 'unknown'
03/06/2018 01:41:42 [  985] [FATAL] [#unknown] Exception: (AuthenticationRequiredException) - Access denied. Please send authorisation information

Hi,
what is you authentication back-end?
could you show us the config.php file.
best regards
Andreas

Hi Andreas,

Given how long the config is, I figured it’s better to not paste it here but instead pasted it to github.

/usr/share/webapp/z-push/config.php
https://gist.github.com/irreleph4nt/8694b081d4f0688ca5185ffd4278841c

/usr/share/webapps/z-push/backends/kopano/config.php
https://gist.github.com/irreleph4nt/6c7a74db423ee32aa59e26c79117cda2

Let me know if you need any more config files, please.

Okay, so I have narrowed down the issue to php-fpm not playing nice with z-push. With fpm disabled, I get the below in the logs and things work:

03/06/2018 15:10:53 [ 8559] [DEBUG] [<my_name>] [] -------- Start
03/06/2018 15:10:53 [ 8559] [DEBUG] [<my_name>] [] cmd='' devType='' devId='' getUser='<my_name>' from='<my_IP>' version='GIT' method='GET'
03/06/2018 15:10:53 [ 8559] [DEBUG] [<my_name>] [] Used timezone 'Europe/Berlin'
03/06/2018 15:10:53 [ 8559] [DEBUG] [<my_name>] [] ZPush::GetBackend(): trying autoload backend 'BackendKopano'
03/06/2018 15:10:53 [ 8559] [DEBUG] [<my_name>] [] BackendKopano using PHP-MAPI version: 8.6.80 - PHP version: 7.2.6
03/06/2018 15:10:53 [ 8559] [DEBUG] [<my_name>] [] Request::ProcessHeaders() ASVersion: 14.1
03/06/2018 15:10:53 [ 8559] [DEBUG] [<my_name>] [] ZPush::CommandNeedsAuthentication(0): true
03/06/2018 15:10:53 [ 8559] [DEBUG] [<my_name>] [] KopanoBackend->Logon(): Trying to authenticate user '<my_name>'..
03/06/2018 15:10:53 [ 8559] [DEBUG] [<my_name>] [] KopanoBackend->openMessageStore('<my_name>'): Found 'DEFAULT' store: 'Resource id #51'
03/06/2018 15:10:53 [ 8559] [DEBUG] [<my_name>] [] KopanoBackend->Logon(): User '<my_name>' is authenticated
03/06/2018 15:10:53 [ 8559] [DEBUG] [<my_name>] [] Store supports properties containing Unicode characters.
03/06/2018 15:10:53 [ 8559] [DEBUG] [<my_name>] [] NoPostRequestException: This is the Z-Push location and can only be accessed by Microsoft ActiveSync-capable devices - code: 2 - file: /usr/share/webapps/z-push/index.php:90
03/06/2018 15:10:53 [ 8559] [ INFO] [<my_name>] [] User-agent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36'
03/06/2018 15:10:53 [ 8559] [DEBUG] [<my_name>] [] ZPush::PrintZPushLegal()
03/06/2018 15:10:53 [ 8559] [ INFO] [<my_name>] [] cmd='' memory='3.62 MiB/6.00 MiB' time='0.07s' devType='' devId='' getUser='<my_name>' from='<my_IP>' idle='0s' version='GIT' method='GET' httpcode='200'
03/06/2018 15:10:53 [ 8559] [DEBUG] [<my_name>] [] -------- End

2 Questions left:

  1. Is there documentation available on how to make z-push work with php-fpm?
  2. I am a little concerned regarding the lines with “memory=‘X.XX MiB/Y.YY MiB’” wheer X is > Y. Can this be ignored?

Hi @irreleph4nt ,

I would have referred you to the z-push wiki, but confluence seems down at the moment (but it is https://wiki.z-hub.io/display/ZP/Installation for future reference). There you would also have found general install instructions.

Referring to fpm, you can find the relevant section in the nginx example config at https://stash.z-hub.io/projects/ZP/repos/z-push/browse/config/nginx/z-push.conf

edit: regarding the memory line. This is simply logged for statistics purposes and refers the the max memory consumed by the request on the server. Nothing to worry about.