2

I am trying to get list of components within a publication based on given Schema Uri. The code is:

   SearchQueryData query = new SearchQueryData()
   {
          BasedOnSchemas = new BasedOnSchemaData[] { new BasedOnSchemaData() { Schema = new LinkToSchemaData() { IdRef = SchemaTcmUri } } },
          SearchIn = new LinkToIdentifiableObjectData() { IdRef = PublicationUri },
          ItemTypes = new ItemType[] { ItemType.Component }
   };
   try
   {
          XElement xResults = client.GetSearchResultsXml(query);
   }
   catch (System.ServiceModel.CommunicationException commProblem)
   {
          Console.WriteLine("There was a communication problem. " + commProblem.Message + commProblem.StackTrace);
          Console.Read();
   }

I am getting the following error:

There was a communication problem. Error: The remote server returned an error: (403) Forbidden.
Server stack trace:
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Tridion.ContentManager.CoreService.Client.ICoreService.GetSearchResultsXml(SearchQueryData filter)
   at Tridion.ContentManager.CoreService.Client.CoreServiceClient.GetSearchResultsXml(SearchQueryData filter)
   at ExtractUpdateComponetData.ExtractComponentInfo.ComponentInfo() in \App_Code\ExtractComponentInfo.cs:line 50

Any help is appreciated

UPDATE:

CM Version:SDL Tridion 2011 SP 1

Warning in Event Viewer:

Error: The remote server returned an error: (403) Forbidden. 
Component: Tridion.ContentManager.CoreService Errorcode: 854 
User: server\tridion_admin 
StackTrace Information Details: System.Net.HttpWebRequest.GetResponse() 
Tridion.ContentManager.Search.SolrClient.ProcessResponse(HttpWebRequest,Boolean,Boolean,String&) 
Tridion.ContentManager.Search.SolrClient.Post(String,String,String&) 
Tridion.ContentManager.Search.SolrClient.Query(String,Int32,Nullable`1,String&) 
Tridion.ContentManager.Search.SearchQueryEngine.GetSearchResultsFromSolr(SearchQueryData,Int32,Nullable`1) 
Tridion.ContentManager.Search.SearchQueryEngine.GetSearchResultsFromSolr(SearchQueryData,Int32,Nullable`1) 
Tridion.ContentManager.Search.SearchQueryEngine.GetSearchResults(SearchQueryData,Int32) 
Tridion.ContentManager.Search.ComWrapper.SearchQueryEngineFacade.GetSearchResults(Int32,Int32) 
SearchBLST.GetListData SearchBLST.GetSearchResults 
at Tridion.ContentManager.ContentManagement.SearchQuery.GetListResults(Int32 startRowIndex, Int32 maxRows) 
at Tridion.ContentManager.Query.GetListResults() 
at Tridion.ContentManager.CoreService.CoreServiceBase.GetSearchResultsXml(SearchQueryData filter) 
at SyncInvokeGetSearchResultsXml(Object , Object[] , Object[] ) 
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) 
at Tridion.ContentManager.CoreService.TransactionSupportInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) 
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) 
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) 
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)  
  • Cm version? Search was changed from release to release. – Syav4eg Sep 2 '14 at 11:33
  • Also look to EventViewer...there will be additional message. – Syav4eg Sep 2 '14 at 11:37
  • Does search work from the CME? – Nuno Linhares Sep 2 '14 at 12:08
  • Searching a tcmuri works fine in the CME Search but searching a string throws the following error: The remote server returned an error: (403) Forbidden. Unable to get the list of search results. Error occured while processing the request: User not in required role. Where should I add the user?? – Prasoon Srivastava Sep 2 '14 at 12:24
2

We have seen something similar before. Can you check this Question and Answer ? Tridion search not working after changing MTSUser

The problem lies in a 403 error thrown by the solr web application.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.