org.springframework.osgi.service.importer.ServiceProxyDestroyedException: service proxy has been destroyed

Atlassian JIRA | Jeff Thomas | 2 years ago
  1. 0

    After upgrading or installing Stash 3.9.1, accessing a repository causes a 500 error. The following message is shown: {noformat} Oops, an error occurred. Please contact your system administrator {noformat} The following can be seen in {{atlassian-stash.log}}: {code}2015-05-18 17:29:49,665 WARN [http-nio-7990-exec-5] admin @5EGP3Fx1049x2325x0 aabcbi 10.10.10.10 "GET /projects/PROJ/repos/REPO/browse HTTP/1.1" c.atlassian.stash.json.JsonRenderer Failed to marshal com.atlassian.stash.internal.repository.InternalRepository to JSON org.springframework.osgi.service.importer.ServiceProxyDestroyedException: service proxy has been destroyed at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor$ServiceLookUpCallback.doWithRetry(ServiceDynamicInterceptor.java:105) ~[na:na] at com.atlassian.stash.scm.protocol.AbstractPluginScmProtocol.getHandlerDescriptors(AbstractPluginScmProtocol.java:121) ~[stash-scm-common-3.9.1.jar:na] at com.atlassian.stash.scm.protocol.AbstractPluginScmProtocol.supports(AbstractPluginScmProtocol.java:110) ~[stash-scm-common-3.9.1.jar:na] at com.atlassian.stash.internal.scm.PluginScmService.getProtocols(PluginScmService.java:265) ~[stash-service-impl-3.9.1.jar:na] at com.atlassian.stash.internal.repository.DefaultRepositoryService.getCloneLinks(DefaultRepositoryService.java:352) ~[stash-service-impl-3.9.1.jar:na] at com.atlassian.stash.rest.enrich.DefaultLinkEnricher.enrichRepository(DefaultLinkEnricher.java:96) ~[na:na] at com.atlassian.stash.rest.enrich.DefaultLinkEnricher.access$100(DefaultLinkEnricher.java:21) ~[na:na] at com.atlassian.stash.rest.enrich.DefaultLinkEnricher$1.apply(DefaultLinkEnricher.java:40) ~[na:na] at com.atlassian.stash.rest.util.RestUtils.processEntities(RestUtils.java:229) ~[na:na] ... 2015-05-18 17:29:50,175 ERROR [http-nio-7990-exec-5] @5EGP3Fx1049x2326x0 aabcbi 10.10.10.10 "GET /mvc/error500 HTTP/1.1" c.a.s.i.web.ErrorPageController There was an unhandled exception loading [/projects/PROJ/repos/REPO/browse] org.springframework.web.util.NestedServletException: Request processing failed; nested exception is com.google.template.soy.tofu.SoyTofuException: When evaluating "to_json($repository)": While computing function "to_json($repository)": null at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978) ~[spring-webmvc-4.1.6.RELEASE.jar:4.1.6.RELEASE] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25) ~[na:na] at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:83) ~[StashAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:111) ~[BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:77) ~[BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:103) ~[atlassian-trusted-apps-core-4.0.0.jar:na] at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:79) ~[na:na] ...{code} *Workaround* Restarting Stash after the upgrade should resolve this.

    Atlassian JIRA | 2 years ago | Jeff Thomas
    org.springframework.osgi.service.importer.ServiceProxyDestroyedException: service proxy has been destroyed
  2. 0

    After upgrading or installing Stash 3.9.1, accessing a repository causes a 500 error. The following message is shown: {noformat} Oops, an error occurred. Please contact your system administrator {noformat} The following can be seen in {{atlassian-stash.log}}: {code}2015-05-18 17:29:49,665 WARN [http-nio-7990-exec-5] admin @5EGP3Fx1049x2325x0 aabcbi 10.10.10.10 "GET /projects/PROJ/repos/REPO/browse HTTP/1.1" c.atlassian.stash.json.JsonRenderer Failed to marshal com.atlassian.stash.internal.repository.InternalRepository to JSON org.springframework.osgi.service.importer.ServiceProxyDestroyedException: service proxy has been destroyed at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor$ServiceLookUpCallback.doWithRetry(ServiceDynamicInterceptor.java:105) ~[na:na] at com.atlassian.stash.scm.protocol.AbstractPluginScmProtocol.getHandlerDescriptors(AbstractPluginScmProtocol.java:121) ~[stash-scm-common-3.9.1.jar:na] at com.atlassian.stash.scm.protocol.AbstractPluginScmProtocol.supports(AbstractPluginScmProtocol.java:110) ~[stash-scm-common-3.9.1.jar:na] at com.atlassian.stash.internal.scm.PluginScmService.getProtocols(PluginScmService.java:265) ~[stash-service-impl-3.9.1.jar:na] at com.atlassian.stash.internal.repository.DefaultRepositoryService.getCloneLinks(DefaultRepositoryService.java:352) ~[stash-service-impl-3.9.1.jar:na] at com.atlassian.stash.rest.enrich.DefaultLinkEnricher.enrichRepository(DefaultLinkEnricher.java:96) ~[na:na] at com.atlassian.stash.rest.enrich.DefaultLinkEnricher.access$100(DefaultLinkEnricher.java:21) ~[na:na] at com.atlassian.stash.rest.enrich.DefaultLinkEnricher$1.apply(DefaultLinkEnricher.java:40) ~[na:na] at com.atlassian.stash.rest.util.RestUtils.processEntities(RestUtils.java:229) ~[na:na] ... 2015-05-18 17:29:50,175 ERROR [http-nio-7990-exec-5] @5EGP3Fx1049x2326x0 aabcbi 10.10.10.10 "GET /mvc/error500 HTTP/1.1" c.a.s.i.web.ErrorPageController There was an unhandled exception loading [/projects/PROJ/repos/REPO/browse] org.springframework.web.util.NestedServletException: Request processing failed; nested exception is com.google.template.soy.tofu.SoyTofuException: When evaluating "to_json($repository)": While computing function "to_json($repository)": null at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978) ~[spring-webmvc-4.1.6.RELEASE.jar:4.1.6.RELEASE] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25) ~[na:na] at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:83) ~[StashAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:111) ~[BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:77) ~[BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:103) ~[atlassian-trusted-apps-core-4.0.0.jar:na] at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:79) ~[na:na] ...{code} *Workaround* Restarting Stash after the upgrade should resolve this.

    Atlassian JIRA | 2 years ago | Jeff Thomas
    org.springframework.osgi.service.importer.ServiceProxyDestroyedException: service proxy has been destroyed
  3. 0

    This occurs in context of Bamboo Plugins implementing Bamboo Task Plugin Modules. When a task's {{TaskConfigurator}} or {{RuntimeTaskDataProvider}} implementation uses an injected dependency object, accessing any method on that object after a plugin disable/enable cycle will trigger a ServiceProxyDestroyedException: {code} [INFO] [talledLocalContainer] 2014-07-17 16:54:57,418 ERROR [http-6990-5] [ExceptionMappingInterceptor] service proxy has been destroyed [INFO] [talledLocalContainer] org.springframework.osgi.service.importer.ServiceProxyDestroyedException: service proxy has been destroyed [INFO] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor$ServiceLookUpCallback.doWithRetry(ServiceDynamicInterceptor.java:105) [INFO] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.support.RetryTemplate.execute(RetryTemplate.java:83) [INFO] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor.lookupService(ServiceDynamicInterceptor.java:430) [INFO] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor.getTarget(ServiceDynamicInterceptor.java:415) [INFO] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [INFO] [talledLocalContainer] at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) [INFO] [talledLocalContainer] at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [INFO] [talledLocalContainer] at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56) [INFO] [talledLocalContainer] at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [INFO] [talledLocalContainer] at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [INFO] [talledLocalContainer] at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) [INFO] [talledLocalContainer] at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [INFO] [talledLocalContainer] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) [INFO] [talledLocalContainer] at com.sun.proxy.$Proxy960.getBaseUrl(Unknown Source) [INFO] [talledLocalContainer] at net.utoolity.atlassian.bamboo.task.ConfigUITaskConfigurator.populateContextForCreate(ConfigUITaskConfigurator.java:44) [INFO] [talledLocalContainer] at com.atlassian.bamboo.ww2.actions.build.admin.config.task.TaskUIConfigBean.prepareCreateHtml(TaskUIConfigBean.java:109) [INFO] [talledLocalContainer] at com.atlassian.bamboo.ww2.actions.build.admin.config.task.CreateTask.input(CreateTask.java:55) […] {code} (full stacktrace attached as [^ServiceProxyDestroyedException.stacktrace.txt]) (i) The exception is only triggered if the TaskConfigurator or RuntimeTaskDataProvider has been invoked at least once before the disable/enable cycle, hinting on them being instantiated on first use, and not getting updated when the underlying Spring/OSGi context is refreshed. Reinstalling the plugin fixes the issue (until the next disable/enable cycle). The problem exists for a single plugin already, but gets worse in a bundled plugin scenario, where updating a dependency plugin triggers a 'background' disable/enable cycle of the dependent plugin, and thus the SPDE problem. (!) Impact: In the TaskConfigurator scenario, this 'only' prevents the user from creating/configuring tasks all of a sudden, however, for the RuntimeTaskDataProvider scenario, *the impact is a failure of all builds using the affected plugin's tasks!* To ease analysis and allow testing of potential workarounds, we have created a small [reproduction demo plugin|https://bitbucket.org/utoolity/bamboo-task-spde-reproduction]. (basic reproduction instructions can be found in the project readme file).

    Atlassian JIRA | 2 years ago | Henrik Opel [Utoolity]
    org.springframework.osgi.service.importer.ServiceProxyDestroyedException: service proxy has been destroyed
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.springframework.osgi.service.importer.ServiceProxyDestroyedException

      service proxy has been destroyed

      at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor$ServiceLookUpCallback.doWithRetry()
    2. Spring OSGi Core
      ServiceDynamicInterceptor$ServiceLookUpCallback.doWithRetry
      1. org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor$ServiceLookUpCallback.doWithRetry(ServiceDynamicInterceptor.java:105)[na:na]
      1 frame
    3. com.atlassian.stash
      RestUtils.processEntities
      1. com.atlassian.stash.scm.protocol.AbstractPluginScmProtocol.getHandlerDescriptors(AbstractPluginScmProtocol.java:121)[stash-scm-common-3.9.1.jar:na]
      2. com.atlassian.stash.scm.protocol.AbstractPluginScmProtocol.supports(AbstractPluginScmProtocol.java:110)[stash-scm-common-3.9.1.jar:na]
      3. com.atlassian.stash.internal.scm.PluginScmService.getProtocols(PluginScmService.java:265)[stash-service-impl-3.9.1.jar:na]
      4. com.atlassian.stash.internal.repository.DefaultRepositoryService.getCloneLinks(DefaultRepositoryService.java:352)[stash-service-impl-3.9.1.jar:na]
      5. com.atlassian.stash.rest.enrich.DefaultLinkEnricher.enrichRepository(DefaultLinkEnricher.java:96)[na:na]
      6. com.atlassian.stash.rest.enrich.DefaultLinkEnricher.access$100(DefaultLinkEnricher.java:21)[na:na]
      7. com.atlassian.stash.rest.enrich.DefaultLinkEnricher$1.apply(DefaultLinkEnricher.java:40)[na:na]
      8. com.atlassian.stash.rest.util.RestUtils.processEntities(RestUtils.java:229)[na:na]
      8 frames