Sent server start command but could not get process ID
Hi. I've installed nuxeo and struggling with launching application. Here is the debug output:
13:45:51,850 DEBUG [org.nuxeo.launcher.NuxeoLauncher.start(NuxeoLauncher.java:405)] Server command: [/bin/sh, -c, /opt/jdk1.6.0_35/jre/bin/java -server -Xms512m -Xmx1024m -XX:MaxPermSize=512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -cp .:/opt/nuxeo-cap-5.6-tomcat/nxserver/lib:/opt/nuxeo-cap-5.6-tomcat/bin/bootstrap.jar -Dnuxeo.home=/opt/nuxeo-cap-5.6-tomcat -Dnuxeo.conf=/opt/nuxeo-cap-5.6-tomcat/bin/nuxeo.conf -Dnuxeo.log.dir=/opt/nuxeo-cap-5.6-tomcat/log -Dnuxeo.data.dir=/opt/nuxeo-cap-5.6-tomcat/nxserver/data -Dnuxeo.tmp.dir=/opt/nuxeo-cap-5.6-tomcat/tmp -Djava.io.tmpdir=/opt/nuxeo-cap-5.6-tomcat/tmp -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dcatalina.base=/opt/nuxeo-cap-5.6-tomcat -Dcatalina.home=/opt/nuxeo-cap-5.6-tomcat -Djava.endorsed.dirs=/opt/nuxeo-cap-5.6-tomcat/endorsed org.apache.catalina.startup.Bootstrap start]
13:45:52,862 DEBUG [org.nuxeo.launcher.NuxeoLauncher.getPid(NuxeoLauncher.java:1394)] regexp: ^(?!/bin/sh).*\Q/opt/nuxeo-cap-5.6-tomcat/bin/nuxeo.conf\E.*\Qorg.apache.catalina.startup.Bootstrap\E.*$ pid:null
13:45:52,862 WARN [org.nuxeo.launcher.NuxeoLauncher.start(NuxeoLauncher.java:412)] Sent server start command but could not get process ID.
13:45:52,870 DEBUG [org.nuxeo.launcher.NuxeoLauncher.getPid(NuxeoLauncher.java:1394)] regexp: ^(?!/bin/sh).*\Q/opt/nuxeo-cap-5.6-tomcat/bin/nuxeo.conf\E.*\Qorg.apache.catalina.startup.Bootstrap\E.*$ pid:null
The regexp check during startup seems to be incorrect. Is it possible to fix?
My specs:
- CentOS 6.3 x64
- jdk1.6.0_35 x64
- nuxeo-cap-5.6
Hi,
The first workaround is to make the Nuxeo Launcher ignore the process ID: using nuxeoctl console
or nuxeoctl startbg
commands instead of nuxeoctl start
.
The regexp is generated by org.nuxeo.launcher.NuxeoLauncher from:
processRegex = "^(?!/bin/sh).*"
+ Pattern.quote(configurationGenerator.getNuxeoConf().getPath())
+ ".*" + Pattern.quote(getServerPrint()) + ".*$";
with getServerPrint()=org.apache.catalina.startup.Bootstrap
in Tomcat case.
It is then used by org.artofsolving.jodconverter.process.ProcessManager.findPid(processRegex) from JOD Converter third-party library.
There is currently no way to customize it. We could add an option to the Launcher or check for a System property allowing to provide a custom regexp. But I would rather generically fix it.
What is wrong with the current regexp in your case? What would be a better value?
Contributions are very welcome: feel free to fill a Jira issue and send a pull request for JOD Converter or the Nuxeo Launcher.
Thanks for the suggestions, Julien. It worked for me like this:
processRegex = "^.*"
+ configurationGenerator.getNuxeoConf().getPath()
+ ".*" + getServerPrint() + ".*$";
"/bin/ps -e -o pid,args |grep Bootstrap"
?
I'm wondering what makes the current regexp not matching your Nuxeo process. The current implementation should work on CentOS. Do you use another Shell than bash, dash, or zsh ? Do you start Nuxeo directly with nuxeoctl or through another script such as an init.d one?
@Julien_A: if you randomly encounter such an issue, it must have something to do with the process startup duration: the Launcher waits for 1s after the process launch before checking its PID. If so, please fill a Jira issue asking for an improvement allowing to customize that timing.
6492 /opt/jdk1.6.0_35/jre/bin/java -server -Xms512m -Xmx1024m -XX:MaxPermSize=512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -cp .:/opt/nuxeo-cap-5.6-tomcat/nxserver/lib:/opt/nuxeo-cap-5.6-tomcat/bin/bootstrap.jar -Dnuxeo.home=/opt/nuxeo-cap-5.6-tomcat -Dnuxeo.conf=/opt/nuxeo-cap-5.6-tomcat/bin/nuxeo.conf -Dnuxeo.log.dir=/opt/nuxeo-cap-5.6-tomcat/log -Dnuxeo.data.dir=/opt/nuxeo-cap-5.6-tomcat/nxserver/data -Dnuxeo.tmp.dir=/opt/nuxeo-cap-5.6-tomcat/tmp -Djava.io.tmpdir=/opt/nuxeo-cap-5.6-tomcat/tmp -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dcatalina.base=/opt/nuxeo-cap-5.6-tomcat -Dcatalina.home=/opt/nuxeo-cap-5.6-tomcat -Djava.endorsed.dirs=/opt/nuxeo-cap-5.6-tomcat/endorsed org.apache.catalina.startup.Bootstrap start
19458 grep Bootstrap
I'm using bash. Launching directly from nuxeoctl
Hello Dear:
I found the solution to the problem generated by the aforementioned error message.
What I have done has been as follows:
In nuxeo.conf file located in C: \ ProgramData \ Nuxeo \ Conf \ in the line corresponding to
JAVA_OPTS =-Xms512m-Xmx1024m-XX: MaxPermSize = 512m - I set the values in half and EUREKA! this has worked wonders!
Then, the content should look like:
JAVA_OPTS =-Xms256m-Xmx512m-XX: MaxPermSize = 256m -.
As a precaution, I have also made this change to the same values in the following files in C: \ Nuxeo \ bin:
-nuxeoctl
-pack
Bon voyage!