SonarQube server won't start - maven

I've been using SonarQube for a year now and once I had been through all the installation process, I never got any problem... Until now.
I'm just trying to analyze a Maven Project (like I did several times before). To do so, I need to run the server first (port 9000). But when I launch "StartSonar.bat" (I'm on Windows), I get a huge log and finally the wrapper stops.
I think there is something wrong with the port 9000 although I'm not sure because I'm not that advanced with analysing logs and everything.
Here's a link to download the log I get
Thanks for your help!

The log states "Address already in use: bind" which means that some other tool already runs on that port. Choose another one should already do the trick.
Or there is a zombie-process still running (no clean shutdown). But you should see a process in the task manager - just kill that one. Usually a reboot should solve that too.

Run netstat -abo on the Windows command line to see which ports are used, by which programs they are used and their process IDs (PID). With the PID you can find the process in Task Manager and kill it there if necessary.

Related

How can I see all the processes that were run during a specific time period

I know that PS will show me all the currently running processes. But that won't show me anything that's started, then stopped, during some time span. Is there any other way that I can see all the processes that were run during some event?
I'm trying to setup a way of auditing all the processes that ran during a build compilation. I can use PS to check all the running processes at the start of the build, and even run it again at the end. And I can setup a separate thread that will run PS over and over and over again during the build to catch all the processes that might have been run in the middle. But is there some better way of accomplishing this task that I'm not aware of?
This build is being run on a mac, so it uses the mac version of bash.
After your processes have run you can go to the Console (in the Applications/Utilities Folder) and check the system logs for the time period of interest. Many messages are written so the narrower the time window the better.

On Windows 7, how can I find what a process is given the process number?

Background:
I am trying to start solr on my Windows machine. I was able to start and stop it in a cygwin window, but got a warning message about needing lsof. So I thought I'd see what happened if I tried starting it via the Windows command prompt. When I did that, I got the message:
ERROR: Process 7128 is already listening on port 8983. If this is
Solr, please s top it first before starting (or use restart). If this
is not Solr, then please choose a different port using -p PORT
Question:
I can't seem to figure out what Process 7128 is.
When I look in the Task Manager under Processes, it does not include Process IDs. When I look under Services it does, but I have nothing numbered 7128
In the cygwin window where I had started and stopped solr,
ps -ef | grep 7128
and
ps -ef | grep solr
both return no results.
Note that this is not a question specifically about starting solr on Windows, I just gave that for background. What I want to know is how to figure out what a specific process is on a Windows machine, given a process ID.
You can ask Task Manager to show you process IDs (and lots of other interesting stuff too).
Go to the View menu and choose Select Columns.

How can my bash script detect that tomcat is fully stopped? [duplicate]

This question already has answers here:
shell script to kill tomcat service if it is not stopped by stop command after certain amount of time?
(2 answers)
Closed 6 years ago.
I have tomcat downloaded on my computer (not installed as a service).
I am writing a script that upgrades a webapp running on the tomcat server. The script roughly works like this:
Stop tomcat
Perform several upgrade operations
Start tomcat
When performing the upgrade operations, I need to know that tomcat is fully stopped. However if I run $TOMCAT_HOME/bin/catalina.sh stop then that script exits before tomcat is actually stopped and if I execute the upgrade operations while tomcat is still running that might cause things to crash. In addition, the upgrade operations may finish quickly and this can cause the tomcat startup to execute before the shutdown is complete which causes tomcat to crash.
Right now my solution is to wait for 5 seconds after the shutdown is initiated but I am wondering if there is a more elegant solution to the problem.
One way to verify whether the process is still running is by using its process id. Depending on your installation, you should be able to find the process id of your tomcat server in:
/opt/tomcat/catalina.pid
In theory, if this file is empty, then the process should have ended although depending on the implementation and certain circumstances (tomcat crashing?) this might not be true. To be safe, you can take the pid found in this file and just check whether this process is still running.
ps -p <pid>
The above command will return the pid, the time and the command of the process if it is still active.
Another option would be to check if a certain port (the one that Tomcat uses) can be bound. If you can't bind on this port, it means that Tomcat is still running.
Anyway, Felix's solution is more appropriate and it's probably better to use it. I only wrote my suggestion in order to provide more alternatives, also not all Tomcat installations have catalina.pid (at least the default one doesn't).

Remotely Executing an Independent .exe on an Apache Server [CGI]

I have an executable program I've created which is a server. I would like to be able to start and stop instances of this program on a Windows Server 2008 machine via the website the same machine hosts.
The functionality I'm hoping to achieve is: from anywhere I can access my website to start and stop instances of the server code instead of constantly Remote Desktop-ing into it just to start/stop it.
I've tried using Perl, but when I run the code it looks like it prints out some of the information the program does (so it's working) but then seems to stop. Whereas I would like it to start an instance of the program as its own process.
Perl:
#!C:/Perl64/bin/perl.exe
print "Content-type: text/plain\n\n";
exec('C:\file.exe');
I'm not sure what language I should be using or if there are completely other, better ways of achieving my goal. Thanks!
exec is the wrong choice, and so are threads. Simply start the process in the background. You did not say how you would normally stop the server. If it has its own command for stopping, the same as for starting applies; else kill the process.

Killing processes on Windows 7

I'm debugging plugins on Windows 7 and of course the plugin host (Cubase5.exe) occasionally crashes because of errors in the plugin. On XP or Vista, I could always restart it immediately and continue working. But on Windows 7, even though Cubase appears to close, it is still visible in Task Manager and I cannot kill it by any means. After a minute or two, it disappears by itself. In the mean time, I can't work because the plugin DLL is still locked by the process.
Does anyone know why this happens on Windows 7? I've already tried disabling Automatic Error Reporting but that didn't help. I've tried attaching cdb to Cubase, but I get:
Cannot debug pid 5252, NTSTATUS 0xC0000001
"{Operation Failed} The requested operation was unsuccessful."
Debuggee initialization failed, NTSTATUS 0xC0000001
"{Operation Failed} The requested operation was unsuccessful."
I tried following the instructions here but it appears this is only possible if I connect a second machine to my computer to debug it remotely.
I finally found the solution, using this article:
http://blogs.technet.com/b/markrussinovich/archive/2005/08/17/unkillable-processes.aspx
This required installing the Windows Debugging Tools for Windows (nice name) and LiveKd, but by following the steps outlined I was able to track which driver was causing the process to hang: it turned out to be the 64-bit driver for the M-Audio Oxygen 8 V2 controller I'm using. Unfortunately no driver update is available.
Anyway, if anyone encounters a similar problem, this is the way to solve it.
Have you tried Process Explorer by Mark Russinovich? It is really useful for "killing":)
If you have error reporting enabled, it's possible that werfault.exe has Cubase open to write a minidump for crash reporting purposes.
This is just a stab in the dark but it might be your problem.
One thing you can try is to check with Process Monitor what Cubase is doing. Set a filter so that everything with a process name containing "cubase" will be recorded. It could be that you are facing some timeout issue when Cubase wants to exit.
you can end the process the service is running under. You can find this process by going to the Services tab of the Task Manager, right-clicking, and selecting Go To Process(you need to click the Show processes from all users button.). Note that one process may host multiple services (especially if it's svchost.exe), and ending the process will kill all those services. Also, this is an unclean exit, and may cause data corruption depending on what the service(s) was doing when you killed it.
Depending on which specific service you are trying to stop, there may be a cleaner way to simulate failure.

Resources