Elastic APM Tomcat zip file or JAR manifest missing - java

I am trying to instrument our java webapp based on tomcat using Elastic APM. Tomcat starts fine without the javaagent but refuses to start with it. I do not see any logs in /var/log/tomcat. The following is the log:
Redirecting to /bin/systemctl status -l tomcat.service
● tomcat.service - Apache Tomcat Web Application Container
Loaded: loaded (/usr/lib/systemd/system/tomcat.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2020-04-17 01:45:36 UTC; 1s ago
Process: 25660 ExecStart=/usr/libexec/tomcat/server start (code=exited, status=1/FAILURE)
Main PID: 25660 (code=exited, status=1/FAILURE)
arguments used: start
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
OpenJDK 64-Bit Server VM warning: Ignoring option PermSize; support was removed in 8.0
OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
Error opening zip file or JAR manifest missing : /opt/elastic/elastic-apm-agent-1.15.0.jar
Error occurred during initialization of VM
agent library failed to init: instrument
tomcat.service: main process exited, code=exited, status=1/FAILURE
Unit tomcat.service entered failed state.
tomcat.service failed.
Has anyone faced this before? Any ideas what I could do to fix it?

did you try to give permissions to folder /opt/elastic ?
chmod -R uog+x

Related

"Unavaliable io exception" when connecting to remote Bazel master on bazel-buildfarm

I want to setup a small POC remote area with 1x master (192.168.60.99) and 1x worker (192.168.60.98) using bazel-buildfarm. Both are CentOS 7 machines provisioned with Vagrant. When connection from a Ubuntu workstation (third machine) in the network, the following error occurs:
$ bazel build --verbose_failures //projects/myproj:app
Starting local Bazel server and connecting to it...
INFO: Options provided by the client:
Inherited 'common' options: --isatty=1 --terminal_columns=229
INFO: Reading rc options for 'build' from /home/user/tests/ecommerce/.bazelrc:
'build' options: --strategy=TypeScriptCompile=worker --strategy=AngularTemplateCompile=worker --symlink_prefix=dist/ --define=compile=legacy --incompatible_strict_action_env --experimental_allow_incremental_repository_updates --distdir=third_party/_distdir
INFO: Reading rc options for 'build' from /home/user/.bazelrc:
'build' options: --spawn_strategy=remote --genrule_strategy=remote --strategy=Javac=remote --strategy=Closure=remote --remote_executor=192.168.60.99:8980
INFO: Writing tracer profile to '/home/user/.cache/bazel/_bazel_user/24700f1ad3e201a00a1c26bd59dc6502/command.profile.gz'
INFO: Invocation ID: 569b59ca-edcb-4922-92a0-b6f0b5ca2819
ERROR: Failed to query remote execution capabilities: UNAVAILABLE: io exception
The network connection is working and I even can connect to Bazel using telnet:
telnet 192.168.60.99 8980
Trying 192.168.60.99...
Connected to 192.168.60.99.
Escape character is '^]'.
.bazelrc file of the third Ubuntu machine:
$ cat ~/.bazelrc
build --spawn_strategy=remote --genrule_strategy=remote --strategy=Javac=remote --strategy=Closure=remote --remote_executor=192.168.60.99:8980
Buildfarm setup
Both got a clon of the buildfarm git repo. The example config files were used. Just on the server I replaced localhost by 192.168.60.99 (master server ip).
I know that bazel run is not recommended. But in lack of better alternatives that works, my idea is to get the documented way working first (Bazel itself doesn't mention any alternative). Since not even bazel run works, I think that something is wrong with my installation.
All machines use version 1.1.0, which is the latest stable one at the time of writing. It's definitely an issue with bazel-buildfarm, since the local build works fine on the Ubuntu machine.
Master server
bazel run //src/main/java/build/buildfarm:buildfarm-server $(pwd)/examples/server.config.example
Worker
bazel run //src/main/java/build/buildfarm:buildfarm-operationqueue-worker $(pwd)/examples/worker.config.example --distdir ~/distdir/
The distdir is a workaround for our company proxy, that manipulates files with MITM attacks. Since Bazel doesn't allow this, I downloaded the affected file for it's jdk manually:
[vagrant#localhost bazel-buildfarm]$ l ~/distdir/
total 188M
-rw-rw-r--. 1 vagrant vagrant 188M Jan 17 2019 zulu11.2.3-jdk11.0.1-linux_x64.tar.gz
If Bazel >= 1.0 is used , we need to specify the protocol grpc in .bazelrc like this:
--remote_executor=grpc://192.168.60.99:8980
Without the protocol, the UNAVAILABLE: io exception occurs. There is currently no documentation about this issue.

SonarQube stopped and is not running

I'm trying to setup SonarQube 7.8 version. Once i start sonar.sh file it is running but after that sonar stops.
root#automation:/opt/sonarqube-7.8/bin/linux-x86-64# ./sonar.sh start
Starting SonarQube...
Started SonarQube.
root#automation:/opt/sonarqube-7.8/bin/linux-x86-64# ./sonar.sh status
SonarQube is not running.
I checked the logs and this is what i get:
--> Wrapper Started as Daemon
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
2019.10.15 21:01:37 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube-7.8/temp
2019.10.15 21:01:37 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2019.10.15 21:01:37 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube-7.8/elasticsearch]: /opt/sonarqube-7.8/elasticsearch/bin/elasticsearch
2019.10.15 21:01:37 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2019.10.15 21:01:38 INFO app[][o.e.p.PluginsService] no modules loaded
2019.10.15 21:01:38 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2019.10.15 21:01:41 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2019.10.15 21:01:41 INFO app[][o.s.a.SchedulerImpl] Process[es] is stopped
2019.10.15 21:01:41 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped
es.log file is here :
2019.10.15 21:01:41 ERROR es[][o.e.b.Bootstrap] Exception
java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:103) ~[elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:170) ~[elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) [elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) [elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) [elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) [elasticsearch-cli-6.8.0.jar:6.8.0]
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) [elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) [elasticsearch-6.8.0.jar:6.8.0]
I'm not sure why SonarQube stops. Could you help me with that please?
SOLVED:
First, don't run sonarqube as the root user
Create user
command: useradd username (put username as sonaradmin(if you don't want to change any command)
Create a password command: passwd username
goto /opt/ directory
3.1) Rename sonarqube.x.x.x to sonarqube command:sudo mv sonarqube.x.x.x sonarqube(X.X.X you should change directory name)
Change permissions command:chmod 775 -R sonarqube(folder name may change Sonarqube )
Add Created user to sonaradmin group command: chown -R sonaradmin:sonaradmin sonarqube
goto : cd /opt/sonarqube/bin/linux-x86-64/
Command: su sonaradmin
Enter password
command:./sonar.sh start
Command:./sonar.sh status
Now goto browser check http://localhost:9000/sonar
Hoping this helps.... I have gone through the same issue,solved
ok, i found the solution. All i had to do is to change #RUN_AS_USER= in /opt/sonarqube-7.8/bin/linux-x86-64/sonar.sh line 48 to RUN_AS_USER=sonar
Your solution for me doesn't works, cause console show me this messagge (after edit to sonar.sh file)
groups: "sonar": no such user
chown: utente non valido: "sonar:sonar"
su: user sonar does not exist
if baya prakash reddy's answer doesn't work, so you can look at the documentation https://docs.sonarqube.org/latest/requirements/requirements/ where it says that you must ensure that:
vm.max_map_count is greater than or equal to 524288
yo can set it like this:
sysctl -w vm.max_map_count=524288
Ensure your sonarQube server has at least 4GB of RAM. I had this issue after installing SonarQube with 1GB of RAM. Running SonarQube as sonar did not resolve the issue. Once I installed on RHL with 4GB RAM, issue was resolved

RSSOwl error when launching the application ("might have disabled stack guard")

I've downloaded RSSOwl and tried to run its executable file but it gives an error in the console:
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /home/narayan/Downloads/rssowl/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.100.v20110505/eclipse_1407.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c ', or link it with '-z noexecstack'.
Thu Feb 12 23:26:54 WET 2015 - [main] Bundle tracker is not set
(RSSOwl:9928): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",
(RSSOwl:9928): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",
The 2 last lines are not severe. The problem is the previous lines.
I'm using Debian Jessie 64bit, installed Eclipse to try to solve it but no good.

Tomcat is not shutting down

I am unable to shutdown tomcat. When I do ./shutdown.sh, I don't see any error, but the process still seems to be running. When I kill the process (kill -9), the process gets killed. After this, if I do a startup, and shutdown again, I see the same problem. How do I gracefully shut it down? Why is this happening in the first place? Please help me.
devServer:bin dev$ ps -ef|grep tomcat
501 34933 1 0 11:24PM test 0:02.02 /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Djava.util.logging.config.file=/Users/dev/admin/runtime/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/Users/dev/admin/runtime/endorsed -classpath /Users/dev/admin/runtime/bin/bootstrap.jar:/Users/dev/admin/runtime/bin/tomcat-juli.jar -Dcatalina.base=/Users/dev/admin/runtime -Dcatalina.home=/Users/dev/admin/runtime -Djava.io.tmpdir=/Users/dev/admin/runtime/temp org.apache.catalina.startup.Bootstrap start
501 34982 33786 0 11:45PM test 0:00.00 grep tomcat
devServer:bin dev$ ./shutdown.sh
Using CATALINA_BASE: /Users/dev/admin/runtime
Using CATALINA_HOME: /Users/dev/admin/runtime
Using CATALINA_TMPDIR: /Users/dev/admin/runtime/temp
Using JRE_HOME: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Using CLASSPATH: /Users/dev/admin/runtime/bin/bootstrap.jar:/Users/dev/admin/runtime/bin/tomcat-juli.jar
devServer:bin dev$ ps -ef|grep tomcat
501 34933 1 0 11:24PM test 0:02.03 /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Djava.util.logging.config.file=/Users/dev/admin/runtime/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/Users/dev/admin/runtime/endorsed -classpath /Users/dev/admin/runtime/bin/bootstrap.jar:/Users/dev/admin/runtime/bin/tomcat-juli.jar -Dcatalina.base=/Users/dev/admin/runtime -Dcatalina.home=/Users/dev/admin/runtime -Djava.io.tmpdir=/Users/dev/admin/runtime/temp org.apache.catalina.startup.Bootstrap start
501 34992 33786 0 11:45PM test 0:00.00 grep tomcat
devServer:bin dev$
Also, I see my catalina.out is rather too short. There is no port number info getting written to it at all. This is all I see everytime I startup.
Feb 15, 2014 11:24:23 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
Here is my log file -
devServer:logs dev$ cat catalina.2014-02-15.log
Feb 15, 2014 11:24:23 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
Something seems to be terribly messed up. I can't understand what. Please advise.
I am running tomcat 7.0.50 on Mac OS.
Judging by the logs, it is evident that tomcat is not starting up at all as it should be. I can advise a couple of other tests as well like to
Verify whether or not the ports are getting bound by the tomcat service or not. You can do this by issueing the command netstat -tuplen on the terminal and check to see if port 8080 is getting bound by the tomcat instance or not.
Check to see if you can ping the instance. Try to ping the tomcat instance from a local machine. Then try to ping the public ip of the server to verify whether that server is responding correctly or not
Verify that you have, infact, the complete tomcat template as is used by your other servers. Verify the tomcat installtion folder and compare it with the other tomcat templates as used in rest of your servers. Make sure all folders are there, all configuration (default tomcat config) files are present.
(Just a hunch) Verify read/write/execute privileges as well
Remove your application, shutdown tomcat, empty the logs, and then restart tomcat and re-deploy your application and then view the logs to see if you get some error
Point 3 seems more likely that you have an incomplete tomcat instance, so I advise you to make a copy of the tomcat instance used in any other server and use it in this server to make sure that the server environment is infact how it should be

Tomcat process suddenly crushes

Trying to diagnose some bizarre Tomcat 6 and/or JVM errors on a 64-bit linux machine:
OS VERSION : RED HAT ENTERPRISE LINUX SERVER RELEASE 6.3 (SANTIAGO)
SERVER MODEL : VMWARE VIRTUAL PLATFORM ()
I am running some application tests on virtual machines and facing a weird issue.
The problem occures on certain VMs where exactly 2 process are running: Tomcat Application server process (java process) and a monitor process, at one randomal point, after some random hours of execution the following message can be found on catalina.out (server log) of the VM that fails (the problem doesnt occurs always on same machine):
org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-50100
INFO: Stopping service Catalina
org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
After this moment the Tomcat process is shutted down and execution fails.
No picks can be seen on memory or CPU use.
No system messages can be seen under /var/logs.
At first stage we suspected that an external signal is killing our Tomcat process and we tried to use the -Xrs flag for JVM arguments of the process but issue still occurred.
The java flag (-xrs ) should prevent the Java runtime environment handling exception signals such SIGSEGV and SIGABRT not help
Before adding xrs flag we saw INFO: Pausing Coyote HTTP/1.1 on http-50100 error that happened because outcome signal
After adding `xrs flag the kettle/tomcat behaves the same way and crushes without any errors in log files.
Running starce command on relevant process gives us the following output:
Process 12917 attached - interrupt to quit
futex(0x7f6b9e8ab9d0, FUTEX_WAIT, 12918, NULLPANIC: attached pid 12917 exited with 143
We cannot run starce -f to include all threads because it causes our application to be stuck.
However, killing son process with kill command behaves similary - we see that parent JVM
exit with error code 143 and we see also the signal sent to the son process.
We are running also with java -XX:+HeapDumpOnOutOfMemoryError optind to create a heap dump for jvm crash due to out of memory error but no core dump or heap dumps are creted due to the crush.
Any ideas?
is it possible, that before the crash, there is some sort of memory depletion, so that the java process could be killed by the OOM.
Also, I found a link http://bugs.centos.org/view.php?id=4059 that describes a similar problem.

Categories