Wednesday, May 12, 2010

Sharepoint Workflows - Failed on Start (retrying)

This ought to be a lot of *fun* troubleshooting.  It’s the biggest product that I support for my company and also, at times, the most complex.  As you may have already seen this Workflow Error: Failed on Start (retrying), I have not.  At least not from a well formed workflow.  I’ve seen this come from the accidental infinite loop, so with that aside, this has become a nasty problem for me.  Currently this is happening on all workflows, once it’s initiated.  I have workflows that fire when an item is created, some that only fire manually, and others that fire when the item has changed…  A digital medley of workflow love.  All of these are having the same problem, all at once.

Things that make you go HMMMMM

This has got to be from the recent upgrade I just went through.  I upgraded to SP2 because of another error I was getting with content types.  Go figure, move from one problem to another ;-).  Sometimes I feel stranded on an island, but then I turn to the Sharepoint Community for help and they are always right there.  Websites like SharepointOverflow.com, Stump the Panel, and I can’t forget Twitter!  Without these websites and the people that converse within them, I wouldn’t do SharePoint.  It’d be too much for just me to handle.

 The AH HA moment (More like well it’s fixed now, so I’ll move on)

Listed below are the errors I was able to pull from the ULS logs on my server.

Errors:

05/11/2010 16:42:24.97*
w3wp.exe (0x208C)
0x1B14
Windows SharePoint Services
Workflow Infrastructure
936l
High
...eExecutor(Guid instanceId, CreationContext context, WorkflowExecutor executor, WorkflowInstance workflowInstance) at System.Workflow.Runtime.WorkflowRuntime.Load(Guid key, CreationContext context, WorkflowInstance workflowInstance) at System.Workflow.Runtime.WorkflowRuntime.GetWorkflowExecutor(Guid instanceId, CreationContext context) at System.Workflow.Runtime.WorkflowRuntime.InternalCreateWorkflow(CreationContext context, Guid instanceId) at System.Workflow.Runtime.WorkflowRuntime.CreateWorkflow(Type workflowType, Dictionary`2 namedArgumentValues, Guid instanceId) at Microsoft.SharePoint.Workflow.SPWinOeHostServices.Send(SPWinOeWorkflow winoeworkflow, SPWorkflowEvent e) at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(Guid trackingId, SPWorkflowHostServi...

05/11/2010 16:42:24.97*
w3wp.exe (0x208C)
0x1B14
Windows SharePoint Services
Workflow Infrastructure
936l
High
...ce host, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut)

05/11/2010 16:42:24.97
w3wp.exe (0x208C)
0x1B14
Windows SharePoint Services
Workflow Infrastructure
936l
High
Engine RunWorkflow: System.Workflow.ComponentModel.Compiler.WorkflowValidationFailedException: The workflow failed validation. at System.Workflow.Runtime.WorkflowDefinitionDispenser.ValidateDefinition(Activity root, Boolean isNewType, ITypeProvider typeProvider) at System.Workflow.Runtime.WorkflowDefinitionDispenser.LoadRootActivity(Type workflowType, Boolean createDefinition, Boolean initForRuntime) at System.Workflow.Runtime.WorkflowDefinitionDispenser.MruCache.GetOrGenerateDefinition(Type type, String xomlText, String rulesText, Byte[] md5Codes, Boolean initForRuntime, Boolean& exist) at System.Workflow.Runtime.WorkflowDefinitionDispenser.GetRootActivity(Type workflowType, Boolean createNew, Boolean initForRuntime) at System.Workflow.Runtime.WorkflowRuntime.Initializ...

As I was gathering information to troubleshoot this error, suddenly, the workflows *just work*!  OH WOW!  Since I’m a big fan of “If it isn’t broke, don’t fix it.”, I’ll be leaving this alone for now.  If anyone has a clue as to how this could’ve happened, feel free to drop a comment.  Please note that all of my workflows are built in SPD only.  Nothing custom and no OOTB workflows have been built.  I’m sure I’ll be updating this article again…

Update:
This may be a fix: http://blogs.msdn.com/wael/archive/2008/01/11/workflow-failed-on-start-retrying.aspx; specifically this command: Lodctr /R "c:\Windows\Microsoft.Net\Framework\v3.0\Windows Workflow Foundation\perfcounters.ini".
I'm not going to run it until the thing breaks again, so we'll have to wait.

Tuesday, May 11, 2010

Another Facebook #Fail

How many more of these privacy leaks must we endure from Facebook?  Here’s another hack that I was told about and have confirmed true.  I believe it’s fixed at this point, but for all of the millions of other Facebook notifications *THIS WORKS*

In the mail header of the email there is a very weak encryption in place:

X-Facebook: from zuckmail ([MjA5Ljg1LjIyNS4xMDQ=])

So all you have to do is decode the MIME base64 string:

$ perl -MMIME::Base64 -e 'print decode_base64("MjA5Ljg1LjIyNS4xMDQ=");' or just go to a base64 Decoder site.

THE SHOCKER?!?  IT’S YOUR IP ADDRESS!

209.85.225.104

It’s child’s play to track someone’s IP address right back to their front door step.  This is just another reason I’ve cancelled my Facebook account permanently.  As of this writing, I believe the hash does now only resolve to 127.0.0.1, but WTF?  This is simple stuff guys…

Monday, May 10, 2010

Batch Feature Installation w/ Logging (Expanded)

Michael Greene wrote an excellent script earlier today.  Since I like to try what I see, I took the script a bit further and added a bit more of logic.  You can see the original script here Batch Feature Installation w/ Logging.  I’ve added more logic to the URL input, EVENTCREATE, and it’ll install every .wsp that you have in the directory.  Here’s how to use this script:

  1. Copy and paste the script into a batch file
  2. Place the batch file in the directory that has all of your .wsp’s
  3. Run the batch file and type the URL of the Site Collection (don’t worry if you mistype the http:// portion of the URL, I have an error checker for that ;-) )

So what will this do? Add the solution(s), deploy the solution(s), install them, and activate all of them in one fell swoop.  Cool eh?  Great for deployment scenarios or setting up those test box vm’s.  Feel free to add more… As I’m posting this, I already have thought of a way to bulk add .stp’s.  Maybe another post?

@echo off
setlocal enabledelayedexpansion
color 0E
Title Auto .wsp Deploy
rem *******************  Deploys all .wsp's in the current directory to the Site Collection ***************************
rem ******************* How to use?  Put this batch file in the same directory as your .wsp's *********************
rem ******************* The script will find every .wsp and deploy it to the Site Collection of your choice ********
rem ******************* I guarantee this will destroy your sharepoint farm unless you know what this ***********
rem ******************* code does.  Please make sure you test this before production usage. *********************
rem ****************** Sets vars *********************************************************************************************
set "path=C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\;%PATH%"
set _http=http://
set /P _inputURL="Please enter the url the site collection to activate the feature(s) to: "
rem ******************* Checks the URL and appends http:// if needed **************************************************
IF /I %_inputURL:~0,7% == %_http% (
echo URL is in correct format
set _URL=%_inputURL%
) ELSE (
set _URL=%_http%!_inputURL!
)
echo.
echo.
Echo ************* Finding .wsp files *************
for %%a in (*.wsp) do call :ROUTINE "%%a"
GOTO :EOF
:ROUTINE
Echo Adding Solution
stsadm.exe -o addsolution -filename %1
Echo Deploying Solution
stsadm.exe -o deploysolution -name %1 -allowGacDeployment -immediate -force
Echo Installing Feature
stsadm.exe -o installfeature -name %~n1 -force
IF errorlevel == 0 (
EVENTCREATE /L System /T Success /SO "SharePoint" /ID 3 /D "%1 Installed"
) else (
EVENTCREATE /L System /T Error /SO "SharePoint" /ID 3 /D "%1 didn't install properly"
)
Echo Activating Feature
stsadm.exe -o activatefeature -name %~n1 -url %_URL% -force
IF errorlevel == 0 (
EVENTCREATE /L System /T Success /SO "SharePoint" /ID 4 /D "%1 Activated"
Echo Activation of feature %1 COMPLETE!
) else (
EVENTCREATE /L System /T Error /SO "SharePoint" /ID 4 /D "%1 didn't activate properly"
)
echo Running timer jobs to finish deployment
stsadm.exe -o  execadmsvcjobs
PING 127.0.0.1 -n 12 -w 100 2>NUL | FIND "TTL=" >NUL


You can also copy the script from this link: Batch Feature Installation w/ Logging (Expanded)

Wednesday, April 14, 2010

HTML5 is changing more than the web

This is more of an observation of what I see the internet will be in the next 10 years. Think back to 2000 and how the web used to look then, compared to now. It’s almost a laughable matter. I would’ve never been able to pull of my Twitter Marriage Proposal. ^_^ HTML5 will change how software is developed, with database caching and drag and drop being the biggest catalyst.

Microsoft has dedicated itself to creating a browser that is capable to handle HTML5. Lucky for us it’s the next iteration of Internet Explorer. And yes if you opened the last link up with IE8, it doesn’t work that well unfortunately… With everything computer related, there is always a better way to do it. That’s why the HTML5 standard is so important. It’ll open so many possibilities. One major capability will be to run applications from the cloud and have direct access to everything when you aren’t connected. That’s absolutely HUGE! I see the ability to use a computer without ever installing an application natively. This could work so well, that this may never be an offering again…

How will Microsoft compete?

Currently there are licensing costs for Microsoft’s O.S. as well as SQL Server for that matter. With the transformation of the web, Microsoft will have to rethink how they license their software in order to position themselves as the web platform of choice. LAMP (Linux, Apache, MySQL, PHP) servers can be downloaded freely and setup with relatively no costs. There are compelling reasons for using these types of deployments for the web (e.g., here and here) Did I mention it’s free?; Because it’s free… That doesn’t mean there isn’t any hope in securing the top spot. Microsoft has been focusing on allowing new startups to compete for relatively no costs as well. It’s also making it very easy to deploy major applications on top of IIS.

Licensing, Licensing, Licensing!!!

One of the most compelling reasons for using a LAMP deployment is licensing. Costs can make or break companies these days. How to get off the ground with little costs is a question I’ve asked myself. Maybe you have too… There are many entry level ways (as I’ve shown above) to get up and running with Microsoft but scaling those out to handle millions of connections can become very expensive, very quickly. MySQL is so popular because it’s scalable without the hefty price tag of SQL. For licensing revenue to continue rolling in for both O.S. and SQL, they’ll have to compete in this market as it exists today.

As the web grows…

You’ll continue to hear more stories such as “Cloud Computing” and “I only watch TV online”. You’ll also see Microsoft persuade young developers more and more that it’s the platform of choice for the web. Making IT personnel more comfortable with hosting their web apps on Microsoft is only the start in my eyes. I’m sure this hasn’t been overlooked within the walls of Redmond either. Either way HTML5 is pushing this forward.

I’m excited to see what’s in store over the next 10 years and expect my life to be easier because of a server side app, not a client side app…

Friday, March 26, 2010

My first go around with PowerShell

Figured I’d start with math since I was good at it in school…

Well, school was a long time ago!  And I’ve come to find out DateTime math via computers, really isn’t my forte.  What I’m trying to do is setup a simple stop-watch like function.  When I start any of my scripts, I always love to have time involved~~~ somehow, someway…  This particular script (when completed) will give me the ability to set the start time of a script and the end time.  With those variables set, I’ll then be able to do a time difference to determine how long the script ran.  Here’s my first go around:

Function StartTimeD {

    [int] $day = (Get-Date).Day
    Return $day
}

Function StartTimeH {

    [int] $hour = (Get-Date).Hour
    Return $hour
}

Function StartTimeM {

    [int] $minute = (Get-Date).Minute
    Return $minute
}

Function StartTimeS {

    [int] $second = (Get-Date).Second
    Return $second
}

Function EndTimeD {

    [int] $endday = (Get-Date).Day
    Return $endday
}

Function EndTimeH {

    [int] $endhour = (Get-Date).Hour
    Return $endhour
}

Function EndTimeM {

    [int] $endminute = (Get-Date).Minute
    Return $endminute
}

Function EndTimeS {

    [int] $endsecond = (Get-Date).Second
    Return $endsecond
}

 

Function HelloWorld {

    $startday = StartTimeD
    $starthour = StartTimeH
    $startminute = StartTimeM
    $startsecond = StartTimeS
}

Function EndOfTime {

    $endday = EndTimeD
    $endhour = EndTimeH
    $endminute = EndTimeM
    $endsecond = EndTimeS

}

HelloWorld
Start-Sleep 5
EndOfTime

Write-Output $startday $starthour $startminute $startsecond EndTimes are $endday $endhour $endminute $endsecond

New-TimeSpan $(Get-Date -day $startday -hour $starthour -minute $startminute -second $startsecond) $(Get-Date -day $endday -hour $endhour -minute $endminute -second $endsecond)

 
 

Unfortunately for me, it’s not working properly.  The Write-Output spits out the same numbers for both StartTime and EndTime functions.  There’s gotta be a much simpler way…  Maybe there’s something already under the hood for what I’m trying to do.  So far, I haven’t found it, but I am working on it! ^_^