Bamboo installation fails with "Unable to create a tracker when osgi is not running" errors

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

要約

Bamboo installation fails after going through the Create admin step (this is the last step from the setup wizard) with the following exceptions being thrown inside the <bamboo-home>/logs/atlassian-bamboo.log file and on the user interface:

2022-12-06 15:50:19,230 ERROR [http-nio-8085-exec-22] [runtime] Error executing FreeMarker template
FreeMarker template error:
The following has evaluated to null or missing:
==> ctx.functionalTest  [in template "fragments/decorator/header.ftl" at line 228, column 11]

----
Tip: It's the step after the last dot that caused this error, not those before it.
----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use [#if myOptionalVar??]when-present[#else]when-missing[/#if]. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #if !ctx.functionalTest  [in template "fragments/decorator/header.ftl" in macro "defineConvertMutativeLinksFunction" at line 228, column 5]
	- Reached through: @defineConvertMutativeLinksFunction  [in template "fragments/decorator/header.ftl" at line 59, column 1]
	- Reached through: #include "/fragments/decorator/header...  [in template "fragments/decorator/decorators.ftl" in macro "displayHtmlHeader" at line 56, column 9]
	- Reached through: @decorators.displayHtmlHeader require...  [in template "decorators/focusTask.ftl" at line 3, column 1]
----

Java stack trace (for programmers):
----
freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]
	at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:134)
	at freemarker.core.UnexpectedTypeException.newDescriptionBuilder(UnexpectedTypeException.java:85)
	at freemarker.core.UnexpectedTypeException.<init>(UnexpectedTypeException.java:48)
	at freemarker.core.NonBooleanException.<init>(NonBooleanException.java:47)
	at freemarker.core.Expression.modelToBoolean(Expression.java:195)
	at freemarker.core.Expression.evalToBoolean(Expression.java:178)
	at freemarker.core.Expression.evalToBoolean(Expression.java:163)
	at freemarker.core.NotExpression.evalToBoolean(NotExpression.java:34)
	at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:48)
	at freemarker.core.Environment.visit(Environment.java:383)
	at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:889)
	at freemarker.core.Environment.invokeMacro(Environment.java:825)
	at freemarker.core.UnifiedCall.accept(UnifiedCall.java:87)
	at freemarker.core.Environment.visit(Environment.java:347)
	at freemarker.core.Environment.visit(Environment.java:353)
	at freemarker.core.Environment.include(Environment.java:2955)
	at freemarker.core.Include.accept(Include.java:171)
	at freemarker.core.Environment.visit(Environment.java:347)
	at freemarker.core.Environment.visit(Environment.java:389)
	at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:889)
	at freemarker.core.Environment.invokeMacro(Environment.java:825)
	at freemarker.core.UnifiedCall.accept(UnifiedCall.java:87)
	at freemarker.core.Environment.visit(Environment.java:347)
	at freemarker.core.Environment.visit(Environment.java:353)
	at freemarker.core.Environment.process(Environment.java:326)
	at freemarker.template.Template.process(Template.java:383)
	at com.atlassian.bamboo.ww2.FreemarkerRequestDispatcherPageFilter.applyDecorator(FreemarkerRequestDispatcherPageFilter.java:123)
	at org.apache.struts2.sitemesh.TemplatePageFilter.applyDecorator(TemplatePageFilter.java:116)
	at com.atlassian.bamboo.ww2.FreemarkerRequestDispatcherPageFilter.access$200(FreemarkerRequestDispatcherPageFilter.java:46)
	at com.atlassian.bamboo.ww2.FreemarkerRequestDispatcherPageFilter$BambooSitemeshDecorator.render(FreemarkerRequestDispatcherPageFilter.java:245)
	...
