Tuesday, December 5, 2017

Search has encountered a problem that prevents results form being returned

I seemed to start getting this error after the last update that I did for the applications on SharePoint 2013.  One of my customers called and sent me a screen shot of the error. 
 I did some digging on my application server but what really stood out to me was that I was getting search service application failed every time I tried to run a full crawl in the Search service.  On the application server I noticed that I was running out of room on my "C" drive when this happened. I did some research, and from what I was reading this is not an unusual problem with an easy fix.

I know that in the KB Matt King writes about doing everything through PowerShell.  I just made the changes through Regedit.

The only problem that I came across was that after I made the changes I still had the same issue.  My SharePoint 2013 search still did not work.  But I was pretty sure that there was a permissions problem simply because I made these changes in SharePoint and the Windows Registry and did not change any of the service account permissions so that everything could work together.  I found this KB by Sathish Nadarajan that outlined how to fix another issue that I ran into some time earlier.  Psconfig -cmd secureresources command is used to secure permissions for SP resources.

After I ran this command I was able to re crawl my SharePoint site collections.
   

Tuesday, July 25, 2017

Logon Failure: The target account name is incorrect after migration

This is article is about the steps that I had to follow to keep a host named and sharename active after websites on an old server in a different domain have been migrated to a new server and the old server was shut down.

ServerA.domain1.lcl -- Old Server
ServerB.domain2.lcl -- New Server

So After the directories were copied and IIS was configured on the new server, there were a few steps to follow in order to keep the share intact so that nothing had to be changed through program development.

1.  A CNAME had to be added in DNS so any queries against DNS will resolve the ServerA to the ip address of ServerB.  That is pretty simple.

2.  Create the share for the files moved using the same share name as on SeverA and give appropriate permissions.

 So the new Share name is :  \\ServerB\web  where as on the old server it was:  \\ServerA\web

3.  SeverA's NetBios name had to be added to the ServerB's server name list.  There are many ways to do this discussed in this article by Jose Berreto .
What I ended up doing was using the NetDom command:

NETDOM COMPUTERNAME ServerB /ADD ServerA
NETDOM COMPUTERNAME ServerB /ADD ServerA.domain1.lcl

 4. Clean up the old Server name.  At this point when I would try to connect to the share I got "The target account name is incorrect"  So what I had to do to correct this was:

add domain1.lcl to the "append these DNS suffixes"  list in the advance TCP/IP settings
Ipconifg /flushdns
Ipconfig /registerdns
on ServerB

Disable the ServerA Account
in Active Directory

Then I was able to access the Share using \\ServerA\Web

Wednesday, June 21, 2017

SharePoint 2013 -- Unable to load workflow actions from the server



After migrating a web application from SharePoint 2013 the developer was having issues opening Workflows in SharePoint Design 2013.  She was getting:



I did some reading and from what I found there are numerous causes for this error.  I found an article by Harry Chen  that was really helpful. Following his article, I opened fiddler and then opened the application in question in SP Designer 2013.  I then opened up my workflow.  



After the error appeared I went to Fiddler and saw the 500 error.  I saw that the error for me was trying to load \15\TEMPLATES\Features\Reporting Server.  I looked on my SharePoint 2013 application server in that same directory and saw the folder.  So I copied that folder and pasted it in the same location on my Web Front End Server.  I restarted the application and the web site.  The error went away and the workflow opened in SharePoint 2013 Designer.  



Friday, June 16, 2017

SharePoint 2013 -- one web app not loading in browser all other sites working


I imported and updated a SharePoint site from 2010 to 2013.  The next morning I noticed that the site was inaccessible from any browser.  When I went to Central Admin -> Application Management -> Site Collections -> Configure quotas and locks I saw that the Web App was in read only and I could not make any selections because they were greyed-out.  I took the site out of maintenance mode:

$Admin = new-object Microsoft.SharePoint.Administration.SPSiteAdministra
tion("http://hostname")
$Admin.ClearMaintenanceMode()

The site was still inaccessible from a browser.

I tried a few more troubleshooting steps mostly related to IIS.  -- iisreset, recreating the web application but nothing that I tried worked.  By the way when the page finally loaded I would either get a 500 error or "page could not be found"  at this point.

I had to call Microsoft for help...

First thing we did was download USLViewer  This makes the log files from SharePoint easier to read



The things that stood out were that I was getting timeouts when connecting to the database

System.InvalidOperationException: Timeout expired.  The timeout period elapsed prior to obtaining a connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached.    
 at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)    
 at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)    
 at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)    
 at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)    
 at System.Data.SqlClient.SqlConnection.Open()    
 at Microsoft.SharePoint.Utilities.SqlSession.OpenConnection()    
 at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock)    
 at Microsoft.SharePoint.SPSqlClient.ExecuteQueryInternal(Boolean retryfordeadlock)


