22 February, 2013

Workflows are not available after we upgrade from 2007 to 2010 using database attach method


This is a very critical issue that most of the users have faced after the migration from SharePoint 2007 to 2010

After upgrading the SharePoint 2007 Database via database attach method to SharePoint 2010, You might find that the 2007 Approval workflows are no longer available for users to create new workflows.
In SharePoint 2010 the 2007 workflows are there to allow any running workflows to complete, but by default creating new instances of the workflows is disabled as the expectations are that you will want to move forward to the SharePoint 2010 workflows.

Resolution
The following steps must be taken to enable 2007 workflows after upgrading to SharePoint 2010:
·         Go to Site Actions ->Site Settings->Site Collection Administration->Site collection features

·         Activate SharePoint 2007 Workflows 

·         Remove ‘none’ from none

·         14-templatefeaturesReviewWorkflowsReviewapproval.xml
·        
14-templatefeaturesReviewWorkflowsReviewFeedback.xml
·        
 14-templatefeaturesSignatureWorkflowSignatures.xml
·        
 Associate Workflow

·         Go to Shared Documents, Library Settings, Add a Workflow
·        
 Select legacy Workflow.

Note: Please take a back up of Reviewapproval.xml,ReviewFeedback.xml,Signatures.xml before doing the modification, the above solution is not verfied after we install any new update. chances are there that these files might get replaced in future update. please have a backup of working files as well.
Reference -

21 February, 2013

The super reader account utilized by the cache does not have sufficient permissions to SharePoint databases



Let me brief some details as what exactly happened in reference to following error message:
Object Cache: The super reader account utilized by the cache does not have sufficient permissions to SharePoint databases.

We have moved one web application from Development to staging environment. Movement was successful and we started facing the above mentioned error while browsing the web application.

After viewing the error message, thought process started to resolve around permissions.
Okay, but which permissions, account, sections where we need to specify and so many things…

Opened central administration—manage web applications—click on the specific web application to check the permissions –three accounts were listed there: nt authority, two more accounts and all are in Read Only mode.

Checked the IIS settings for that web application and cross checked the same account listed or not (which we have seen in the CA-user policy for that application)
Checked the account permissions in reference to SQL Databases and its perfectly fine (already listed in the users and roles in SQL)

As per Microsoft recommendations, there should be a Portal Super User account that must be an account with Full Control access to the Web application and The Portal Super Reader account that must be an account with Full Read access to the Web application.


While doing some research, I came across with an excellent article, written by Andras Gaal
 
The above article resolves my issue and works perfectly fine for us.

I would like to put some stress on one point from the same article:
 If you are in claims mode, you will need to use the claims user name(i:0#.w|domain\user).

Make sure you make a note it as it will creates new exceptions…

Thank you.

Code Blocks are not allowed in this file error in sharepoint 2010



Hello Everybody,
Today I worked on one critical issue which belongs to our development environment. We have migrated one web application from production environment to development for testing purpose. Migration has been successful but we were facing an exception while browsing the web application.

Error Message:
An error occurred during the processing.
Code blocks are not allowed
Troubleshoot issues with Microsoft SharePoint Foundation.

Server Configuration:
·         2 SharePoint Servers
·         SQL server 2008 R 2
·         Windows Server 2008 R2
·         SharePoint Version: SP2010

Troubleshooting done:
1.    Tried accessing the system pages i.e. settings.aspx, viewlsts.aspx etc. every system was opening fine without any issues. So the issue is with the home page only…
2.    Tried accessing the web part maintenance page, it opened without any issues. We closed the webparts which are present on the home page-just to make sure that there is no problem with the existing webparts. Checked the home page again but same issue.
3.    Tried changing the master page as were able to open the system pages (by appending _layouts/changesitemasterpage.aspx). We changed to different one as we are using custom master page. Checked the results again but same problem.
4.    Opened the site in SharePoint Designer 2010 and checked the status of master page as well as the home page. It was fine and without customization too.

Note: if you see any of these pages in customizable state then I would suggest you to take the backup and try ‘reset to site definition” option.

Obviously, next question will arise- what exactly it will do? Yes, it will reset your page to default state. It means you will lose your customizations. But issue will be resolved and you can customize the page again as per your requirements.

5.    Checked the windows application as well as SP logs (Location: \14\Logs). I would suggest you to analyze these logs before continuing your troubleshooting.

What is my observation\Understanding?
·         Code blocks are only processed for custom pages deployed in the root virtual directory of a site if the code it considered safe.
·         This code is considered safe only if the page is served directly from the file system. As soon as it becomes unghosted for any reason, the code is no longer considered safe and the error shown in the symptom occurs.

Resolution:
As our production web application was working without any issues so I compared the web.config of both the applications. Analyze the code line by line with the production web.config and that’s it. I found the one which was missing in the web.config that belongs to my development web application.

Note: I would suggest you to take a proper backup before making any changes in the web.config file.

What I did? What kind of entries I added in the web.config file?

Here we go:-
In you web.config, you need to search the tag name as “<PageParserPaths>”
Once you find that then make the following  entry:
<PageParserPaths>
    <PageParserPath VirtualPath="/apps/*" CompilationMode="Always"
              AllowServerSideScript="true" IncludeSubFolders="true" />
</PageParserPaths>
After adding this entry then IISRESET is mandatory.

Tried accessing the site and the issue has been resolved.

Happy SharePoint once again…

If you have any queries/questions regarding the above mentioned information then please let me know, Thank you.

20 February, 2013

Hide column on Newform.aspx. In SharePoint

Issue: Client reported that on newform.aspx page, there is one column which appear for awhile and then disappears.
Troubleshooting:
-          Checked if the column is custom created.
-          Checked if the column has its value hidden in the content type column setting.
-          Marked the column value to be required.
-          Saving the list as template without content and worked fine on the other site, gives issue on the same site.
-          Tried deleting the problem column form the problem list, its still disappears from the newform.aspx page.
-          Checked the list in SharePoint Designer to check if the newform.aspx page is customized. No customizations were implemented.

Resolution:
On further troubleshooting, we edited the new.aspx page and found two ‘content editor webpart’ each containing a Java script code.
Out these two codes one was like given below:
           
Where nth-Child is used as an argument to pass to the table and function to perform is hiding.
The 8th number is the column number in the newform.aspx page. Editing the page and changing the number equivalent to the number of the column would hide that column from the page.
Either changing the number to something to not equal to the column number or removing the code had resolved the issue.
Applies to:
-          SharePoint 2007
-          SharePoint 2010.
-          SharePoint Designer.  

Disk space mismatch than the actual size allocated on disk.

Issue: Today while doing our regular BAU of monitoring the server space. I have got a Tivoli alert which is configured to alarm you when there is low disk space. 
Issue was while looking at the drive space the total of 199 GB was showing as used space and total storage space occupied by files and folder was 58 GB on the drive.  Where is the rest of the space occupied. Strange….???
Troubleshooting:
-          Unhide the system hidden files. Not occupying the space.
-          Checked the file size of the files and folder stored. Not occupying the space.
-          Checked the Volume shadow copies of the all the drives. No disk is mounted to be used as Shadow copies. All drive status is set to ‘Disabled’.
Resolution:
Came across a very nice article which talks about the various ways to check if there is a mismatch in the drive space.
Step 6 from the above article was the resolution for my problem.
-          Running VSSADMIN LIST SHADOWSTORAGE to find out, which drive is having the total used space as a volume shadow copy.

-          132 GB of storage space was occupied by C Drive.
-          Limiting Maximum size of the storage area in Shadow copies had releases the space allocated.

Applies to:
Windows Server 2008
Windows Server 2003.