2022-12-06 15:50:19,240 ERROR [http-nio-8085-exec-22] [BambooFreemarkerManagerSoyHelpers] Error while rendering soy template: bamboo.layout.focused
com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Unable to create a tracker when osgi is not running
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2055)
	at com.google.common.cache.LocalCache.get(LocalCache.java:3966)
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3989)
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4950)
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4956)
	at com.atlassian.bamboo.plugin.osgi.OsgiServiceProxyFactoryImpl.lambda$serviceAccessor$0(OsgiServiceProxyFactoryImpl.java:97)
	at com.atlassian.bamboo.plugin.osgi.InvocationHandlers$SameClassLoaderInvocationHandler.invokeServiceMethod(InvocationHandlers.java:85)
	at com.atlassian.bamboo.plugin.osgi.InvocationHandlers$DynamicServiceInvocationHandler.invoke(InvocationHandlers.java:45)
	at com.sun.proxy.$Proxy348.render(Unknown Source)
	at com.atlassian.bamboo.ww2.BambooFreemarkerManagerSoyHelpers$SoyHelper.renderNoCache(BambooFreemarkerManagerSoyHelpers.java:98)
	at com.atlassian.bamboo.ww2.BambooFreemarkerManagerSoyHelpers$SoyHelper.render(BambooFreemarkerManagerSoyHelpers.java:88)
	at com.atlassian.bamboo.ww2.BambooFreemarkerManagerSoyHelpers$SoyHelper.render(BambooFreemarkerManagerSoyHelpers.java:80)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	...
	at com.atlassian.seraph.filter.SecurityFilter.doFilter(SecurityFilter.java:88)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at com.atlassian.seraph.filter.BaseLoginFilter.doFilter(BaseLoginFilter.java:148)
	at com.atlassian.seraph.filter.BambooLoginFilter.doFilter(BambooLoginFilter.java:36)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:50)
	at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:44)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.orm.hibernate5.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:156)
	at com.atlassian.bamboo.persistence.BambooSessionInViewFilter.doFilterInternal(BambooSessionInViewFilter.java:24)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at com.atlassian.bamboo.filter.BambooCompressingFilter.doFilter(BambooCompressingFilter.java:39)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at com.atlassian.bamboo.filter.RequestCacheThreadLocalFilter.doFilter(RequestCacheThreadLocalFilter.java:40)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at com.atlassian.bamboo.filter.ClickjackingAndMimeTypeSniffingPreventionFilter.doFilter(ClickjackingAndMimeTypeSniffingPreventionFilter.java:36)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at com.atlassian.bamboo.filter.CookieCacheControlFilter.doFilter(CookieCacheControlFilter.java:49)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at com.atlassian.core.filters.HeaderSanitisingFilter.doFilter(HeaderSanitisingFilter.java:37)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:50)
	at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:44)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
	at org.apache.catalina.valves.StuckThreadDetectionValve.invoke(StuckThreadDetectionValve.java:206)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:698)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:367)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:639)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:882)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1647)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalStateException: Unable to create a tracker when osgi is not running
	at com.atlassian.plugin.osgi.container.felix.FelixOsgiContainerManager.getServiceTracker(FelixOsgiContainerManager.java:444)
	at com.atlassian.plugin.osgi.container.felix.FelixOsgiContainerManager.getServiceTracker(FelixOsgiContainerManager.java:436)
	at com.atlassian.bamboo.plugin.osgi.OsgiServiceProxyFactoryImpl$1.load(OsgiServiceProxyFactoryImpl.java:49)
	at com.atlassian.bamboo.plugin.osgi.OsgiServiceProxyFactoryImpl$1.load(OsgiServiceProxyFactoryImpl.java:46)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3533)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2282)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2159)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2049)
	... 120 more

環境

This was observed on Bamboo 8.0.9 but can happen to other versions of Bamboo.

診断

