Page 1 of 1

Trying to setup proxy/nginx but zmproxyconfgen causes a java.lang.NullPointerException

Posted: Thu Dec 10, 2015 1:52 am
by daniel.wake
Hi,

Back story: We recently added an EWS license to our zimbra server in the hopes of outlook for mac being able to work with our zimbra server. We'd been using our own installation of nginx up until this point but it seems for EWS to work we need to use Zimbra's proxy/nginx service as mentioned here: https://wiki.zimbra.com/wiki/Exchange_Web_Services_EWS

I've installed proxy/memcached as laid out in this doco: https://wiki.zimbra.com/wiki/Enabling_Z ... ng_servers

Unfortunately all the ./libexec/zmproxyconfig commands do nothing and send nothing to stdout. When I try to start the proxy service it complains that there is no
/opt/zimbra/conf/nginx.conf is missing. When I then try to manually run zmproxyconfgen all I get is:
Exception in thread "main" java.lang.NullPointerException
at com.zimbra.cs.util.ProxyConfVar.isValidUpstream(ProxyConfGen.java:308)
at com.zimbra.cs.util.WebEwsSSLUpstreamServersVar.update(ProxyConfGen.java:989)
at com.zimbra.cs.util.ProxyConfGen.updateDefaultVars(ProxyConfGen.java:2471)
at com.zimbra.cs.util.ProxyConfGen.createConf(ProxyConfGen.java:2630)
at com.zimbra.cs.util.ProxyConfGen.main(ProxyConfGen.java:2827)

We're running 8.6.0 GA ZCS Network on SL.6.5 (a RHEL variant)

Also every few minutes this spams the /var/log/zimbra.log:

Dec 10 17:50:33 mail-stg zmconfigd[31830]: Executed: /opt/zimbra/bin/zmproxyctl status norewrite returned 1 (26 - 13) (0.01 sec)
Dec 10 17:50:33 mail-stg zmconfigd[31830]: Tracking service proxy

I'm starting to lose my mind. Anyone encountered these issues before installing a proxy on an existing installation of Zimbra?

Trying to setup proxy/nginx but zmproxyconfgen causes a java.lang.NullPointerException

Posted: Thu Dec 10, 2015 2:07 am
by phoenix
The first thing to mention is that Scientific Linux is not a supported platform for ZCS NE. While it may work, the only supported platforms are RHEL & the equivalent version of CentOS plus SLES & Ubuntu.

Have you confirmed that all the steps mentioned in that wiki article have been followed correctly (without errors), did you restart the server after installing the proxy and is this a single server install?

Trying to setup proxy/nginx but zmproxyconfgen causes a java.lang.NullPointerException

Posted: Thu Dec 10, 2015 5:06 pm
by daniel.wake
Yeah, I am aware of that however have not had any issues with any other features of Zimbra for the last 5 years it's been in production at our office.



It is a single server install and the commands in that installation guide provided neither any errors or messages of success to stdout. Only when I tried to manually run the zmproxyconfgen did I notice it must be failing without printing the error to stdout.



Also want to mention that we have no issues running nginx outside of the zimbra application nor any other java apps. Seems strange for the proxy conf generator to be throwing a null pointer exception.



Is it possible for us to make our own conf files for nginx within zimbra? I see they live under /opt/zimbra/conf/nginx as templates but would be easier to understand with an actual config example.

Trying to setup proxy/nginx but zmproxyconfgen causes a java.lang.NullPointerException

Posted: Thu Dec 10, 2015 10:39 pm
by daniel.wake
I've now tried installing fresh on a centos system just the proxy/memcached service and still am unable to generate the nginx conf files. Am I missing a crucial step from the doco?

Trying to setup proxy/nginx but zmproxyconfgen causes a java.lang.NullPointerException

Posted: Fri Dec 11, 2015 3:53 am
by phoenix
There's nothing much in the nginx.conf file other than thsi:



# NGINX POP/IMAP proxy configuration file for use with Zimbra

#



working_directory /opt/zimbra;

include /opt/zimbra/conf/nginx/includes/nginx.conf.main;

include /opt/zimbra/conf/nginx/includes/nginx.conf.memcache;

include /opt/zimbra/conf/nginx/includes/nginx.conf.zmlookup;

include /opt/zimbra/conf/nginx/includes/nginx.conf.mail;

include /opt/zimbra/conf/nginx/includes/nginx.conf.web;



# Don't edit the below comment



#__SUCCESS



The conf directory contains these files:



ls -l /opt/zimbra/conf/ | grep nginx

drwxr-xr-x 4 zimbra zimbra 37 Dec 15 2014 nginx

-rw-r--r-- 1 zimbra zimbra 435 Nov 21 14:50 nginx.conf

-rw-r----- 1 zimbra zimbra 1371 Dec 18 2014 nginx.crt

-rw-r----- 1 zimbra zimbra 1704 Dec 18 2014 nginx.key



The nginx directory contains the includes and templates folder with their associated files, do they all seem to be present? Have you also applied any of the recent patches to your ZCS server? If I get some time later today I'll try and replicate your steps to see what happens.

Trying to setup proxy/nginx but zmproxyconfgen causes a java.lang.NullPointerException

Posted: Fri Dec 11, 2015 7:50 am
by phoenix
I've just tested this with a clean install of ZCS 8.6 (no patches applied) and no proxy or memcached installed on CentOS6.7 (OS version) - the wiki instructions worked fine for me when I added memcached and proxy. Does running the zmhostname return the correct address for your ZCS server? There have been a couple of NPE bugs in Zimbra but they are years old and the one outstanding is for ZCS 8.7 but I don't know if any of them relate to your specific problem. Unfortunately I don't have an NE version to test this problem, perhaps it's time to raise a support case?

Trying to setup proxy/nginx but zmproxyconfgen causes a java.lang.NullPointerException

Posted: Sun Feb 21, 2016 12:05 am
by frankchavez
Check the values listed from these and make sure only valid servers are listed:
zmprov gacf zimbraReverseProxyUpstreamLoginServers
zmprov gacf zimbraReverseProxyAvailableLookupTargets