We create all our site collections programatically with a custom site def/template. Everything works as expected, except for the crawler. It's apparently denied access to the sites. The crawl logs says:

http://server.localnetwork.lan/somesites/siteName The object was not found. (The item was deleted because it was either not found or the crawler was denied access to it.)

And in the log files I'm getting this:

08/11/2009 14:20:34.01 OWSTIMER.EXE (0x0674)
0x1560 Search Server Common
MS Search Administration
7hmh High exception in SearchUpgradeProvisioner Keyword Config System.InvalidOperationException: jobServerSearchServiceInstance is null at Microsoft.Office.Server.Search.Administration.SearchUpgradeProvisioner..ctor(SearchServiceInstance searchServiceInstance) at Microsoft.Office.Server.Search.Administration.OSSPrimaryGathererProject.ProvisionContentSources()

If I create a site collection manually the crawler is able to access it. The same users/accounts have the same access on both sites, so that shouldn't be the issue.

The code we use to actually create the site collection looks a little like this:

SPWebApplication app = SPWebApplication.Lookup(new Uri("WebApplicationUrl"));
app.FormDigestSettings.Enabled = false;
app.Sites.Add("url", "title", "description", "language code", "SiteTemplateName", "Owner.Username", "Owner.Fullname", "Owner.Email");
app.FormDigestSettings.Enabled = true;

The code has been slightly altered to protect the innocent... ;)

Any idea what we're doing wrong?

(Please note, I'm not sure if this is a programming error or a config/setup error, so I'm cross-posting with Stackoverflow)

  • When you create the site collections by hand, is it in the same managed path as when you create them through code? Also, do you have any custom crawl rules setup that might affect the situation? – MattB Aug 11 '09 at 14:04
  • Yes, same managed path. No custom crawl rules at all. – noocyte Aug 12 '09 at 5:38
  • A few other questions - have you tried creating a site programmatically, but with a standard SharePoint template instead of a custom template? When you create the sites by hand, are they with the custom template? – MattB Aug 12 '09 at 15:45

Answer on Stackoverflow

  • Any idea why your hand created sites were working, but not the programmatic ones? I've seen this error before, but didn't suggest it because it typically causes all crawls to fail. – MattB Aug 13 '09 at 17:26
  • I have no idea... It appears to work now, so we're happy... ;) – noocyte Sep 30 '09 at 9:16

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.