Search

rafelo

Advancing Productivity and Operational Efficiency through Cloud Services and Apps

Category

Troubleshooting

What’s my SharePoint 2010 Content Database ID?

There are several commands that may require you to pass in a SharePoint Content Database ID. PowerShell makes it easy, just use the Get-SPContentDatabase command.

Pass in the WebApplication Parameter to get a list of all of your Content Databases for that Web Application:

image 

Need to know the Content Database of a specific site (web)? Just pass in the site parameter:

image

For a complete list of SharePoint 2010 Content Database Powershell cmdlets go to http://technet.microsoft.com/en-us/library/ee890116(office.14).aspx

digg_url = “https://blog.rafelo.com/2010/03/whats-my-sharepoint-2010-content.html”;digg_title = “What’s my SharePoint 2010 Content Database ID?”;digg_bgcolor = “#FFFFFF”;digg_skin = “compact”;digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;

Solution to: “An error occurred while accessing SharePoint AddGallery, Please Try Again” on SharePoint 2010

I ran into the following error while creating a SharePoint library while trying to troubleshoot a completely unrelated problem: “An error occurred while accessing SharePoint AddGallery, Please Try Again”

image

Not very descriptive. A quick look at the event viewer revealed the following Warning:

Alternate access mappings have not been configured.  Users or services are accessing the site http://imapc with the URL http://localhost.  This may cause incorrect links to be stored or returned to users.  If this is expected, add the URL http://localhost as an AAM response URL.  For more information, see: http://go.microsoft.com/fwlink/?LinkId=114854″/>”

image

Of course accessing the site via the correct Url is the easiest way to solve it. If you need to add the Alternate Access Mapping, you can do so from “Central Administration > Application Management > Configure Alternate Access Mappings”

image

digg_url = “https://blog.rafelo.com/2010/01/solution-to-error-occurred-while.html”;digg_title = “Solution to: “An error occurred while accessing SharePoint AddGallery, Please Try Again” on SharePoint 2010”;digg_bgcolor = “#FFFFFF”;digg_skin = “compact”;digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;

SharePoint 2010 on Windows 7 Exception – UserProfileException: Unrecognized attribute ‘allowInsecureTransport’

If you tried installing SharePoint 2010 Beta 2 on Windows 7 (or Windows Server 2008 R2) shortly after its release; you may have ran into the following error:

Failed to create sample data.
An exception of type Microsoft.Office.Server.UserProfiles.UserProfileException was thrown.  Additional exception information: Unrecognized attribute ‘allowInsecureTransport’. Note that attribute names are case-sensitive. (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\WebClients\Profile\client.config line 56)
Microsoft.Office.Server.UserProfiles.UserProfileException: Unrecognized attribute ‘allowInsecureTransport’.

This error is caused by a known issue with Token Authentication and WCF. A fix has been released and is now available  at http://go.microsoft.com/fwlink/?LinkID=166231.

If you didn’t uninstall after receiving the error, simply install the hotfix, and re-run the SharePoint 2010 Products Configuration Wizard.

 

digg_url = “https://blog.rafelo.com/2009/11/sharepoint-2010-on-windows-7-exception.html”;digg_title = “SharePoint 2010 on Windows 7 Exception – UserProfileException: Unrecognized attribute \’allowInsecureTransport\'”;digg_bgcolor = “#FFFFFF”;digg_skin = “compact”;digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;

HTTP Error 403 – Forbidden with Custom or Updated Features and Application Pages

This is a fairly common and non-descriptive error that continues to surface more and more as the SharePoint developer community continues to grow. Surprisingly, I’ve found very little information in the web regarding what I believe to the most common cause and solution (hence this blog post).

Many things can trigger this error, and as you might expect by the description the error is security/permissions related. I’ve seen it most often, when browsing the Site Features and Site Collection Feature pages… but it has been known to take down a whole site; although mostly (and luckily) in dev environments.

