Following up on a change of default URL for a WebAppllication on SharePoint 2013, the site did not respond correctly.

Finding the a

Unexpected SPAudienceValidator Audience URI '[OLDURL]' is not valid for context

in the ULS led me to this blog post https://gavinmckay.wordpress.com/2014/11/28/fixing-sharepoint-2013-unexpected-spaudiencevalidator-audience-uri-is-not-valid-for-context/

Indeed a caching issue, in my case a flush of the DNS and a reset of the web server was sufficient.

  1. ipconfig -flushdns
  2. iisreset -noforce

 

 

 

Tags: , , , | Categories: SharePoint Configuration | SharePoint
Invalid text value. A text field contains invalid data. 
Please check the value and try again.

Got this message in the ULS after starting a workflow. After some testing, re-deploys and cursing I found the answer: I was adding to much text to a single line text field!
It happens when the value you are adding for a text field is larger than 255 characters, so use lesser characters or change the type to a note field.

Well not much of a helpful error message but again, its SharePoint. Smile

Links
ULS

w3wp.exe (0x1898)

0x1980

SharePoint Foundation

Workflow Infrastructure

72er

Medium

Message:

Microsoft.SharePoint.SPException: Invalid text value. A text field contains invalid data. Please check the value and try again. ---> System.Runtime.InteropServices.COMException (0x81020018): Invalid text value. A text field contains invalid data. Please check the value and try again. at Microsoft.SharePoint.Library.SPRequestInternalClass.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bPreserveItemUIVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish, String bstrFileName, ISP2DSafeArrayWriter pListDataValidationCallback, ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback) at Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bPreserveItemUIVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish, String bstrFileName, ISP2DSafeArrayWriter pListDataValidationCallback, ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback) --- End of inner exception stack trace --- at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx) at Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bPreserveItemUIVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish, String bstrFileName, ISP2DSafeArrayWriter pListDataValidationCallback, ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback) at Microsoft.SharePoint.SPListItem.AddOrUpdateItem(Boolean bAdd, Boolean bSystem, Boolean bPreserveItemVersion, Boolean bNoVersion, Boolean bMigration, Boolean bPublish, Boolean bCheckOut, Boolean bCheckin, Guid newGuidOnAdd, Int32& ulID, Object& objAttachmentNames, Object& objAttachmentContents, Boolean suppressAfterEvents, String filename, Boolean bPreserveItemUIVersion) at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents, String filename, Boolean bPreserveItemUIVersion) at Microsoft.SharePoint.SPListItem.Update() at Microsoft.SharePoint.Workflow.SPWinOETaskService.CommitTask(Transaction txn, Object[] transData)

Tags: , , | Categories: SharePoint Development

Accessing a SharePoint server from outside a network with a Forefront TMG.

The following 2 scenarios can give you an Internal Server Error

  • View properties on document
  • Editing a list view

Full error text:

Error Code: 500 Internal Server Error. The request was rejected by the HTTP filter. Contact the server administrator. (12217)

 

?Solution

The reason why this happens is that the HTTP filter in Forefront has a URL protection mechanism wich will block URLs containing escaped characters after normalization.

To fix this:

  1. Open the properties of the firewall policy.
  2. Under the Traffic tab. Click Filtering
  3. Uncheck Verify normalization in the URL Protection section

 

Verify normalization will block URLs containing escaped characters after normalization.

 

Tags: , , | Categories: SharePoint related | SharePoint Configuration

Using the in the the wrong parameter with the SPWeb.GetList method you will receive a FileNotFoundException with the following very SharePoint-ish error message:

System.IO.FileNotFoundException: <nativehr>0x80070002</nativehr>
<nativestack></nativestack><nativehr>0x80070002</nativehr>
<nativestack></nativestack>

The stacktrace will often give more information but the ULS log it wil simply show:

<nativehr>0x80070002</nativehr>
<nativestack></nativestack>

So the parameter is incorrect; Either the URL does not specify a valid path to the website, or the list does not exist in the website.

The GetList method gets the list that is associated with the specified server-relative URL to the root folder of a list, such as /sites/sitecollection/subsite/Lists/Announcements.

HINT

You can use the SPUrlUtility.CombineUrl with your webs server relative URL like this:

var list = web.GetList(SPUrlUtility.CombineUrl(web.ServerRelativeUrl, 
"lists/" + listFolderName));

I prefer to use the SPWeb.GetList over the SPWeb.Lists Property. Endusers can easy change the list title in the GUI but it is harder to change its URL.

Be aware; there are other methods casting System.IO.FileNotFoundException!

Tags: , , , | Categories: SharePoint Development | Tips and tricks