Exception trying get context compatibility level: Microsoft.SharePoint.SPException: There is no Web named "/". ---> System.Runtime.InteropServices.COMException: There is no Web named "/".    
 at Microsoft.SharePoint.Library.SPRequestInternalClass.OpenSite(String bstrUrl, Boolean bGetUrlOnly, String& pbstrServerRelativeUrl, Guid& pgSiteId, Int32& pOwnerID, Int32& pSecondaryContactID, DateTime& pdtLastContentChange, DateTime& pdtLastSecurityChange, Int32& plSchemaMajorVersion, Int32& plSchemaMinorVersion, Int32& plSchemaBuildVersion, Int32& plSchemaRevisionVersion, Boolean& pfIsEvalSite, Guid& pgSourceSiteId, DateTime& pdtExpirationDate, Guid& pgEvalSiteId, Int32& plUpgradeFlags, DateTime& pdtReminderDate)    
 at Microsoft.SharePoint.Library.SPRequest.OpenSite(String bstrUrl, Boolean bGetUrlOnly, String& pbstrServerRelativeUrl, Guid& pgSiteId, Int32& pOwnerID, Int32& pSecondaryContactID, DateTime& pdtLastContentChange, DateTime& pdtLastSecurityChange, Int32& plSchemaMajorVersion, Int32& plSchemaMinorVersion, Int32& plSchemaBuildVersion, Int32& plSchemaRevisionVersion, Boolean& pfIsEvalSite, Guid& pgSourceSiteId, DateTime& pdtExpirationDate, Guid& pgEvalSiteId, Int32& plUpgradeFlags, DateTime& pdtReminderDate)     -
 -- End of inner exception stack trace ---    
 at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)    
 at Microsoft.SharePoint.Library.SPRequest.OpenSite(String bstrUrl, Boolean bGetUrlOnly, String& pbstrServerRelativeUrl, Guid& pgSiteId, Int32& pOwnerID, Int32& pSecondaryContactID, DateTime& pdtLastContentChange, DateTime& pdtLastSecurityChange, Int32& plSchemaMajorVersion, Int32& plSchemaMinorVersion, Int32& plSchemaBuildVersion, Int32& plSchemaRevisionVersion, Boolean& pfIsEvalSite, Guid& pgSourceSiteId, DateTime& pdtExpirationDate, Guid& pgEvalSiteId, Int32& plUpgradeFlags, DateTime& pdtReminderDate)    
 at Microsoft.SharePoint.SPSite.InitSite()    
 at Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.GetContextCompatibilityLevel(Uri requestUri)


So we ran a command to extend the timeout for the to database.

stsadm -o getproperty -pn database-connection-timeout
stsadm -o setproperty -pn database-connection-timeout -pv 45

This did not work.  So we decided to take a look at the SQL server and see if there were any issues.  This is where thins got interesting...

we had to run some queries 

In SQL Management Studio on the main tool bar select "New Query"  and Type your query in the dialogue box.  After you type your query you choose the Execute button to run it.   

first query was sp_who -- this listed all the databases on the server as well as status and other information.  The problem was that we needed to look at the data organized by the actual database.  This command just listed the data unorganized.  

so we ran this query next:

CREATE TABLE #sp_who2 (SPID INT,Status VARCHAR(255),
      Login  VARCHAR(255),HostName  VARCHAR(255), 
      BlkBy  VARCHAR(255),DBName  VARCHAR(255), 
      Command VARCHAR(255),CPUTime INT, 
      DiskIO INT,LastBatch VARCHAR(255), 
      ProgramName VARCHAR(255),SPID2 INT, 
      REQUESTID INT) 
INSERT INTO #sp_who2 EXEC sp_who2
SELECT      * 
FROM        #sp_who2
-- Add any filtering of the results here :
WHERE       DBName <> 'master'
-- Add any sorting of the results here :
ORDER BY    DBName ASC
DROP TABLE #sp_who2

this actually creates a temp db and stores the info in it and a more organized format.  There was a column BLK By and on the database in question there were about 4 or 5 process numbers that occupied this column that had numbers of the SPIDs where processes were being blocked.  SPIDs server SQL Process IDs.  Each processes ID referenced another process ID.   More on this later,,,


The next querry we ran was:

EXEC sp_MSforeachtable 'UPDATE STATISTICS ? WITH FULLSCAN'

The MS guy said that you could have problems like the one that I was having if you do not have a maintenance routine that does not update statistics. We thought that could be the problem.  We ran this and it was still running the next day.

So the MS guy (Joe) talk to a colleague and found out that all those processes that were running could be being blocked by a root process and if we kill the root process it that would in turn let all the other processes run and then allow the site load in a browser.  So we ran one final SQL query

Kill "process number"  without the quotes 

The way to find the root process is to find the process that is not referencing any other process number.  

After we killed the route process all the other processes completed the update statistics completed and I was able to load the web application in Internet Explorer.  

Friday, March 24, 2017

Creating a P7B Cert for Tomcat apps


A P7B ssl cert is a binary cert that contains both public and private key that is used by Tomcat and Java for secure transport.  Arun GP  gives a great write up about the different SSL formats.  When you download a SSL cert for Tomcat from Entrust the cert is in PEM format so if you need to convert it to a P7B cert you have to do a few extra steps.

Import the PEM cert in Internet Explorer:

Go to IE on the main menu choose Tools > Options > Content Tab > Certificates button.


choose import and upload your PEM cert. Go through the Wizard.



When you are done close IE and open it again.

Export the SSL in P7B format using Internet Explorer:


Go to IE on the main menu choose Tools > Options > Content Tab > Certificates button.

This time highlight your cert that you upload and choose the export button and go through the wizard
again.


Choose P7B format choose "Include all certificates in the certification path if possible"



Give it a name and finish.

There are other ways to change the format of a cert.  SSL Shopper has a pretty handy web application.  Or you can download and install Openssl and use the command line.