Trying to upgrade to 10.1 : i get to the upgrade page, once it has completed, i got redirected to the home page however the process stopped suddently.
If i restart the process, it stopped 15-20s after.
In the es.log, here is what i can see
2023.07.19 12:38:41 WARN es[r.suppressed] path: /metadatas/_doc/dbVendor, params: {stored_fields=value, index=metadatas, id=dbVendor}
org.elasticsearch.action.NoShardAvailableActionException: No shard available for [get [metadatas][dbVendor]: routing [null]]
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction.perform(TransportSingleShardAction.java:201) ~[elasticsearch-8.7.0.jar:?]
sonar_10-1.zip (102.6 KB)
Here are my logs. Ignore the first part as i forgot to migrate first to 9.9.1 before trying 10.1.
Anything after 2023.07.19 12:13:12 should be when i was trying from 9.9.1 to 10.1
here is what i see
2023.07.19 12:16:04 WARN web[][o.s.c.a.AnnotationConfigApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@659e0bfd-org.sonar.server.es.IndexCreator': Initialization of bean failed; nested exception is org.sonar.server.es.ElasticsearchException: Fail to execute es requestES get request for key 'dbVendor' on index 'metadatas'
2023.07.19 12:16:04 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@659e0bfd-org.sonar.server.es.IndexCreator': Initialization of bean failed; nested exception is org.sonar.server.es.ElasticsearchException: Fail to execute es requestES get request for key 'dbVendor' on index 'metadatas'
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:628)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:920)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:187)
at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:80)
at org.sonar.server.platform.platformlevel.PlatformLevel4.start(PlatformLevel4.java:662)
at org.sonar.server.platform.PlatformImpl.start(PlatformImpl.java:214)
at org.sonar.server.platform.PlatformImpl.startLevel34Containers(PlatformImpl.java:194)
at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.runIfNotAborted(PlatformImpl.java:362)
at org.sonar.server.platform.PlatformImpl$1.doRun(PlatformImpl.java:113)
at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.run(PlatformImpl.java:346)
at java.base/java.lang.Thread.run(Thread.java:833)
It’s useful, with a stacktrace, to look at all the Caused by lines. Very typically the root of the problem is the last (or sometimes the next-to-last) Caused by.
And sometimes, you can read them like a story:
2023.07.19 12:48:03 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@659e0bfd-org.sonar.server.es.IndexCreator': Initialization of bean failed; nested exception is org.sonar.server.es.ElasticsearchException: Fail to execute es requestES get request for key 'dbVendor' on index 'metadatas'
...
Caused by: org.sonar.server.es.ElasticsearchException: Fail to execute es requestES get request for key 'dbVendor' on index 'metadatas'
...
Caused by: org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=no_shard_available_action_exception, reason=No shard available for [get [metadatas][dbVendor]: routing [null]]]
And then finally
Suppressed: org.elasticsearch.client.ResponseException: method [GET], host [http://127.0.0.1:9001], URI [/metadatas/_doc/dbVendor?stored_fields=value], status line [HTTP/1.1 503 Service Unavailable]
So that leads us to es.log, where unfortunately we find little more detail:
org.elasticsearch.action.NoShardAvailableActionException: No shard available for [get [metadatas][dbVendor]: routing [null]]
But what this confirms is that Elasticsearch isn’t coming up.
The likely causes:
too little free disk space: Elasticsearch wants >=5% free
corrupt indices (delete $SONARQUBE-HOME/data/es8 and restart)