I was upgrading sonarqube from 9.8 to 9.9 and ran into a java issue, the sonarqube service immediately failed after starting due to a java issue. I figured out that starting with sonarqube 9.9 one needs to have java 17 (I had java 11). So I install java 17 and started Sonarqube up, it then allowed me to proceed to the update database part, which completed, but then the sonarqube service immediately failed. In the logs it stated that I had to manually update the database. So, I decided to start over. I had the database restore from a week back, and I installed sonarqube 9.8 and it also failed after starting, with the message “java.lang.IllegalStateException: cannot downgrade a node from version [7.17.8] to version [7.17.6]” 7.17.8 is the elasticsearch from 9.9 and 7.17.6 is the elasticseach version from 9.8. Right now I want to just get back to sonarqube version 9.8 but that downgrade a node error is stopping me. I have removed java 17 and even had the database restored and restarted the server. How do I get back to sonarqube 9.8?
java.lang.IllegalStateException: cannot downgrade a node from version [7.17.8] to version [7.17.6]
Hi,
To revert to 9.8, you should only need to restore your DB backup and spin your 9.8 instance back up.
Regarding 9.9, can you re-visit those server logs and see if there were any errors?
Â
Ann
I have had the database restored and re-installed 9.8 (both from a back-up folder and even downloaded 9.8) and I still get “java.lang.IllegalStateException: cannot downgrade a node from version [7.17.8] to version [7.17.6]”. I cannot figure out how it is seeing the ElasticSearch 7.17.8. Does ElasticSearch exist somewhere else besides the C:\sonarqube\elasticsearch folder?
Hi,
Where are you seeing that?
Do you perhaps have a zombie process still running?
Â
Ann
That message shows up in the ES.Log. What is a zombie process and how to find/stop? Here is the message from the ES.log (and log attached):
java.lang.IllegalStateException: cannot downgrade a node from version [7.17.8] to version [7.17.6] at o
es.log (5.9 KB)
rg.elasticsearch.env.NodeMetadata.upgradeToCurrentVersion(NodeMetadata.java:95) ~[elasticsearch-7.17.6.jar:7.17.6]
Hi,
Given the C:\
path you provided earlier, I guess you’re on Windows. Have you restarted the machine since either your failed upgrade or your attempted downgrade?
A zombie process in this case would be the Elasticsearch process started by 9.9 and not properly shut down with the server. Restarting would take care of it. Otherwise I believe you have to dig into the process explorer. (It’s been a very long time since I used Windows.)
Â
Ann
I think I just figured out where to get rid of elasticsearch, from an old sonarqube message it stated it was stored/setup in the sonar.properties file under OTHERS (bottom of file), which I had setup as:
Paths to persistent data files (embedded database and search index) and temporary files.
Can be absolute or relative to installation directory.
Defaults are respectively /data and /temp
sonar.path.data=…/sonarqubedata/data
sonar.path.temp=…/sonarqubedata/temp
After deleting those to folders I am now getting past the “cannot downgrade a node” message.
My new message is that I have a newer version of sonarqube on my database (from my attempt yesterday to try to go forward). I am waiting to get my database restored again.
My plan is to try to get sonarqube 9.8 running under JDK11 again…then I will upgrade to JDK17, then I will upgrade to Sonarqube 9.9. I am doing all this on my dev server before I try this on our Prod server. I need to follow the above process since that is what I will be looking at for PROD (so no skipping steps). I was a bit blind-sighted on the JDK17 requirement for Sonarqube 9.9, so just trying to get back to last week back to 9.8 and then start again.