Monday, 25 October 2010

Fix - "An error occurred during the processing of /_catalogs/masterpage/CompanyNameHomePage.aspx. Code blocks are not allowed in this file." - SharePoint 2007 Exception

Today I had an urgent call from the Support desk at my current client - and had to be pulled out of a meeting to help resurrect a corporate intranet. All pages in the corporate intranet were down and all were giving the same error:

"An error occurred during the processing of /_catalogs/masterpage/CompanyNameHomePage.aspx. Code blocks are not allowed in this file."

Turns out one of the support guys had checked out a page when viewing the master page library and checked it back in. There were no actual changes to the page code at all - but to try and fix the problem, they tried to restore from previous versions in the version history of the library. It made no difference.

When I saw the error, I recognized this immediately that something had been unghosted (ie was now serving the code from the content database and not the filesystem). The SharePoint page parser was now recognizing that there was inline script (as file-system served files are inherently trusted and content database files are inherently untrusted) - and it was failing.

The fix was to just reset the specific page to the site definition to effectively reghost it (so it was the same as the one deployed by the original feature). The steps are:
  1. Start Internet Explorer.
  2. Browse the SharePoint site to locate Site Actions.
  3. Click Site Actions, and then click Site Settings.
  4. On the Site Settings page, click Reset to site definition under the Look and Feel option.
  5. On the Reset Page to Site Definition Version page, type URL for the home page (in the 'Reset specific page to site definition version' textbox (e.g. /_catalogs/masterpage/CompanyNameHomePage.aspx , and then click Reset to reset the page to the site definiton version (and re-ghosting the page)

This resolved the issue immediately and I had a call just 10 seconds later thanking me for fixing it :o).


Friday, 8 October 2010

Fix - InfoPath Browser Forms Error - "There has been an error while loading the form. A required resource could not be downloaded. To To try to resume the download, refresh the page."

If you receive the following error in an InfoPath 2007 Browser based form:

There has been an error while loading the form. A required resource could not be downloaded. To To try to resume the download, refresh the page.

You will also receive the following in your SharePoint ULS logs straight after the user sees this error regarding the "Canary" timing out:

10/07/2010 10:53:54.89 w3wp.exe (0x0D70) 0x1804 Forms Server Forms Services Runtime 5ajc Medium The Canary has timed out for form 6bbd1ceb-7956-49de-aaa5-015d7d94d2b2:ver:

10/07/2010 10:53:54.90 w3wp.exe (0x0D70) 0x1804 Forms Server Forms Services Runtime 7tel Assert WARNING: Invalid Canary for view file. StackTrace: at Microsoft.Office.InfoPath.Server.Controls.ResourcePage.GetSolutionAndVerifyCanary(HttpContext context, String solutionId, SPSite contextSite, ResourceErrorType& error) at Microsoft.Office.InfoPath.Server.Controls.ResourcePage.HandleViewFile(HttpContext context) at Microsoft.Office.InfoPath.Server.Controls.ResourcePage.<>c__DisplayClass2.b__0() at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock) at Microsoft.Office.InfoPath.Server.Controls.ResourcePage.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplicat...

This is a result of the session timing out (the default is 20 minutes). Simply increase the session time out based on your user's standard behaviours (e.g. going out to lunch while filling out a form or taking a very long time to fill out a form). We increased ours to 1 hour session timeout as described here


Sunday, 3 October 2010

How to Check that Windows Server 2008 Network Load Balancing (NLB) is using "Sticky Sessions"

Today I wanted to validate that our 3 load balanced SharePoint Web Front End Servers were using sticky sessions (I already know that they are using SQL Server for session state) - for peace of mind. Here is how to check:

  1. Start - Control Panel - Administrative Tools - Network Load Balancing Manager
  2. Check that the Affinity is set to "Single" for each server in the Network Load Balancing Column:


Friday, 1 October 2010

Back from our China Trip 2010 (Hong Kong, Shanghai, Dali, Lijiang, Guilin, Shangri-La)

I'm back in Oz after my second trip to China with my wife and kids. The main driver for us to go was to show my father and mother in law their new grandson in my wife's old home town of Shanghai. We also ventured to other areas of China.

