Follow up on Site crash in MOSS 2007

April 16th, 2007 by steinhof

Finally, MS were able  to solv the issue with my MOSS site.

It turned out to be an issue with the navigation nodes, where nodes where duplicated when publishing pages expired.
I had some long running sessions with the guys from Microsoft Support in Madrid and Redmond, and at some time, they could see 1800 SPRequest object calls, each consuming approx. 2MB on the server. No wonder the poor SharePoint was brought to its knees. But it wasn't a memory leek, mind you.
If we just set the timeout on IIS to a very large number, we could actually get MOSS to respond within an hour Big Smile.

Now, after MS Support was able to reproduce this behaviour, things went extremely fast, and I received a hotfix within 12 hours.
Apparantly the hotfix is somewhat related to the knowledge base article kb932621, so if you experience similar problems, I'd suggest you contact your local MS representative, with this reference in mind.

Site crash on MOSS2007

March 21st, 2007 by steinhof

Hi,

 Just posted the following on the MSDN forum.

—————————-

For some time, I've been struggling with a strange behaviour in Office SharePoint Server 2007, rendering my corporate intranet site completely useless. This is the scenario:

A medium farm with 2 WFE's, 1 index server and 2 SQL Servers.

A custom sitedefinition based on the publishing intranet site template and utilizing several site and web features, including masterpages, pagelayouts and content types. Creating a new sitecollection also deploys several subsites. All this works well, and we have actually accomplished a great deal of automation, in order to meet the customers needs.

After some time, were users have tested the environment, creating a small amount of content, ie. newsarticles, the portal suddenly degrades over a period of hours, until it no longer responds to any requests at all. The Central Administration and other sitecollections work fine though. The error in the ULS is rather strange and seemingly relates to the publishing pages, which have expired:

1) CMS Publishing 8vzf
Unexpected PortalSiteMapProvider was unable to fetch children for node at URL: /News, message: Thread was being aborted., stack trace:    at System.Threading.Monitor.Enter(Object obj)     at Microsoft.SharePoint.Publishing.Navigation.PortalWebSiteMapNode.PopulateNavigationChildren()     at Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapNode.GetNavigationChildren(NodeTypes includedTypes, NodeTypes includedHiddenTypes, OrderingMethod ordering, AutomaticSortingMethod method, Boolean ascending, Int32 lcid)     at Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapNode.GetNavigationChildren(NodeTypes includedHiddenTypes)     at Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider.GetChildNodes(PortalSiteMapNode node, NodeTypes includedHiddenTypes) 

2) Windows SharePoint Services General 8kh7 High
The File /News/Pages/Test.aspx cannot be added (…) draft 

3) CMS Publishing 0 Unexpected
While initializing navigation, found Page placeholder but object was not found at: /NEWS/PAGES/TEST.ASPX.

This error message is shown repeatedly for each publishing page in the news sitecollection.

Trying to open the site, just results in a timeout and unexpected error.

