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.