I just redeployed an InfoPath 2007 form to a SharePoint 2007 server location that had previously been working fine in our SharePoint UAT and DEV environments. Problem is, it just stopped working on submission with the error
"There has been an error while processing the form". In the Event log and ULS Logs.
There was a form postback error. (User: DOMAINNAME\USERNAME, Form Name: RenewalOfLeaseForm, IP: , Request: http://SERVERNAME/_layouts/Postback.FormServer.aspx, Form ID: urn:schemas-microsoft-com:office:infopath:RenewalOfLeaseForm:-myXSD-2009-05-07T05-54-18, Type: ArgumentException, Exception Message: Value does not fall within the expected range.)
None of the validation picked up any issues and deployment all worked fine - but errors occurred on submission. Some articles suggested (e.g. http://www.infopathdev.com/forums/p/5546/25579.aspx ) that the problem was with a secondary datasource - but this would not explain why it was working in the other environments.
Turns out the problem was that when I specified the location of the form template during publication to the production environment, I pasted an extra forward slash into the publishing wizard (see screenshot). This only seemed to generate an error on the submission of the form - but it published without issues. This would suggest that the publication wizard should really do some additional validation when publishing InfoPath forms to a SharePoint location.