none
Unknown error in the change query dialog of a search results webpart

    Question

  • I'm having an issue with a SharePoint 2013 search results webpart. I set up the web part and everything worked perfectly fine for a few weeks but then I went to edit the webpart and when I click the change query button I get the build your query dialog window that states "An unknown error occured". 

    Has anyone had this issue or can anyone point me to the error log where this type of event is logged?   

    * UPDATE: I've noticed this issue is only affecting one subsite and not any of the other subsites in its site collection. Also that it is site wide meaning any new search results webpart I add to any page in the site have the same unknown error occurs in the change query dialog window.

    Error Picture





    • Edited by Tyler Cook Tuesday, June 25, 2013 1:03 PM
    Thursday, June 13, 2013 8:01 PM

Answers

  • Okay, I found the issue and was able to fix my error.

    I closely watched the SharePoint log files while causing the error to happen and even without a correlation ID I saw the error on the QueryBuilder.aspx page as it was happening. (Exception in Query Builder OnLoad: System.ArgumentException: An entry with the same key already exists.) After a quick search for this error I found this technet article here that explains that this issue happens when a content type is added to the root site and to a subsite with the same name.

    In my case I had copied the default approval workflow in my root site so SharePoint Designer created a content type named 'Approval Workflow Task _x0028_en-US_x0029_ Copy' at the root level. Then I realize I wanted the same thing on a subsite and not on the root site so I copied the default approval workflow into the subsite in which case SharePoint Designer created a content type named 'Approval Workflow Task _x0028_en-US_x0029_ Copy' at the subsite level. Because the subsite had a content type with the same name as a content type on the root site the QueryBuilder.aspx page on the subsite would error out when trying to populate a dropdown box of content types.

    To resolve the issue I deleted one of the content type's named 'Approval Workflow Task _x0028_en-US_x0029_ Copy' and instantly the Build You Query dialog work again.

    Lesson learned: Always rename your content types to something unique!

    • Marked as answer by Tyler Cook Monday, July 08, 2013 7:39 PM
    Monday, July 08, 2013 7:39 PM

All replies

  • Were you able to solve this problem. I am getting the same problem even in central admin

    Thursday, July 04, 2013 5:25 AM
  • No solution yet, I'm going to apply the June 2013 CU this weekend and then try to troubleshoot the Search Service Application some more. I'll post anything that I find.

    Friday, July 05, 2013 12:24 PM
  • Sure thanks.
    Monday, July 08, 2013 9:12 AM
  • Okay, I found the issue and was able to fix my error.

    I closely watched the SharePoint log files while causing the error to happen and even without a correlation ID I saw the error on the QueryBuilder.aspx page as it was happening. (Exception in Query Builder OnLoad: System.ArgumentException: An entry with the same key already exists.) After a quick search for this error I found this technet article here that explains that this issue happens when a content type is added to the root site and to a subsite with the same name.

    In my case I had copied the default approval workflow in my root site so SharePoint Designer created a content type named 'Approval Workflow Task _x0028_en-US_x0029_ Copy' at the root level. Then I realize I wanted the same thing on a subsite and not on the root site so I copied the default approval workflow into the subsite in which case SharePoint Designer created a content type named 'Approval Workflow Task _x0028_en-US_x0029_ Copy' at the subsite level. Because the subsite had a content type with the same name as a content type on the root site the QueryBuilder.aspx page on the subsite would error out when trying to populate a dropdown box of content types.

    To resolve the issue I deleted one of the content type's named 'Approval Workflow Task _x0028_en-US_x0029_ Copy' and instantly the Build You Query dialog work again.

    Lesson learned: Always rename your content types to something unique!

    • Marked as answer by Tyler Cook Monday, July 08, 2013 7:39 PM
    Monday, July 08, 2013 7:39 PM
  • I was not working with content types. I was working with Synonym Dictionary & Query Rules section. Then it suddenly gave above error. I reverted whatever i had done. But still same issue.

    Thanks for updating. If you come to know of anything else, please let me know.

    Thursday, July 11, 2013 6:53 AM
  • Hello All,

    I am guessing this error occours in the SharePoint standard edition. I will update as i upgrade to enterprise edition and try all over again.

    Thanks!

    Monday, October 19, 2015 8:37 PM
  • I am having the same issue but i have checked Content Type in site and Sub site, all is fine. No same content type name and other things. Still problem exists and i have no clue and no other error in Log too. 

    Friday, October 30, 2015 12:09 PM
  • Thanks so much for this, been driving me crazy the whole day!
    Wednesday, November 11, 2015 12:19 PM
  • awesome - removing a duplicate content type resolved this for me. Thanks
    • Proposed as answer by Jimbob7200 Thursday, June 14, 2018 1:01 AM
    • Unproposed as answer by Jimbob7200 Thursday, June 14, 2018 1:01 AM
    Thursday, June 14, 2018 1:01 AM