So why do I keep referring back to development? And more importantly, what is this “most common” cause/solution? Its mostly tied to “drag and drop”; when you drag and drop files, permissions usually go with them (albeit there are a few exceptions.) With development rarely taking place directly in the 12 hive features, or layouts folder; its shouldn’t be surprising to see developers (and administrators alike) deploying and often testing changes to features by dragging and dropping files from their Desktop, My Documents, or project folders. Naturally this approach doesn’t follow best practices, but I wont deny having made the mistake while testing a quick change to a feature or elements xml file in a development environment. All updates to production environments should be done via WSPs.

So how do you solve the problem? Finding the culprit shouldn’t be too difficult, think of any items that have been recently deployed/updated. Cant think of any, search for any recently updated files of folders. If you do think of or find any; check the permissions and make any required modifications; also consider redeploying them via a WSP.

So what’s my Web Application Pool Process ID (in Windows Server 2003)

Have you ever noticed your WFE server crawling, and then ran Task Manager to find the Memory Usage of some of your w3wp.exe process through the roof. You need to know which process is tied to which application pool to begin troubleshooting. How do you get this information? OK, so this is nothing new, and definitely not specific to SharePoint. But it does come in handy, and I never seem to remember exactly how:

1. From Task Manager, select View > Select Columns

2. Put a check mark next to “PID (Process Identifier)” and click “OK”

image

3. Open the command prompt

4. Run the following command:

%systemroot%\system32\cscript.exe %systemroot%\system32\iisapp.vbs

The above should result in an output similar to the following:

image

Notice how each w3wp process is tied to a specific application pool. If you’ve properly labeled your Application Pools and are not using the same Application Pool for all of your IIS sites, this should give you a good place to start looking for problems. If responsiveness is severely hampered you may choose to recycle the the offending Application Pool without having to do an IIS Reset which would impact all of your other sites.

digg_url = “https://blog.rafelo.com/2009/04/so-whats-my-web-application-pool.html”;digg_title = “So what’s my Web Application Pool Process ID (in Windows Server 2003)”;digg_bgcolor = “#FFFFFF”;digg_skin = “compact”;digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;

SharePoint Timer Jobs Running Multiple Times

I was recently brought into a client to help troubleshoot an issue with a SharePoint Timer Job, that appeared to be executing multiple times (around the same time) although it was scheduled to run only once daily. While others in the SharePoint community appeared to experience the same problem, no one seemed to be able to point to a cause.. much less a solution. In this case it was always running 9 times, significantly more than the three or four others where reporting.

After much digging around, and focusing on the magic number (why 9) it struck me. How many Content Databases did the client have on the web application that the Timer Job was associated with? 9 to be exact. It was doing what it needed to do based on how it had been developed, the developers failed to test it on a Web Application with more than one Content Database. From there on, fixing the code was simple.. but it may be different for you based on what your timer job needs to do. Remember every Site Collection (SPSite) has a property that gives you the Content Database, and every time a Timer Job is called (targeting a Content Database) the Content Database GUID for which it is running is passed in… use it for validation.

Anyhow, at the very least, if you are running into this problem this might help point you in the right direction.

For information on how to develop SharePoint Timer Jobs (SPJobDefinition) see Andrew Connells MSDN Article “Creating Custom Timer Jobs in Windows SharePoint Services 3.0”

digg_url = “https://blog.rafelo.com/2009/04/sharepoint-timer-jobs-running-multiple.html”;digg_title = “SharePoint Timer Jobs Running Multiple Times”;digg_bgcolor = “#FFFFFF”;digg_skin = “compact”;digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;

Retrieve the IUSR (Anonymous) password using the IIS Resource Kit Metabase Explorer

Just recently, while troubleshooting an 401 Unauthorized error on an FBA site in SharePoint, I discovered that someone accidentally changed the password of the IUSR account (IIS Anonymous User) on one the IIS Web Sites.

