buildMacroMetadata Error During Upgrade or Startup
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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.
*Except Fisheye and Crucible
Summary
When upgrading or starting up Confluence the following error shows up in atlassian-confluence.log:
2022-03-21 17:21:44,039 ERROR \[AtlassianEvent::CustomizableThreadFactory-14] \[confluence.macro.browser.DefaultMacroMetadataManager] buildMacroMetadata Error getting data from MacroMetadataProvider,
java.lang.NullPointerException
at com.atlassian.gadgets.renderer.internal.http.HttpClientFetcher.addResponseToCacheIfSuccessful(HttpClientFetcher.java:102\)
at com.atlassian.gadgets.renderer.internal.http.HttpClientFetcher.performRequest(HttpClientFetcher.java:123\)
at com.atlassian.gadgets.renderer.internal.http.HttpClientFetcher.fetch(HttpClientFetcher.java:73\)
at org.apache.shindig.gadgets.DefaultMessageBundleFactory.fetchBundle(DefaultMessageBundleFactory.java:138\)
at org.apache.shindig.gadgets.DefaultMessageBundleFactory.getNestedBundle(DefaultMessageBundleFactory.java:111\)
at org.apache.shindig.gadgets.DefaultMessageBundleFactory.getBundle(DefaultMessageBundleFactory.java:79\)
at org.apache.shindig.gadgets.DefaultMessageBundleFactory.getParentBundle(DefaultMessageBundleFactory.java:124\)
at org.apache.shindig.gadgets.DefaultMessageBundleFactory.getNestedBundle(DefaultMessageBundleFactory.java:101\)
at org.apache.shindig.gadgets.DefaultMessageBundleFactory.getBundle(DefaultMessageBundleFactory.java:79\)
at org.apache.shindig.gadgets.DefaultMessageBundleFactory.getParentBundle(DefaultMessageBundleFactory.java:127\)
at org.apache.shindig.gadgets.DefaultMessageBundleFactory.getNestedBundle(DefaultMessageBundleFactory.java:101\)
at org.apache.shindig.gadgets.DefaultMessageBundleFactory.getBundle(DefaultMessageBundleFactory.java:79\)
at org.apache.shindig.gadgets.variables.VariableSubstituter.substitute(VariableSubstituter.java:47\)
at com.atlassian.gadgets.renderer.internal.GadgetSpecFactoryImpl.getGadgetSpec(GadgetSpecFactoryImpl.java:127\)
at com.atlassian.gadgets.renderer.internal.GadgetSpecFactoryImpl.getGadgetSpec(GadgetSpecFactoryImpl.java:83\)
at sun.reflect.GeneratedMethodAccessor1939.invoke(Unknown Source\)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43\)
at java.lang.reflect.Method.invoke(Method.java:498\)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343\)
at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56\)
at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60\)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186\)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136\)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124\)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186\)
at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70\)
at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53\)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186\)
at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57\)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186\)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136\)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124\)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186\)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212\)
at com.sun.proxy.$Proxy2461.getGadgetSpec(Unknown Source\)
at com.atlassian.confluence.plugins.gadgets.metadata.GadgetsMacroMetadataProvider.generateMacroMetadata(GadgetsMacroMetadataProvider.java:188\)
at com.atlassian.confluence.plugins.gadgets.metadata.GadgetsMacroMetadataProvider.getMacroMetadata(GadgetsMacroMetadataProvider.java:90\)
at com.atlassian.confluence.plugins.gadgets.metadata.CachingGadgetsMacroMetadataProvider.retrieveMetadataAndUpdateCache(CachingGadgetsMacroMetadataProvider.java:236\)
at com.atlassian.confluence.plugins.gadgets.metadata.CachingGadgetsMacroMetadataProvider.getData(CachingGadgetsMacroMetadataProvider.java:172\)
at com.atlassian.confluence.macro.browser.DefaultMacroMetadataManager.buildMacroMetadata(DefaultMacroMetadataManager.java:144\)
at com.atlassian.confluence.macro.browser.DefaultMacroMetadataManager.onPluginFrameworkStartedEvent(DefaultMacroMetadataManager.java:72\)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method\)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62\)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43\)
at java.lang.reflect.Method.invoke(Method.java:498\)
at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:42\)
at com.atlassian.confluence.event.ConfluenceListenerHandlersConfiguration$TimedListenerInvoker.invoke(ConfluenceListenerHandlersConfiguration.java:96\)
at com.atlassian.confluence.event.ConfluenceEventDispatcher$VCacheRequestContextRunnableFactory$1.lambda$run$0(ConfluenceEventDispatcher.java:93\)
at com.atlassian.confluence.vcache.VCacheRequestContextOperations.lambda$doInRequestContext$0(VCacheRequestContextOperations.java:50\)
at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContextInternal(VCacheRequestContextManager.java:84\)
at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:68\)
at com.atlassian.confluence.vcache.VCacheRequestContextOperations.doInRequestContext(VCacheRequestContextOperations.java:49\)
at com.atlassian.confluence.event.ConfluenceEventDispatcher$VCacheRequestContextRunnableFactory$1.run(ConfluenceEventDispatcher.java:93\)
at com.atlassian.confluence.event.ConfluenceEventDispatcher$1.run(ConfluenceEventDispatcher.java:61\)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149\)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624\)
at java.lang.Thread.run(Thread.java:748\)
Environment
Confluence data center or server.
Cause
As seen in the stack trace this error relates to gadgets:
com.atlassian.gadgets.renderer.internal.http.HttpClientFetcher.addResponseToCacheIfSuccessful
In this instance, Confluence is verifying existing gadget configuration and cannot reach a gadget URL.
Solution
This error can be effectively ignored and does not block an upgrade or startup. However, some gadgets may not function.
Navigate to General Configuration > External Gadgets and verify that both the Gadget Specifications and Gadget Feeds URLs are accessible by the server hosting Confluence.