Rather than the historical centres of Beijing and Xian (as we did in 2007), we went to some more scenic and less populated areas in the South of China - and were inspired by the BBC documentary "Wild China" to go to Shangri-La and Guilin. Of course you can't do everything you want (especially with two yound kids) - but we saw as much as we could over 26 days. Highlights of my China 2010 Trip were:
  1. Hong Kong Disney
    We got some free tickets as my brother-in-law has some good contacts in Hong Kong. One of the first things I noticed in the hotel is that Disney provides you with bath robes (for the pool areas) so it the large number of people walking around in robes made the hotel look disturbingly like a Disney-inspired mental institution!

    The fireworks were great on the first night:

    In the Jungle area, the whole family loved the Leaky Tikis
    as well as the Jungle Cruise (complete with cannibals, crocs, elephants and flames coming out of the water at the boat)

    We sat on the Alice in Wonderland ride 3 times because Heidi loved it so much. The Lion King musical show was also great fun for the kids.

  2. Lantau Island (and the Big Bronze Buddha)Probably my favourite part of Hong Kong with some nice quiet walking tracks and cool breezes away from the bustle of the city.

  3. Heidi's Princess Photo Shoot in ShanghaiChina's one-child policy makes any form of "child idolization" by parents acceptable (though we got it as a gift from her uncle in China). Heidi spent almost 3 hours and struck 100 poses for her photo shoot in various dresses and with swords. The story book you get at the end is amazing (in Chinese and in English)

  4. Dali and Cangshan Mountain, Fishing Birds on Erhai Lake, Horseriding. One of the most pristine and tranquil places I've visited in China (though it was tough carrying both Zach and Heidi up the steep and slippery stone steps as they refused to walk). There's even a giant Chinese chess board nestled up in the mountains. The pineapple and watermelon we purchased on the way down the mountain was bursting with flavour.

    The fish-catching ospreys were also pretty amazing.
  5. Staying in an old-style Chinese Hotel in Lijiang old town (kung-fu movies had been shot there) - and getting lost in the maze of stone walkways and waterways.

  6. The Tiger Leaping Gorge The amount of water passing through after heavy rainfalls was impressive - but so are the landslides that happened a couple of weeks before we got there (and the tunnel system made available to pass around the landslide areas).

    Video showing the sheer volume of water in the gorge can be seen here
  7. Herds of random animals (Yaks, pigs, goats) stopping the cars in Shangri-La on a 2-lane highwayThey were a bit better than the animals in Yellowstone National Park in the US as at least they had farmers cracking them with sticks to send them on their merry way. There were some Yaks that jumped in front of our bus though - thankfully we swerved in time.

    The scenery around Shangri-La (esp. the clouds hanging around the mountains when at 4000m altitude) was amazing.

    They the local shops try and flog oxygen to all the tourists before you get there. My recommendation is not to buy it - though the oxygen tanks are fun to play with.
  8. Guilin Boat Cruise

    Even the view from the hotel was amazing

    Guilin was very popular with the western tourists (affectionately known to some as White Devils). We even ran into some Indian Sydney-siders who live in the next suburb to us.
  9. Shanghai Expo 2010It was fun - but it was hugely busy (600,000 people per day visit) there was no way I'm going to wait for 4 hours to see the Germany exhibit. We got into the Spain exhibit right away though when we visited in the evening - one of the features of which was a giant puppet baby

  10. My son Zach's New Remote Control Car and Toy Guns and a giant teddy bear.. My father in law got some presents for the kids and they are still fighting over them. Zach looks like a little Arnie when he's carrying around the gun.
  11. Eating Snake, Dog, Frog, Jellyfish and Snails (I've had dog before - it's like beef except with a stronger flavour - quite nice). Snake is all bones and no meat so I couldn't approve.
  12. The Stone Forest in Kunming and Heidi and Zach's dancing to Chinese techno in KunmingThe Stone forest had some very nicely manicured gardens and had some of the most fragrant flowers and blooms I've ever seen.

    There was also a bridal expo in Kunming with a red carpet. The kids couldn't resist dancing their booties off on stage. As usual they attracted a lot of cameras and a crowd. Everyone loves to take photos of them - with the most common thing said is "piao liang" or "beautiful!" and "yung wa wa" ("foreign doll")

    You can check out Zach's dance class moves on youtube here:
  13. The Chinese Massage House of PainI've had a few foot massages in China - but the most painful massage I've ever (with my wife and brother-in-law) had was in a place called the Double-Rainbow Massage Parlour (sounds dodgy I know). I think they surgically enhance their elbows so they can cause as much excruciating pain as possible for extended periods of time.
During the trip to China, I lost a few kilos because we walked so much, and Lisa and I carried kids around so much. Also, Chinese food has way too many bones and not enough meat (In my opinion, not my wife's). Add to the fact that we were sweating 24x7 due to the pre-typhoon conditions (36 degree humidity that covered most of China) - and it was almost like a month-long weight-loss bootcamp.

Next holiday will be to Phuket, Thailand (ie something closer to what we did in Vanuatu in May 2009)
...Perhaps then Lisa and I will be able to breathe and relax rather than acting as human donkeys for our children :o)