This behaviour occurs both in our test environments (VPC and VMWare and in production (dedicated hardware).
One of my collegues experienced the same behaviour on a small farm, with practically no customization done. He had only 1 publishing page and managed to delete it from the /_layouts/sitemanager.aspx page. And, voila everything worked again. Evidently, this is not a solution for us, and what strikes me as odd, is that it apparently occurs after a while, and seemingly has nothing to do with customized pagelayouts, sitestructure or anything else.

Has anyone out there experienced the same strange behaviour?

 ———————-

I have an incident at Microsoft and hope to get some information and a solution soon.

Where is the documentation?

December 8th, 2006 by steinhof

Ok, so now SharePoint has gone gold, and everybody (at least at Microsoft) is jumping up and down in excitement.

Don't get me wrong – I do like SharePoint – heck I've made it my livelyhood as a SharePoint developer/consultant. But where is the documentation for this monster product?
The SDK for SharePoint 2003 was horrible. It was totally incomplete at product launch, it was imcomplete a year after, and I'll bet, it's incomplete even today!

Let's get something straight: SharePoint is a high profile enterprise product, targeted as the new application platform for Windows. Version 14 (skipping v.13) even more so, according to MS.
Well, wouldn't you expect Microsoft to support the developers a little bit better, by supplying well written and complete documentation by now?
The situation right now is rather frustrating for developers trying to leverage the functionality of SharePoint, especially if you use the SharePoint object model. Let me give you an example:

Content types are new to 2007 and a great addition to the product. Take a look at the online WSS 3.0 SDK documentation (revised november 2006):

The section SPContentType Members contains 29 public properties. Not a single one has a description! If I take a closer look at the Document Template property, it seems to only contain som auto generated description of this property. What's the purpose of this property? How can you use it? Are there any caveats?
Does Microsoft not document their code themselves while writing it? How about a tool for exctracting XML documentation!?  (Who said NDoc?).

By the way – if you look at the Content Type Schema Definiton you will observe that Document Template is obsolete! Makes you wonder what you should do, if you would like to programmatically bind a content type to a document template.

Mike Fitzmaurice has a new post: The RTM SDKs Will Be Downloadable on November 28th, 2006 in which he states, that "The goal is always going to be that the SDK is the ultimate authoriative reference", and further more that "We had a really good team spend a lot of time on this for the 2007 releases, and the situation is markedly different from the 2003-era offerings.  I hope you'll notice the difference."

Well, SharePoint 2007 has grown to be a much bigger product than 2003 – so should the documentation effort be!
But I really don't think we're there yet. This is why we all rely heavily on the community and the very skilled SharePoint experts out there, who makes it all possible. Without people like Amanda, Bill, Jan, Matt, Patrick, Steven, Ted and Todd an all the other great persons out there, sharing their experiences, the SharePoint developer community would fare very badly.

Come on Microsoft. Put the plans for SharePoint V.14 back on the shelf for a while and concentrate on making a good product a GREAT product!

Automatic Approval of Publishing Pages

November 4th, 2006 by steinhof

Recently I got the time to look further into the process of automatic approval of publishing pages in Office SharePoint Server.

In my previous attempt, I had some problems making the approval work properly, and it seemed a little unstable. The method I used looked something like this:

// Get the SPListItem from eventhandler properties and pass it on
SPListItem item = newsPages.Items[this.itemId];

// OK item is found, proceed with approval process
SPModerationInformation modInfo = item.ModerationInformation;
if (modInfo.Status.Equals(SPModerationStatusType.Pending) && !isTopstory) // automatically approve when some criteria is met.
{
    // Check Expiration Date
    DateTime publishingEnd = (DateTime)item["PublishingExpirationDate"];
    if (DateTime.Now < publishingEnd)
    {
    modInfo.Status = SPModerationStatusType.Approved;
    modInfo.Comment = "Newspage was automatically approved by the system";
    }
    else
    {
        modInfo.Status = SPModerationStatusType.Denied;
        modInfo.Comment = "Newspage has expired!";
    }
    item.Update();
}

Notice that this requires the approval rights in SharePoint. I use the COM+ approach to elevate rights.
This seemed to work ok, but only on newly created items. Whenever a publishing page was edited and submitted for approval, the process would not kick in properly.

Now, I had a look into the Microsoft.SharePoint.Publishing assembly, which seems to offer some other way of accessing the scheduling and publishing of an item.

SPList newsPages = site.Lists[some SPList id];
SPListItem item = newsPages.Items[some SPListItem id];

if (item != null)
{
    if (ScheduledItem.IsScheduledItem(item))
    {
        ScheduledItem thisScheduled = ScheduledItem.GetScheduledItem(item);
        thisScheduled.Schedule("Newspage was automatically approved by the system");
    }
}

A much cleaner approach, and it seems to work properly.

Now, with some backsight, I just wonder why the other approach is working at all, as the SPModerationinformation is taken from Microsoft.SharePoint and has nothing to do with the publishing features of Office SharePoint Server. I'll leave this to someone else to explain.

/Steinhof

DelegateControl

October 21st, 2006 by steinhof

Patrick Tisseghem from U2U has posted a nice article on his blog, explaining the SharePoint DelegateControl.
I will definitely have use for this.

You can see the post here: http://blog.u2u.info/DottextWeb/patrick/archive/2006/10/19/34234.aspx

B2TR and ECM

September 25th, 2006 by steinhof

One of the first checks I made, after upgrading from B2 to B2TR, was the Content Management features.

In the project I'm working on, our primary focus is on news publishing. A score of news editors will have the means to create newspages, based on custom page layouts, with bindings to content types that extend the basic Article Page content type. This gives us the opportunity to automatically approve news articles if certain criteria are met. This all worked in B2, though sometimes a little unstable. It also works in B2TR – unstable angry.
The automatic approval process is based on an eventhandler. It should kick in, when a new item is created or an item is changed and check the moderation status. If the status is 'Pending' and the criteria are met, the status is changed to 'Approved'. This does not happen everytime and I cannot figure out why crying I suspect the eventhandling in SharePoint not to be 100% reliable. Has anyone out there similar experiences?

Another problem I discovered in B2 was the item status after the page has expired, i.e. the Scheduled End Date is reached; then the status is changed from Approved to Draft. This does not seem logical. I would have liked it to change to 'Archived' or something like that. The problem is still there in B2TR.

Even though I still have pending problems, I think the B2TR is performing better, and my Active Directory import and Audience targetting works now big smile

My B2TR experiences

September 18th, 2006 by steinhof

My B2TR experiences

I've just upgraded my SharePoint VPC to B2TR. This all went completely uneventful and well. So now I can delve into all the great improvements over B2.

Here are some topics on my list:

ÿ

  • Workflow: does it actually work now? I've had some rather disappointing adventures with WF.
  • Audiences: unable to add "User member of security" rule and actually find a domain security group to compile from.
  • Publishing pages changing from Approved to Draft, when they expire. Should be to from Approved to Archived, so we can actually respond to expiration and do some useful stuff.
  • Import of User Profiles very flaky in my test environment (maybe it has nothing to do with B2).

ÿ

I'll document my findings as we go along the road to RTM.

Automatic approval of publishing pages in MOSS2007

September 15th, 2006 by steinhof

I'm currently working on a way to automatically approve newspages, if they meet certain criteria. My first approach was to make a workflow in SharePoint Designer. Boy, was that a pain? I simply couldn't get it right. I then switched to implementing an eventhandler, which would catch all new or changed newspages, and check the moderation status, subsequently approve the page if it's ok. In order to do this, I had to run the approval rutine with elevated privileges, as a normal contributor cannot approve content. After trying out the standard impersonation techniques using advapi32.dll. This is not working either, as SharePoint always reverts to the actual user. So I ended up using a COM+ approach, setting up a serviced component which runs as a user with approver permissions. This works – sometimes… It seems to be a bit unstable, but maybe that's the eventhandler in B2 not always kicking in, in a timely fashion.

If anybody out there is interested in the solution, please let me know and I'll post an article on the subject.

What's the story?

September 15th, 2006 by steinhof

I'm currently working on a project for the City Hall in Aarhus, Denmark.

The customer wants to migrate a bunch of old intranet sites (web enabled Notes databases) to a new intranet utilizing MOSS2007, and will eventually be used by 30000+ users, were approximately 25000 are external users.
The first step in the project is the mainpage, layout and the hierarchy of the site. It also involves newspage publishing and several levels of publishing approval, including automatic approval of local department news for a given target audience.
The solution gives us a great opportunity to make customized sitedef's, develop features, content types, eventhandlers, etc. I am very excited geeked

Now, with the release of B2TR, we have a lot of work to do, getting the test environment upgraded. It's time to get busy, y'all.

Vanishing views in SharePoint 2003

September 14th, 2006 by steinhof

Darn!

The first article I write here about my experiences with SharePoint, is not a mindnumbing discovery that makes your jaw drop, or an ingenious solution to a problem that will save people hundreds of hours of work, but merely a problem with views disappearing from SharePoint, after meddling with a Forms library.

I know – the problem is self-inflicted – I messed with things I shouldn't have and went adding a webpart to a Forms library, even though it's not supported by Microsoft.

The reason I did it, was that I have a customer who wants to hide the [Upload] and [Create Folder] buttons from the users. So what are the options? To add a Content Editor Web Part to the page and hide the toolbar and make my own? To start up FrontPage 2003 and pray to some higher entity, that no one will ever find out?

Well, I went …aspx?ToolPaneView=2, and all looked dandy, until I discovered that every time I added the CEWP to a viewpage, the view disappeared from the left navigation. Hey, what's going on here!?

I tried to roll back the changes, but it was to late, so I guess, I'll have to re-publish the form templates. Did I mention that I don't like the total lack of flexibility in SharePoint 2003 in some areas? angry