Confluence gadget in Jira server throws gadget spec error
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. 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
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.
Run the following SQL statement to identify the stale entry:
select * from externalgadget where GADGET_XML like "%the_stale_url%";
where the
the_stale_url
is the URL mentioned in the WARN message. In this case, the stale URL will be confluence.zentrale.localFor 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
Get the ID's returned by the above SQL statement
Remove the related entries from
externalgadget
:delete from externalgadget where GADGET_XML like "%the_stale_url";