Thursday 28 June 2012

Failed to write file data on cluster disk 0 partition 1, failure reason: The disk structure is corrupted and unreadable


While configuring a Failover Cluster on Windows Server 2008 R2, i encountered this error:


Failed to write file data on cluster disk 0 partition 1, failure reason: The disk structure is corrupted and unreadable.


The shared storage for the cluster is an iSCSI SAN, and the servers to participate in the cluster could all see the shared disks.


After much attempt to fix this error,  these are the things i did. I suggest you check out for either or all of them as applicable in your situation.
  1. In my case, i had to grant read/write permissions to the luns(shared drives). I did this because when tried creating a test text file in the drives, i got an access denied error. So i figured there was no way the cluster validation tool would be able to write to the disks. I simply gave everyone modify permission.
  2. The account i was using initially was a local administrator, and since i still had a lot of configuration to do on the servers, i had to get a higher privileged account(a domain admin).
  3. I traced the particular disk 0 ( you can get this from the report) and did a format and chkdsk.
  4. I then also reformatted the other disks.
When i ran the Cluster Validation test again, it passed and the annoying error was gone.

I hope this helps someone.

Friday 8 June 2012

Create SharePoint Sites with PowerShell

I had a request to provision ("fancy word for create") about 30 SharePoint sites today. And the lazy me went like "WTH", so i thought this is a good candidate for scripting(automation).

Here is what i did. I got an email with a list of the site names. something like this:

Site 1
Site 2
Site 3
Site 4 ....

So i quickly copied this into a text file, and imported it into an Excel sheet (am sure you can do that)

I then made a little bit of adjustment, and i ended up with something this.


Then i saved this as a csv file named sites.csv.

After that i opened my favourite text editor, and put this together.


$parentSiteUrl = "http://sharepointportal/"
$siteList = import-csv "sites.csv"
foreach ($site in $sitelist)
 {
  $siteUrl = $parentSiteUrl + $site.url
  $siteName = $site.sitename
  New-SPWeb –url $siteUrl -name $siteName -template STS#0 –AddToTopNav –UniquePermissions
 }


Then i saved the script above as createsite.ps1.  After that, i copied both files(createsite.ps1 & sites.csv) to the root drive C:\ of my sharepoint server.

I then opened the SharePoint 2010 Management Shell( as administrator) - shown below.


When the shell opened, I ran my script as shown below, and in a jiffy all the sites were created. Pretty Cool uhm.









Thursday 7 June 2012

Resolve SharePoint 2010 RSS Feed Error

If you try adding the RSS Feed webpart to your SharePoint page and you keep getting an error. It is possible that your SharePoint server is configured to use a proxy. In this case, even though you might be able to open the rss url in a web browser, SharePoint would still be unable to load your rss feeds from the url.


Here is what you do. Open the the web.config file of the your SharePoint web application (typically in c:\inetpub\wwwroot\wss\VirtualDirectory\...)


Then do a find for "defaultProxy", and add this line.

  <proxy usesystemdefault = "false" proxyaddress="http://proxyservername" bypassonlocal="true" />


Your proxyaddress can either be the FQDN or the ip address of your proxy sever. You should also add a port if required, so you might have something like this.


<system.net>
      <defaultProxy>
       
  <proxy usesystemdefault = "false" proxyaddress="http://192.168.100.1:8080" bypassonlocal="true" />
      </defaultProxy>
   </system.net> 

Thursday 3 May 2012

ASP.Net 4.0 Report Viewer Control "Failed to load viewstate" Error

I spent almost an entire day trying to fix a problem with a Report Viewer Control (version 10.0.0) i used to render a remote report on a ASP.Net(4.0) application.

The error was not initially obvious as one of the (dynamic) parameters loaded on the page with the report control, when the page first loads. But when i choose a value from the first parameter, to dynamically populate the other parameter, the entire Report Viewer Control gets disabled(see figure below).






I got stuck here for over 5 hours, and searched virtually everywhere on the web to get a solution. Apparently, a couple of other developers had experienced this issue and struggled to find a solution. After digging a little bit further(you guessed right, i checked the Event Viewer), i found this error:

Failed to load viewstate.  The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.  For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.
I started another round of "Googling" to find  the solution, but this even made it worse. While most people simply ignored the question most places it was asked, those who answered on the blogs i saw, gave all sorts of answers, some probably more complex than the problem at hand. :)

Anyways, it appears the problem has to the with ASP.Net ViewState and the way PostBack is handled. Since the Report Viewer Control requires a  Script Manager control on the page, it's obvious that it does post backs asynchronously. Some solutions suggest setting EnableViewState = "false" but this will not work because the Report Viewer control requires State information. Another alternative is to use an UpdatePanel, but it seems it didn't work for most people who tried it.

For me, after trying everything, and putting all i said above together, i decided to go traditional by allowing Post-backs in a Synchronous mode. So i set the AsyncRendering ="False", and InteractivityPostBackMode="AlwaysSynchronous" and it fixed my problem.

For record, i was loading a remote report (from another server) but am certain it has nothing to do with whether it's a local or remote report.

I hope this helps someone.

Sunday 22 April 2012

ldapsearch: ldap_search_ext: Bad search filter (-7) (Resolved)

I was trying to setup a non Windows directory service to  run some test with SharePoint 2010. So i downloaded and installed OpenLDAP on my Windows 7 machine.

While trying to configure the OpenLDAP Server, i had to a run a command to check that the server was running and everything was setup correctly. The command from the OpenLDAP document is

   ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts













Then i got this error ldapsearch: ldap_search_ext: Bad search filter (-7).


After a couple of search, i couldn't find anything specific but i later figured out the solution. Replace ' with "". I reckon it has to do with how windows and linux handle the character single quote.

So i changed the command to ldapsearch -x -b "" -s base "(objectclass=*)" namingContexts and it worked.

I hope this helps someone.


Saturday 21 April 2012

Resolve SSRS unsupported RPL stream version ... error

This is one of those weird errors you encounter while working with Microsoft technologies. I was using Report Builder 3.0 to design and publish a report to SharePoint 2010, but when i tried to preview my report in RB i got this annoying error unsupported RPL stream version detected: 101.116.1047292257. Expected version 10.6. 


After doing a couple of search to fix this problem, it happened that the SQL Server Agent had to be started.

I hope this helps someone.