MOSS workflow wont start because 'The requested workflow task content type was not found on the SPWeb'

By Geert van der Cruijsen at July 02, 2008 22:02
Filed Under: SharePoint

The last 2 days my MOSS environment was driving me crazy because an already existing workflow didn't want to start in a new document library in a new subsite. I made this workflow in Visual Studio 2005 and deployed it as a feature to my SharePoint Site. I connected the workflow to a content type and told it to run on new items of this type or whenever an item changes. This workflow worked fine for 2 months in this particular document library.

After 2 months my client asked for a new subsite with a new document library where this workflow should also run. I installed this workflow here and expected everything would go as planned. When I tried to test the workflow I didn't see anything happen so I tried creating new items, changing them, even manually starting the workflow. Nothing happened. The metadata field which contains the workflow status was staying empty. When checking the log files I didn't see anything either.

I tried to reinstall the workflow. Deleted and recreated the site nothing seemed to help. During all this the workflow still worked fine in the other subsite and document library. When I recreated the workflow and checked the logfile again I finally found an error. (it seems Sharepoint only logs this error the first time you start the workflow and after that it doesn't do anything)

The error message in the logfile was the following:

Workflow Infrastructure        72fv Unexpected AutoStart Workflow: System.ArgumentException: De aangevraagde werkstroomtaakinhoudstype is niet gevonden op SPWeb.     at Microsoft.SharePoint.SPList.PrepForWorkflowTemplate(SPWorkflowTemplate wt)     at Microsoft.SharePoint.Workflow.SPWorkflowManager.StartWorkflowElev(SPListItem item, SPFile file, SPWorkflowAssociation association, SPWorkflowEvent startEvent, Boolean bAutoStart, Boolean bCreateOnly)     at Microsoft.SharePoint.Workflow.SPWorkflowAutostartEventReceiver.AutoStartWorkflow(SPItemEventProperties properties, Boolean bCreate, Boolean bChange, AssocType atyp)

this Dutch error (I really hate Dutch errors. you can't look them up on Google/MSDN:( )translated in English is 'The requested workflow task content type was not found on the SPWeb'. I found the exact translation because I was lucky and when I had the English error this gave me new hope to find a weblog with the answer (since weblogs seem the primary documentation for SharePoint 2007 ;) )

I searched for the error and everything I could find was reinstalling the OffWFCommon feature. I tried this with the following commands but nothing changed. I also tried to uninstall and reinstall but this didn't help either

stsadm -o installfeature -filename OffWFCommon\feature.xml
stsadm -o activatefeature -filename OffWFCommon\feature.xml -url http://localhost/

This weblog told me the exact thing that was going on. the TaskListContentType wasn't installed on my tasks documentlibrary when I checked it by enabling content types chaning in the advanced settings of the tasks list. The ID of this content type is 0x01080100C9C9515DE4E24001905074F980F93160 which is the same as the OffWFCommon feature so it definitely had something to do with it. When I checked the content types of my task doclib that was working I noticed it had 2 content types attached. 1 called "Task" and 1 called "Workflow task content type" my Tasks library that wasn't working had a content type called "Tasks". I couldn't find any way how to add these content types because these are system content types and thus hidden.

Solution/Workaround:

Since I already wasted 1 and a half day on this problem my next try was to save the Tasks documentlibrary of the workflow that was working as a template. After that I deleted the workflow in the new document library and also deleted the Tasks list there. I added a new Tasks list by using the template I made and installed the workflow again for this documentlibrary. I tested it and guess what.. everything seemed to work fine. The solution isn't that pretty but I was glad it finally worked!

Hopefully someone with the same problem reads this before they waste to much time on this really awful problem. Also if you know  a better solution please let me know because I would really like to know how to really solve this problem.

Geert van der Cruijsen

Comments

7/26/2010 1:52:56 AM #

Do you say yes guest posts? I'd like to put in writing pair posts here.

Ines Keifer

7/26/2010 1:53:03 AM #

I encounterd difficulties reading your weblog with safari browser, you'll higher replace your blog

Kennith Hedrich

7/26/2010 6:54:39 AM #

Maby considere to write a SharePoint company to put here adv

Karisa Hadaller

7/26/2010 6:54:51 AM #

Can I quote you on my web site if I hyperlink again to your website?

Aubrey Godfrey

7/27/2010 12:23:25 AM #

Hey - nice website, just trying round some blogs, appears a very nice platform you might be using. I'm presently using Wordpress for a few of my websites but trying to change considered one of them over to a platform similar to yours as a trial run. Anything particularly you would advocate about it?

Genia Terhaar

7/27/2010 12:23:30 AM #

SharePoint SharePoint SharePointYou made some good quality points there about SharePoint . I did a search on the subject and found people i've talked to will agree with your blog.

Jerrica Stai

7/27/2010 5:21:59 AM #

Hi, I�m rather impressed by your blogging ability about SharePoint . Please make contact with me if a part-time blog employment sounds like some thing you�d be considering

Karl Alicuben

7/27/2010 5:22:01 AM #

I used to be questioning if you would like to be a visitor poster on my blog? and in change you can put one link the publish? Please reply if you get an opportunity and I will send you my contact details - thanks

Gilma Heckel

Add comment



biuquote
Loading