SharePoint error The URL ‘Pages/default.aspx’ is invalid

On a recent project I was working on an Intranet which had the publishing infrastructure feature enabled. I was working on setting up some pages and configuring web parts when I noticed an error on saving or checking in a page, see figure 1 below.

The URL ‘Pages/default.aspx’ is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web.

Figure 1

As with most errors in SharePoint I cracked opened the ULS logs. Its slightly more difficult to find relevant data in the ULS logs without a correlation ID but after searching for the error text I was able to locate the ULS details for the page request. Unfortunately there was no further details around what was causing the error.

I then turned to Google and had a look for the error message. I found quite a few articles but pretty much all of these related to database issues. Most talk was about space on the database server or databases being read-only, however none of this was relevant to me.

At this point I couldn’t find any details in the ULS logs or online so I decided to start stripping back my solution component by component to see at which point the error occurred. While the site was still in development there were a lot of steps to replicate. I started by spinning up a new web application and then applying the changes one by one. After each change I was creating a new page and editing an existing page to test if the site was broken.

In the end it turns out the issue was a PowerShell script which was being run to create some site columns. This had been created to quickly provision site columns which are commonly used across most projects.

Once I had identified the source of the issue I then had to figure out if it was a particular site column which was causing the issue. I started commenting out sections of the script and I was able to narrow it down to a particular column. The problematic site column was a calculated column and as soon as I commented this out and deleted the column the site started to work again. I’m not sure why this was causing an issue but it can be easily created manually so i removed it from my script.

Hopefully this helps others as all the articles I found online all pointed to a database issues so keep in mind it could be a corrupted site column as well.

Happy SharePointing 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: