Confluence gadget in Jira server throws gadget spec error

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

When accessing JIRA dashboard, WARN messages similar like the following will appear in the atlassian-jira.log file:

2012-11-14 20:28:28,913 DirectoryEntryResolverThread-1 WARN kneissl 1228x9693x1 1oi7gfq 79.224.75.250,127.0.0.1 /rest/config/1.0/directory.json [gadgets.renderer.internal.GadgetSpecFactoryImpl] Error occurred while retrieving gadget spec for http://confluence.zentrale.local/rest/gadgets/1.0/g/com.atlassian.confluence.plugins.gadgets:confluence-page-gadget/gadgets/confluence-page-gadget.xml
[......]
2012-11-15 08:41:20,846 DirectoryEntryResolverThread-3 WARN kneissl 521x10546x1 16p56qy 79.224.94.167,127.0.0.1 /rest/config/1.0/directory.json [gadgets.renderer.internal.GadgetSpecFactoryImpl] Error occurred while retrieving gadget spec for http://confluence.zentrale.local/rest/gadgets/1.0/g/com.atlassian.confluence.plugins.gadgets:confluence-page-gadget/gadgets/confluence-page-gadget.xml
2015-07-31 11:26:22,904 http-bio-8443-exec-4 WARN admin 686x2875x1 uyftg2 59.167.252.230 /secure/Dashboard.jspa [gadgets.renderer.internal.GadgetSpecFactoryImpl] Error occurred while retrieving gadget spec for rest/gadgets/1.0/g/com.atlassian.jira.ext.calendar:issuescalendar-gadget/templates/plugins/jira/portlets/calendar/gadget/calendar-gadget.xml

Diagnosis

Check the URL in the warning message is the one you use for Confluence and and returns valid XML.

Cause

The root cause of this is because previously a Confluence gadget has been added to JIRA Gadget Directory. However at some point, Confluence URL has been changed to new one, and JIRA was not updated with the changes. Hence, JIRA will still try to communicate to Confluence using the old URL, and when the application could not be contacted, the WARN message will appear in the logs file. 

Resolution

Remove the stale gadget entry from the database in order to fix the problem. Since the process involves direct database modification, ensure to generate a copy of the latest JIRA backup data before applying the workaround suggested below.


  1. Run the following SQL statement to identify the stale entry:

    select * from externalgadget where GADGET_XML like "%the_stale_url%";

    (info) where the the_stale_url is the URL mentioned in the WARN message. In this case, the stale URL will be confluence.zentrale.local
    (info) For the second error, you need to add the <base URL> and context path, following with the URL in the log i.e. http://<BaseURL>/contextpath/rest/gadgets/1.0/g/com.atlassian.jira.ext.calendar:issuescalendar-gadget/templates/plugins/jira/portlets/calendar/gadget/calendar-gadget.xml

  2. Get the ID's returned by the above SQL statement

  3. Remove the related entries fromexternalgadget:

    delete from externalgadget where GADGET_XML like "%the_stale_url";



Last modified on Sep 25, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.