Java update to 1.8 162 has caused Mango ES 3.2.2 to become unreachable.
-
Hi raylatbasix,
Things to check,
- Is there an error in your /opt/mango/logs/ma.log file?
- What does
java -version
say when run on the command line (you can do this in the Command Shell in Webmin)? - What happens if you SSH and
cd /opt/mango/bin; ./ma.sh start
? - Could it be the Mango user doesn't have executable privileges to the new Java? (this could be tested by running
java -version
after SSH'ing as the mango user)
-
Hi Phil,
> java -version java version "1.8.0_131" Java(TM) SE Runtime Environment (build 1.8.0_131-b11) Java HotSpot(TM) Client VM (build 25.131-b11, mixed mode)
I put it back to 1.8 131 thinking there was an issue.
cd /opt/mango/bin; ./ma.sh start
Appears to start the service ok, I am now able to access the Mango UI.
Is this because I tried to restart via Webmin using the mango user account?
I am trying to solve a Java memory leak issue by updating java from 1.8 131 to something newer. What did I miss on performing the java update?
-
ma.log file error:
ERROR 2018-02-13T10:48:32,418 (com.serotonin.m2m2.Main.main:129) - Error during initialization java.lang.RuntimeException: java.net.SocketException: Permission denied at com.serotonin.m2m2.Lifecycle.webServerInitialize(Lifecycle.java:922) ~[ma-priv-3.2.2.jar:?] at com.serotonin.m2m2.Lifecycle.initialize(Lifecycle.java:199) ~[ma-priv-3.2.2.jar:?] at com.serotonin.m2m2.Main.main(Main.java:125) [ma-priv-3.2.2.jar:?] Caused by: java.net.SocketException: Permission denied at sun.nio.ch.Net.bind0(Native Method) ~[?:1.8.0_131] at sun.nio.ch.Net.bind(Net.java:433) ~[?:1.8.0_131] at sun.nio.ch.Net.bind(Net.java:425) ~[?:1.8.0_131] at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[?:1.8.0_131] at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[?:1.8.0_131] at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:317) ~[jetty-server-9.3.11.v20160721.jar:9.3.11.v20160721] at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80) ~[jetty-server-9.3.11.v20160721.jar:9.3.11.v20160721] at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:235) ~[jetty-server-9.3.11.v20160721.jar:9.3.11.v20160721] at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.3.11.v20160721.jar:9.3.11.v20160721] at org.eclipse.jetty.server.Server.doStart(Server.java:390) ~[jetty-server-9.3.11.v20160721.jar:9.3.11.v20160721] at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.3.11.v20160721.jar:9.3.11.v20160721] at com.serotonin.m2m2.Lifecycle.webServerInitialize(Lifecycle.java:919) ~[ma-priv-3.2.2.jar:?] ... 2 more INFO 2018-02-13T10:48:32,431 (com.serotonin.m2m2.Lifecycle.terminate:361) - Mango Lifecycle terminating... ERROR 2018-02-13T10:48:32,447 (com.serotonin.m2m2.Lifecycle.terminate:436) - com.serotonin.provider.InputStreamEPollProvider ERROR 2018-02-13T10:48:32,449 (com.serotonin.m2m2.Lifecycle.terminate:444) - com.serotonin.provider.ProcessEPollProvider FATAL 2018-02-13T10:48:32,459 (com.infiniteautomation.zwave.rt.ZwaveControlCenter.<init>:62) - Z-Wave Device configuration directory at: does not exist! FATAL 2018-02-13T10:48:32,459 (com.infiniteautomation.zwave.rt.ZwaveControlCenter.<init>:68) - Z-Wave user data directory at: does not exist, Mango will shutodwn.! INFO 2018-02-13T10:48:32,466 (com.serotonin.m2m2.Lifecycle.terminate:480) - Mango Lifecycle terminated.
So it was some sort of permission issue. How do you recommend updating java ??
-
I will go add a step to those directions. Those were written originally when Mango ran under the root user, and since the default port in a MangoES is 80 that's a privileged port for a lesser user, and one need give it permissions somehow. We chose to solve that by giving the java executable cap_net_bind_service privileges.
So, after the
cp -rf newJdk/* java-8-oracle/
overwrite, you need tosudo setcap 'cap_net_bind_service=+ep' java-8-oracle/bin/java
to give the new Java executable permissions to open the port.Thanks for bringing those instruction being out of date to our attention.
-
Thanks Phil,
So I should be safe to attempt a java update back to 1.8 162, and perform you additional steps??
Also, it seems all of my licensing on the modules page shows as "Unlicensed" or free mode now. Any Idea how to fix that? I'm guessing in this mode, I'm limited on my point count to 300, and I am well over that.
Thanks.
-
Yes, that extra step is what was missing. I just upgraded Java on an ES I have to confirm.
I would suspect you ran it under the root user, and that's why your license isn't appearing. You may need to
chown -R mango:mango /opt/mango
to get all the files back to the mango user's ownership, and then start mango as the mango user or through the service. -
@phildunlap said in Java update to 1.8 162 has caused Mango ES 3.2.2 to become unreachable.:
sudo setcap 'cap_net_bind_sevice=+ep' java-8-oracle/bin/java
Just upgraded to 1.8 162. Having an issue with the:
sudo setcap 'cap_net_bind_sevice=+ep' java-8-oracle/bin/java
Throws an invalid argument error for setcap:
> sudo setcap 'cap_net_bind_sevice=+ep' java-8-oracle/bin/java fatal error: Invalid argument usage: setcap [-q] [-v] (-r|-|<caps>) <filename> [ ... (-r|-|<capsN>) <filenameN> ] Note <filename> must be a regular (non-symlink) file.
Any ideas?
-
Try the absolute path if you weren't in the parent directory of java-8-oracle,
/usr/lib/jvm/java-8-oracle/bin/java
-
I was in the parent directory for the java-8-oracle. Tried it both ways, still no luck.
Note <filename> must be a regular (non-symlink) file. > cd /usr/lib/jvm/ > sudo setcap 'cap_net_bind_sevice=+ep' java-8-oracle/bin/java fatal error: Invalid argument usage: setcap [-q] [-v] (-r|-|<caps>) <filename> [ ... (-r|-|<capsN>) <filenameN> ] Note <filename> must be a regular (non-symlink) file. > sudo setcap 'cap_net_bind_sevice=+ep' /usr/lib/jvm/java-8-oracle/bin/java fatal error: Invalid argument usage: setcap [-q] [-v] (-r|-|<caps>) <filename> [ ... (-r|-|<capsN>) <filenameN> ] Note <filename> must be a regular (non-symlink) file.
-
We connected and resolved the issue with a few extra steps...
sudo setcap 'cap_net_bind_service=+ep' java-8-oracle/bin/java
I missed the R in service when writing that! D'oh.sudo setcap 'cap_net_bind_service=+ep' java-8-oracle/jre/bin/java
- For some reason we also had to
chown -R mango:mango java-8-oracle
as, despite appearing to have permissions in anls -l
, his Mango user was not able to travel into the java-8-oracle directory. There are no downsides to chowning that directory to the mango user, but it shouldn't have been necessary and wasn't on my test system.
The license issue was resolved once the mango user was launching Mango.
-
Thanks for the excellent support today Phil!!
-
You are most welcome!