The error in the browser was “HTTP Error 401.1 – Unauthorized: Access is denied due to invalid credentials.” I’ve blogged about this sort of error before, and there can be many culprits. But having gone over the scenarios I know of that might cause this with no luck, I decided to look at the Event Viewer Security logs.

I quickly discovered a series of Failure Audits with event IDs 680, 529, 539. Event ID 529 was the one that caught my attention:

Logon Failure:
     Reason:        Unknown user name or bad password
     User Name:    IUSR_…

The problem was very apparent; there was an issue with the credentials being supplied by the IUSR account. I tested with another number of sites non of which generated the error, so it was definitely isolated to this particular web application (IIS Web Site). I verified the User Account and it was fine, so it had to be the password. I searched the web for a way to retrieve the IUSR account password and everything seemed to indicate that I should use the adsutil.vbs script (which works well, just remember to change “IsSecureProperty = True” with “IsSecureProperty = False“.) But I also saw a comment referencing the “Metabase Explorer”; very cool.. something that would let me browse through the IIS Metabase.

I downloaded and installed the IIS Resource Kit and used it to retrieve the password of the IUSR account (IIS Anonymous User.)

After installing the IIS Resource Kit, follow these steps to retrieve the IUSR password using the Metabase Explorer:

  1. Open the IIS Metabase Explorer by going to Start > All Programs > IIS Resources > Metabase Explorer > Metabase Explorer
  2. Go to the “View” menu and click on “Secured Data”  (this will make sure the password is not displayed as asterisks) and Inherited Data (this will display any data that the web site is inheriting from the default)

     image

  3. Expand the W3SVC Branch
  4. Expand the Branch of an IIS site that is running anonymous access

    image
    Note: To determine the ID of the IIS Site; select the “Web Sites” node in IIS and look for the Identifier column in the right pane.
     image

  5. Select the “Root” node and look for the AnonymousUserPass property in the right pane.
     image

Prescan Error: Exception scanning web, The system cannot find the file specified.

Just recently, I ran into a problem running the prescan utility where a series of sites reported the following errors:

Error: Exception scanning web: http://intraneturl/sites/samplesite
System.IO.FileNotFoundException: The system cannot find the file specified.

Error: The following site has not been scanned. Id = f3b05792-52a4-4a85-9b26-19905f23cf46 and Url = /sites/samplesite

Error: Prescan has encountered sites or lists that were not updated because they cannot be accessed using the SharePoint Products and Technologies object model. The most likely reasons for Prescan to skip a list are covered in the Knowledge Base article at: http://go.microsoft.com/fwlink/?linkid=69958&clcid=0x409.

The recommended Knowledge Base article indicates that the problem may be caused by database corruption which can be solved using the databaserepair command line operation of stsadm. Running the command should produce a list of orphaned objects. Calling the command again with the “deletecorruption” parameter would delete the orphaned objects.

But what if the command doesn’t find any orphaned objects? This was the problem I ran into. Running the databaserepair command would always produce the following response.

First I decided to take a look at the sites that where reporting the “Exception scanning web” error; opening these sites in the browser returned the following “list does not exist” error.

image

This led me to believe there might be something wrong with the site definition. With a little more research, I found that all of the sites reporting this error were in fact based on the same site definition.

Cause: As it turns out, the Site Definition used had been commented out in the “WebTemp.xml” file (I’ve seen many people do this to prevent certain site definitions from showing up in the list of available templates.)

Note: None of the sites identified by the error “The following site has not been scanned. Id = SOMEGUID and Url …..” were the cause of the problem; it was always a sub-site, specifically the ones that generated the “Exception Scanning Web” and “FileNotFoundException” errors.

Solution: Make sure any site definitions used are included in one of the “WebTemp.xml” files (they must not be commented out.) After correcting (or updating) the WebTemp.xml files, you’ll need to run an IISReset. You should then be able to browse the sites without receiving an error and re-run the prescan.exe utility (hopefully you wont run into something else).

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: