InvalidFilterSearchRequestException: Invalid searchId/projectId given <number>


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


A specific gadget can't load the filter information correctly and the following errors are observed in the atlassian-jira.log:

Invalid searchId:

2022-06-01 03:52:37,652 https-jsse-nio-8443-exec-21 ERROR anonymous 232x77517x1 15nxq5p XXX.XX.XX.XXX,XX.XX.XXX.XXX /rest/calendar-plugin/1.0/calendar/htmlcalendar.html [c.a.j.ext.calendar.HtmlCalendar] The project chosen (null) doesn't exist or that user doesn't the appropriate permission. Invalid searchId given 34121
com.atlassian.jira.ext.calendar.model.InvalidFilterSearchRequestException: Invalid searchId given 34121
at com.atlassian.jira.ext.calendar.model.CalendarSearchRequest.getSearchForProjectOrSearchId(CalendarSearchRequest.java:190)
at com.atlassian.jira.ext.calendar.model.CalendarSearchRequest.<init>(CalendarSearchRequest.java:156)
at com.atlassian.jira.ext.calendar.HtmlCalendar.getCalendarParameters(HtmlCalendar.java:132)
at com.atlassian.jira.ext.calendar.HtmlCalendar.getParameters(HtmlCalendar.java:89)
at com.atlassian.jira.ext.calendar.rest.CalendarResource.getCalendar(CalendarResource.java:205)

Invalid projectId:

2024-06-28 10:18:56,184-0400 http-nio-8080-exec-102 url: /rest/calendar-plugin/1.0/calendar/htmlcalendar.html ERROR anonymous 618x3358226x5 - XXX.XXX.XX.XXX,XXX.XXX.XX.XXX /rest/calendar-plugin/1.0/calendar/htmlcalendar.html [c.a.j.ext.calendar.HtmlCalendar] The project chosen (68909) doesn't exist or that user doesn't the appropriate permission. Invalid projectId given 68909
com.atlassian.jira.ext.calendar.model.InvalidFilterSearchRequestException: Invalid projectId given 68909
	at com.atlassian.jira.ext.calendar.model.CalendarSearchRequest.getSearchForProjectOrSearchId(CalendarSearchRequest.java:201)
	at com.atlassian.jira.ext.calendar.model.CalendarSearchRequest.<init>(CalendarSearchRequest.java:156)
	at com.atlassian.jira.ext.calendar.HtmlCalendar.getCalendarParameters(HtmlCalendar.java:132)
	at com.atlassian.jira.ext.calendar.HtmlCalendar.getParameters(HtmlCalendar.java:89)
	at com.atlassian.jira.ext.calendar.rest.CalendarResource.getCalendar(CalendarResource.java:237)

Environment

  • Jira Data Center.

Cause

This error is has been observed when a specific gadget is using an invalid filter/project as source of its data.

Solution

To identify the gadgets that are using an invalid search criteria, we can use one the solutions below, depending on whether there error is for an invalid 'searchId' or 'projectId'

Invalid 'searchId' (filter):

  1. Check whether the filter exists in the database by running the following SQL statement:
    (info) Replace <ID> with the filter ID informed on the error messages.

    SELECT * FROM searchrequest WHERE id = '<ID>';
  2. Then, check which gadgets are using the deleted filter running the query below:
    (info) Replace <ID> with the filter ID informed on the error messages.

    SELECT portalpage.id as DashboardID, portalpage.pagename as DashboardName, portalpage.username as DashboardOwner, gadget_xml, userprefkey, userprefvalue 
    FROM portalpage 
    INNER JOIN portletconfiguration ON portalpage.id = portletconfiguration.portalpage INNER JOIN gadgetuserpreference ON portletconfiguration.id = gadgetuserpreference.portletconfiguration 
    WHERE userprefkey ILIKE '%filter%'
    AND userprefvalue IN ('filter-<ID>', '<ID>');
  3. If the filter does not exist and is being used by any gadget, go to the dashboard and edit the affected gadget.
  4. Update or remove the filter from the gadget as needed.

Invalid 'projectId':

  1. Check whether the project exists in the database by running the following SQL statement:
    (info) Replace <ID> with the project ID informed on the error messages.

    SELECT * FROM project WHERE id = '<ID>';
  2. Then, check which gadgets are using the deleted filter running the query below:
    (info) Replace <ID> with the project ID informed on the error messages.

    SELECT portalpage.id as DashboardID, portalpage.pagename as DashboardName, portalpage.username as DashboardOwner, gadget_xml, userprefkey, userprefvalue 
    FROM portalpage 
    INNER JOIN portletconfiguration ON portalpage.id = portletconfiguration.portalpage INNER JOIN gadgetuserpreference ON portletconfiguration.id = gadgetuserpreference.portletconfiguration 
    WHERE userprefkey ILIKE '%project%'
    AND userprefvalue IN ('project-<ID>', '<ID>');
  3. If the project does not exist and is being used by any gadget, go to the dashboard and edit the affected gadget.
  4. Update or remove the project from the gadget as needed.


Last modified on Jul 1, 2024

Was this helpful?

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