We tried to verify with the dev team if this behavior was ever noticed in similar situations, and we identified only one case that was not possible to reproduce.
Apparently, there was one recorded case on a Windows machine when the start of the instance failed very quickly in the same way, producing only the sonar and the es log files in the logs folder.
The theory is that there were hanging processes that were not properly terminated from a previous execution.
At the next restart, the problem was not there anymore and it was impossible to reproduce it.
The setup where this happened was based on:
Windows 11
JDK Temurin 17.0.6
PostgreSQL database
We did many attempts with MSSQL, integrated security and the JDBC dll but we never managed to end up in the same situation again.
I am wondering if the working execution of version 9.8 on JDK 11 is leaving some processes hanging that block the execution of the 9.9 on JDK17.
We will try to reproduce this error again, but at the moment there is not a clear idea about what can be the cause of your issue.
I am having pretty much the same issue…the 9.9 upgrade failed due to not having OpenJDK17 installed (had OPENJDK11 running with 9.8). After upgrading to OPENJDK17, I get message that I need to update database manually…and after trying to go back to 9.8 (with database restored) I get a message that I cannot use an older Node of Elasticsearch. So I cannot go to 9.9 nor go back to 9.8. This was on my test server.
I think your issue is not related to the one described in the first message of the topic.
In your case the server is starting properly and it is correctly telling you to update the database since you are moving one version up.
What is the issue after updating the database?
The message was a one liner that stated something like “Need to update database manually” with no other information. The strange thing was that I was prompted to continue with the database update, and it started and looked like it completed successfully, and then the SonarQube service failed and in the log was that simple message that I needed to update the database manually. Right now I am trying to get back to version 9.8 (getting a message that I cannot use an older Node of Elasticsearch). Not sure how it knows that I have a new version of elasticsearch. Is elasticsearch stored anywhere besides in the C:\sonarqube\elasticsearch folder?
Is the instance still asking to update the database? I would expect that the update was triggered by hitting the /setup endpoint of your sonarqube instance. In the logs you should see the full list of patches applied to your database at the moment of the upgrade.
If it is still asking for the upgrade at the startup, it means that the upgrade did not started/completed.
To solve that “manually need to update the database” message, (was appearing in the access.log) I had to restore the database from a backup. The database update failed mid process due to the SonarQube 9.9 database upgrade starting while under Open JDK 11 (vs the needed 17). I missed the required JDK upgrade needed from going from SonarQube 9.8 to 9.9. The other issue I was experience was trying to get back to 9.8, elasticsearch was blocking me from using an older version of JDK, I had to delete the folder where the elasticsearch data is stored (sonar.path.data = ??? and sonar.path.temp = ???). So once I got all the elasticsearch data deleted, my database restored, and JDK 11 back on my server, I finally got sonarqube 9.8 to work again. I then removed JDK 11 and installed 17 and did the SonarQube 9.9 deployment and all finally worked.
Elasticsearch is stored in that folder (C:\sonarqube\elasticsearch) and the 2nd place is sonar.path.data and sonar.path.temp (under the sonar.properties.config file, at the bottom under OTHERS).
I need to delete everything in those two folder locations in order to go back to SonarQube 9.8.
We realised that there was an information we are missing here, how are you starting your instance?
As a Windows service? Or as a standalone application?
When analyzing more carefully your logs we noticed that there are a lot of paths shared between the two installations, like the temporary files folder, I think it is worth to test 9.9 as separate as possible from 9.8.
Also for the logs, having 9.9 pointing to a specific separate logs folder not shared with 9.8 would help in debugging what is going on here.
I’m starting as Windows service under domain account. To upgrade from previous version I follow upgrade guide (Upgrading from the ZIP file) so it’s not surprise that all versions share the same Log and Temp directories since they are located in the home dir.
I want to try to install fresh SQ 9.9 with new DB and everything on the same server, maybe it give more info. I’ll keep you posted.
All our attempts at reproducing this issue failed at the moment.
But all our tests were completed with installations living in isolation in their own folders.
What is interesting is that starting as a service you should get at least the logs of the wrapper used for launching the service. Have you checked if more logs are inside the folder of the installation C:\SonarQube\sonarqube-9.9.0.65466\logs rather than in the folder C:\SonarQube\SonarHome\logs?
@Matteo_Mara, after I compared config file with newly installed one line by line I found reason of the error. In our regular sonar.properties file we had line
@Nikita thanks a lot for letting us know!
We will mimic your setup for understanding why no useful logs were printed out. Because that was an unexpected side effect.