Archive

Posts Tagged ‘Timer Job’

SharePoint Timer Job – Error during encryption or decryption

January 13th, 2011 No comments

The other day I went to deploy a solution to our SharePoint farm and got the following error in the Solution Management in Central Administration.  Some important background info is that this solution first created a Web Application.

image

We have a 4 server farm and the solution wasn’t deploying to any of the servers.  Looking at the event log, we had several different errors all containing the text (the event ID for all of them was 6398):

Error during encryption or decryption. System error code 997.
Error during encryption or decryption. System error code 0.
Error during encryption or decryption. System error code 122.

All of these were based on a time job provisioning something, either the web application or the solution, or come to find out, some of our search services were having errors starting.  The web application for this solution was being created on one of our servers, but failing on the other three (this was what was actually holding up the solution from being deployed).

After doing some searching everyone gave two options:

1. Recreate your SharePoint Configuration database…yeah right, this is going to be our VERY LAST attempt.

2. Run stsadm –o updatefarmcredentials (if you want to stop reading here, run this command first and it should fix the errors listed above…ONLY if this doesn’t work consider recreating your SharePoint Configuration database)

Neither one of these really seemed to make sense, we created all 4 servers in the farm from scratch, install SharePoint on all of them at the same time, created about 8 web applications that had all provisioned fine already, and never made any changes to user credentials (as some posts suggested).  Since the web application was being created fine on Server 1, we started looking at servers 2-4 as to what happened that would block a web application from being provisioned.  We couldn’t find anything.

Finally, we looked at Server 1.  This server had a timer job running with a different credentials than Servers 2 – 4.  Come to find out, when the install had been done, for some reason SharePoint was installed on Server 1 with one set of credentials and on Servers 2 – 4 with a complete different set of credentials.  After realizing this, we conceded to the fact that yes, user credentials are probably all messed up in our SharePoint Configuration database.  We ran the stsadm –o updatefarmcredentials command this morning and all of a sudden the web application could be created, search services started and solutions were able to be deployed.

 

I’m still baffled as to how our original 8 web applications were created and how solutions were properly deployed previously, but hey, at least everything is fixed now and set up properly.

Reset Search Index – SharePoint Timer Job

July 7th, 2010 No comments

We have been having an issue with our search indexing and crawling in one of our SharePoint farms.  The problem is that after an undetermined set of time, pretty much all search queries wind up returning several results that show nothing but an IE icon.  The result isn’t attached or any page or give any textual information.  Obviously best case would be to figure out what causes this error, but at this point in time we haven’t been able to find the problem.

However, what we have discovered is that simply resetting the search index and running a full crawl will solve the issue.

So…until we can solve the issues, I wrote a small SharePoint timer job that simply resets our search index right before a scheduled full crawl runs.  I used Andrew Connell’s post (http://www.andrewconnell.com/blog/articles/CreatingCustomSharePointTimerJobs.aspx) to develop the Timer Job, Solution and Feature and modified it and was able to find the following code on http://www.sharepointdev.net/sharepoint–development-programming/programmatically-reset-all-crawled-content-41959.shtml that I inserted into the timer job frame work in order to automatically reset our index on a regular schedule to minimize the risk of our search issue effecting the end users.

try
{
    SearchContext sc = SearchContext.GetContext(ServerContext.Default);
    sc.Reset(true);
}
catch (Exception ex)
{
    throw new InvalidOperationException("Unable to reset content index.", ex);
}

For some of you, this may not seem like much, but coming from the SharePoint Administration/Configuration side of SharePoint and having very little real development experience I was rather proud of myself.