The following actions can be taken to diagnose the issue and confirm that you're running into the problem described in this article:

  1. After hitting the Finish button in the Create admin step of the setup wizard you are redirected to a page that does not appear to have any style (CSS) and displays only the "Unable to create a tracker when osgi is not running" exception mentioned above.
  2. Check your <bamboo-install>/atlassian-bamboo/WEB-INF/classes/seraph-config.xml file and confirm whether the following authenticator class is enabled:

    <authenticator class="com.atlassian.crowd.integration.seraph.v25.BambooAuthenticator"/>
  3. Still on the <bamboo-install>/atlassian-bamboo/WEB-INF/classes/seraph-config.xml file confirm that Bamboo is NOT using the following authenticator class:

    <authenticator class="com.atlassian.bamboo.user.authentication.BambooAuthenticator"/>
  4. Look for the presence of the following error message inside the <bamboo-home>/logs/atlassian-bamboo.log and/ or <bamboo-install>/logs/catalina.out file containing the name of the user you set during the Create admin step:

    2022-12-06 15:50:19,088 INFO [http-nio-8085-exec-22] [DefaultAuthenticator] login : 'myuser' could not be authenticated with the given password
    2022-12-06 15:50:19,088 WARN [http-nio-8085-exec-22] [DefaultAuthenticator] login : 'myuser' tried to login but they do not have USE permission or weren't found. Deleting remember me cookie.
    2022-12-06 15:50:19,143 ERROR [http-nio-8085-exec-22] [FiveOhOh] 500 Exception was thrown.
    java.lang.SecurityException: Could not login admin user 'myuser'
            at com.atlassian.bamboo.ww2.actions.setup.SetupAdminUserAction.loginAdminAccount(SetupAdminUserAction.java:50)
            at com.atlassian.bamboo.ww2.actions.setup.SetupAdminUserAction.execute(SetupAdminUserAction.java:34)
  5. Open the <bamboo-shared-home>/configuration/bamboo-shared.cfg.xml file and look for Bamboo's buildNumber. The file will not be empty however it won't contain the required buildNumber since the application setup hasn't finished. Attempting to restart Bamboo will result in the following error being thrown in the <bamboo-home>/logs/atlassian-bamboo.log file:

    2022-12-06 16:15:47,992 ERROR [localhost-startStop-1] [DefaultAtlassianBootstrapManager] Home is not configured properly:
    com.atlassian.config.ConfigurationException: Your shared Bamboo configuration (<bamboo-shared-home>/configuration) version (0) is too old comparing to local node Bamboo version (buildNumber). Shared home Bamboo version expected to be equal or greater than local Bamboo node version.
    	at com.atlassian.bamboo.setup.DefaultBootstrapManager.afterConfigurationLoaded(DefaultBootstrapManager.java:132)
    	at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.init(DefaultAtlassianBootstrapManager.java:75)
    	at com.atlassian.bamboo.setup.BootstrapLoaderListener.contextInitialized(BootstrapLoaderListener.java:155)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4763)
    	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5232)
    	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
    	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
    	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    	at java.base/java.lang.Thread.run(Thread.java:834)

    The <bamboo-shared-home>/configuration/bamboo-shared.cfg.xml should contain the same buildNumber set inside the <bamboo-home>/bamboo.cfg.xml (e.g. for Bamboo 8.0.9 it'd be 80019) but because the installation hasn't finished properly there's no buildNumber inside the bamboo-shared.cfg.xml file.

原因

This is caused by the fact that Bamboo's default authentication mechanism has been changed to the one used for Crowd SSO inside the <bamboo-install>/atlassian-bamboo/WEB-INF/classes/seraph-config.xml file:

<authenticator class="com.atlassian.crowd.integration.seraph.v25.BambooAuthenticator"/>

This prevents Bamboo from finishing the setup and authenticating using the local admin account configured during the Create admin step

ソリューション

Since this is a new setup the best approach is to start the installation from scratch.

  1. Stop Bamboo.
  2. Open the <bamboo-install>/atlassian-bamboo/WEB-INF/classes/seraph-config.xml file.
  3. Comment out the following authenticator class:

    <authenticator class="com.atlassian.crowd.integration.seraph.v25.BambooAuthenticator"/>
  4. Uncomment (or add in case it was removed) the following authenticator class:

    <authenticator class="com.atlassian.bamboo.user.authentication.BambooAuthenticator"/>
  5. Remove the contents of the following folders:
    1. <bamboo-home>
    2. <bamboo-shared-home>
  6. Delete the database created for Bamboo and create a new one. At this stage Bamboo will have created some tables already so it's important to wipe out the database and start again with a new database.
    1. This step is only required if you're using an external database. If you're using Bamboo's H2 embedded database the database file will be removed in step 5 together with the content of the <bamboo-shared-home> folder.
  7. Start Bamboo and go through the setup wizard once again.


After Bamboo has been properly set up you can follow the instructions outlined on the "Integrating Crowd with Atlassian Bamboo" page to integrate Bamboo with Crowd and enable SSO by updating the <bamboo-install>/atlassian-bamboo/WEB-INF/classes/seraph-config.xml file again.


最終更新日: 2022 年 12 月 6 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.