Tuesday, December 16, 2008

MOSS out of the box search error

Recently while configuring the out of the box search for a MOSS site, I encountered the following error : Your search cannot be completed because of a service error. Try your search again or contact your administrator for more information.
In order to fix the error, please make sure the application pool, the site is running under, has access to the search index. Here are the steps to follow:

  • First make sure the MOSS Search Service is running. Check the event viewer for error messages. If everything is ok, go to the next step
  • Find out the application pool account the site is running under(network service, local account or another account)
  • Go to Central administration -> SSP settings -> Search
  • Check the default content access and make sure it is the same as the above one

Thursday, December 4, 2008

MOSS SSP URL

In order to get the SSP URL of the farm, we can use the following piece of code. This is really helpful if you don't want to hardcode the SSP URL.
   1:  private string getSSPURL()
   2:  {
   3:     string uri = string.Empty;
   4:     ServerContext sc = ServerContext.Default;
   5:     object ssp = sc.GetType().GetProperty("SharedResourceProvider",
                       BindingFlags.Instance | BindingFlags.NonPublic).GetValue(sc, null);
   6:     Guid sspGuid = (Guid)ssp.GetType().GetProperty("AdministrationSiteId").GetValue(ssp, null);
   7:     using (SPSite sspSite = new SPSite(sspGuid))
   8:     {
   9:       uri = sspSite.WebApplication.GetResponseUri(SPUrlZone.Default).AbsoluteUri + "ssp/admin";
  10:     }
  11:     return uri;
  12:  }

Wednesday, October 22, 2008

Team Site Error (A datasheet component compatible with Windows SharePoint Services is notinstalled, your browser does not support ActiveX controls...)

Since the last couple of days we were experiencing problems with the Team Site while trying to view a list in the Datasheet view mode. The error being displayed was something like this:

The list is displayed in Standard view. It cannot be displayed in Datasheet view for one or more of the following reasons: A datasheet component compatible with Windows SharePoint Services is not installed, your browser does not support ActiveX controls, or support for ActiveX controls is disabled.

This error was occurring due to a bug in the SharePoint Services Service Pack 3 update and this error has been temporarily fixed by following the below instructions:

  • Take backup of ows.js file in the following directory: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\Template\Layouts\1033
  • Open ows.js file and add following function : function RenderActiveX(str){ document.write(str);}
  • Save the changes and do an iisreset
  • Refresh your browser

Thursday, October 2, 2008

Computers are like bicycles for are mind

I was going through a book and saw the following phrase - "Computers are like bicycles for are mind". Initially confused, later intrigued and fascinated, I tried to google it and found the following youtube video....

The graph shown in the above video (probably taken decades back) is really interesting. Please do check it out when you get a chance.

Saturday, August 23, 2008

SQL Server 2008 RTM Installation Instructions

I have installed SQL Server 2008 on 64 bit Windows Vista. Below are the steps for the same.

Steps:

1. Insert the SQL Server 2008 Installation media and navigate to the install folder.

2. Run the setup.exe from the install folder. The installer checks for .NET Framework 3.5 sp1 and if not installed it will prompt you for installing it as show below.

3. Accept the license terms and proceed forward.

4. After .NET Framework is installed it will prompt for Windows Installer installation.

5. Once installed it will prompt for a system reboot. Please go ahead and reboot your system.

6. Once rebooted, please navigate back to the install folder and run the installer again. SQL Server 2008 has a nice Interface for installing different features. It has a total for six main tasks with each having different options.

7. Clicking on the Planning -> System Configuration Checker brings up a tool for checking the conditions that might prevent a successful SQL Server installation. This will help in determining for any potential problems while installing SQL Server 2008.

8. The rest of the screens show the different main tasks.

9. The options tasks determines the version for SQL Server to be installed. I will be installing the 64 bit version

10. Install the SQL Server by choosing Installation -> New SQL Server stand-alone installation

11. You can choose to install a trial version or enter the product key to install the version. I will installing the developer full version of the software.

12. Accept the license terms and install the support files when prompted.

13. Any potential problems that might occur are again displayed and this cast an issue with Windows Firewall was displayed

We will open up the ports later after the installation is done. The ports are mentioned at the end of this post.

14. Next you will configure the required features. Since I will be installing SQL Server 2008 on a machine which has SQL Server 2005 installed, the default instance cannot be used to install it. A new instance with a unique name needs to be used. I will be using MSSQLServer08 (note the warning which shows up if you use the default/already existing instance name).

15. Next you need to configure the service accounts and I choose to use the same account for all SQL Service services.

16. For each of the services, you will be able to configure the administrative accounts, installation paths as shown in the next screens…

17. Please restart the system after the installation is complete.

18. In order to enable remote connections to the SQL Server, the following steps need to be followed: Got to All Programs -> Microsoft SQL Server 2008 -> SQL Server Configuration Manager and enable the TCP/IP and Named Pipes protocol for the installed instance.

19. The following ports need to be opened up in the windows firewall:

Once the ports are up, you should be able to connect to SQL Server from a remote machine.

Service Name

Port Number

Database Engine

1433

SQL Browser

1434

SQL Broker

4022

Analysis Services

2383

Reporting Services

80/443

20. Open the SQL Server management studio and if you have SQL Server 2005 installed, the following message will come up. I did not want to import the settings from SQL Server 2005 and selected no to continue.

21. Next click yes to add the SQL Server 2005 management studio registered servers to 2008 Management studio.

You should be now ready to build and develop new databases....

References:

http://msdn.microsoft.com/en-us/library/ms143219.aspx

Sunday, May 11, 2008

Very Simple AJAX Example

Below is a very very simple AJAX example. This is intended for AJAX starters and is not for people who already know about AJAX.

Overview
AJAX - Asynchronous Java and XML has been the buzzword for the last couple of years. Though it is being used for a very long time now, the term AJAX was coined recently. AJAX is an attempt to give the web user an interactive, quick and rich user experience while navigating through your web application. Normally while requesting pages, every request causes a roundtrip to the server causing the page to freeze and prevents the user from doing any kind of interaction with the page. AJAX moves away from this feature where the user can continue working with the page while requests to the server happen in the background. A very good example of this is Google Maps.

The communication with the server is accomplished using XmlHttpRequest object. This object is responsible for opening the connection to the server and sending the request. Once request is complete and data is recieved, the page elements can be modified/updated as needed.
In the below example, when you hover over the label, the sendRequest method gets called which is responsible for opening the connection and sending the request to the "AjaxResponse.html" page on the server. This page just outputs the text "Hello World". The client callback function (callBackFunction()) gets triggered everytime the request state changes and raises an alert once the callback is complete.


   1:  <html xmlns="http://www.w3.org/1999/xhtml">
   2:      <head>       
   3:          <title>Basic AJAX Example</title>  
   4:          <script type="text/javascript">                
   5:          var xmlHTTP = null;        
   6:          //This method gets called everytime the request state changes
   7:          function callBackFunction()
   8:          {   
   9:              //check to see if the status of the request has changed
  10:              //other states are 0 = created but not initialized (open method not yet called),
  11:              //                 1 = initialized (sent method not yet called), 
  12:              //                 2 = sent request (response text and response body not available), 
  13:              //                 3 = recieved request (response text and response body not available),
  14:              //                 4 = all data has been recieved (response text and response body available)
  15:                  if(xmlHTTP.readyState == 4)
  16:                  {
  17:                      //check to see if the status is ok
  18:                      if(xmlHTTP.status == 200)
  19:                      {
  20:                          alert('call back completed and data is recieved from the server');                    
  21:                      }
  22:                  }
  23:          }
  24:      
  25:          //This method creates the xmlHTTPRequest object and sends the request
  26:          function sendRequest()
  27:          {
  28:              //check the browser and instantiate the appropriate object -- IE 7, Mozilla
  29:                  if(window.XMLHttpRequest)
  30:                  {       
  31:                      xmlHTTP = new XMLHttpRequest();
  32:                  }
  33:              //Previous versions of IE like IE 5 and old browsers
  34:                  else if(window.ActiveXObject)
  35:                  {
  36:                      xmlHTTP = new ActiveXObject(Microsoft.XMLHTTP);                    
  37:                      //alernative 
  38:                      //xmlHTTP = new ActiveXObject(MSXML2.XMLHTTP);                                
  39:                  }
  40:                  else
  41:                  {
  42:                      alert('Browser not supported');
  43:                  }                      
  44:              //open a connection using a xmlHttpRequest object
  45:                  xmlHTTP.open("GET","AjaxResponse.html", true);
  46:              
  47:              //set the method to be called when the request status changes
  48:                  xmlHTTP.onreadystatechange  = callBackFunction;
  49:              
  50:              //send the request
  51:                  xmlHTTP.send(null);            
  52:          }
  53:      </script>    
  54:      </head>    
  55:      <body>
  56:              <label id="label1" onmouseover="sendRequest();">Hover over me</label>
  57:      </body>
  58:  </html>
Again, this is a very simple example and you should be able to find more advanced and complicated examples on the web. The page elements can be modified using javascript to insert the response text on the calling page.
 

Sunday, May 4, 2008

MOSS Search error

Scenario: Multiple web front ends with MOSS search service(both query and index) running on one of them.Everything is fine on the web server which also host the moss search service. Specifically, search queries work fine without any errors.

Issue: The other WFE's(not hosting the search service) throw errors when trying to sort the search results. I repeat, the WFE's throw errors only when trying to sort the results. Otherwise they work fine. I can still do search on these servers, but when trying to sort the search bombs out.

The error message thrown is:

The specified network name is no longer available. (Exception from HResult: 080070040

The event view shows the following message (or something simillar):
The last query machine was taken out of rotation. Propagation may be neccessary. The query machine will be retried in 15 seconds again.
The uls logs show the following message :


0x80070040000000006B49C6F8d:\office\source\search\ytrip\tripoli\common\crequest.cxx246

0x80070040000000006B49C6F8d:\office\source\search\ytrip\tripoli\common\crequest.cxx246 _LokRelegateMachine just relegated the last query machine! - File:d:\office\source\search\ytrip\tripoli\icommand\qpcache.cxx,Line:1393

0xc000020c000000006B49C73Ad:\office\source\search\ytrip\tripoli\common\crequest.cxx244 In CRootQuerySpec::Execute - caught exception: 0x80070040, translated to: 0x80070040 - File:d:\office\source\search\ytrip\tripoli\icommand\qryspec.cxx,Line:767
Log Query: More Information: The specified network name is no longer available.

The same code gets executed on all the WFE's but the error does not happen on the WFE running the query service. Assuming there is an issue with the firewall, how does the search work on these WFE's (when no sorting is done) ? I have been trying to fix this error for sometime now, but didn't get enough time to research more. I will keep looking for more information on this error and post a resolution if I find one.

Monday, March 24, 2008

Who is a SharePoint Developer and What is SharePoint ?

I recently had a conversion with one of my developer friend (Dilbert) which was something like this:

Prashanth: Hey Dilbert! How r u?

Dilbert: I am fine Prashanth. How r u doing?

Prashanth: Never been so great. So what r u working on these days?

Dilbert: I have been developing .NET applications. What’s up with you?

Prashanth: I am working on SharePoint. I build and maintain SharePoint applications.

Dilbert: So you basically take care of document libraries. I heard that that SharePoint is a document repository.

Prashanth (fuming with rage...): I do little more than that and SharePoint is a LOT more than a document repository. It is one of the many, many features provided by SharePoint.

Dilbert: Oh is it? All this time, I was thinking of SharePoint as a SourceSafe. BTW, Do you get to work on .NET applications?

Prashanth(trying to control himself to not hit Dilbert...): SharePoint is built on the .NET platform. Microsoft Office Server 2007 is built on ASP.NET 2.0 and you can basically do whatever you do when developing your .NET applications. SharePoint provides you with a lot of click-create websites based on templates, which may otherwise take days to build. As a developer, SharePoint provides you a great object model which enables you do anything that can be done by the wizards/user interface. This helps in developing rich business applications.

Dilbert: So you basically create websites with a click. Where is the development then?

Prashanth: It’s true that most of the times, I use the built-in wizards to create the sites. But, lot of customizations also needs to be done depending on the business requirements. It involves developing web parts, master pages, user controls and basically everything a normal ASP.NET developer does. It also involves using XML to create/modify site definitions and site templates which is a major part of SharePoint Development. SharePoint provides tight integration with InfoPath and Excel services providing you with a great development environment. Just imagine the kind of development you can do with these tightly-coupled technologies !

Dilbert: What else is part of SharePoint?

Prashanth: SharePoint has a lot more features aimed at Collaboration, Business Intelligence, Content Management, Search for improving Productivity, Communication and for finding information very easily. To summarize:

  • Provides a simple, familiar, and consistent user experience -By tightly integrating with familiar client desktop applications, e-mail, and Web browsers
  • Boosts employee productivity by simplifying everyday business activities - By providing out-of-the-box workflows for initiating, tracking, and reporting common business activities such as document review and approval, issue tracking, and signature collection
  • Helps meet regulatory requirements through comprehensive control over content - By specifying security settings, storage policies, auditing policies, and expiration actions for business records
  • Effectively manage and re-purpose content to gain increased business value - By being able to submit documents for approvals and schedule deployments for intranet and internet
  • Simplifies organization-wide access to both structured and unstructured information across disparate systems - By giving users access to line of business data like SAP, Siebel and many other disparate content sources
  • Connects people with information and expertise -By providing enterprise search which is capable of returning back web pages, people information and documents
  • Accelerates shared business processes across organizational boundaries - By providing great smart electronic forms out of the box
  • Helps in sharing business data without divulging sensitive information
  • Provides a single, integrated platform to manage intranet, extranet, and Internet applications across the enterprise
Though I am not a SharePoint eulogist,working on it for sometime now has given me a better understanding and also the made me understand the essence of it. I hope Dilbert has a better understanding of it now.

Thursday, March 20, 2008

MCTS (70-630) - Configuring WSS 3.0

I recently took the 70-630 exam and passed. There were questions on Load Balancing like using unicast/multicast modes and a few other network related questions. I still have two more exams to take in the Office Sharepoint Server 2007 section and Iam looking forward to take them soon.....

Saturday, March 1, 2008

Attempted to read and write protected memory. This is often an indication that other memory is corrupt.

Wasn't MOSS 2007 sp1 supposed to fix this problem ? I have the MOSS 2007 sp1 installed on a 64 bit machine but still, one of the WFE throws this error. The actual server hosting the central admin is fine and does not show any indication of this error message. In case you come across the same error message, the workaround is to restart the spadmin service (WSS Admin Service) . Few of the searches on internet do refer to the Timer service, but for me restarting the admin service fixes the problem temporarily. Use the task scheduler to schedule a restart (NET Stop SPAdmin, NET Start SPAdmin) whenever event 6398 occurs.

Thursday, February 28, 2008

The protocol handler cannot be found. Check that the handler has been installed.

After restoring databases from the production servers, I started a crawl. Instead of seeing "Green Messages", I just saw one error message:
The protocol handler cannot be found. Check that the handler has been installed.
I usually restore databases on the dev machine without using the preparetomove command. But today, I was really into the right mood and wanted to follow all the rules religiously. So, before detaching the database, I ran the following command:
stsadm -o preparetomove -contentdb sqlserver:dbname -site http://mymosssite
Then I detached the database using the Central Admin and started the database restoration process. Once done, I added the content database back. I was really happy that everything went smooth without any issues. It was now time to crawl the site and there for I started a full crawl on my site.But as mentioned before the crawl bombed out with the above error message. I went into the eventviewer and saw the following error messages:
The update cannot be started because the content sources cannot be accessed. Fix the errors and try the update again.
The protocol handler cannot be found. Check that the handler has been installed. (0x80040d1a)
I did not understand what was happening and so I started thinking about the changes I made. Before restoring the databases, I stopped the wss help search as I was not using it. Also, I was more inclined towards the sync between the content databases and the ssp. So, I took the following steps expecting to fix the issue:
  • Restarted the wss help search

  • Restarted the office search - net stop osearch

  • Ran the command: stsadm -o synch -deleteolddatabases 0
After this, I started the crawl again and now it worked ! Though I do not know exactly, which of the above steps fixed my issue, I am delighted that it was working again. If anyone knows the exact reason for this issue, please let me know.
Also, if you see the error "Error in the Site Data Web Service. (Specified argument was out of the range of valid values. Parameter name: databaseId)", run the synch -deleteolddatabases command and it should fix the error.

Sunday, February 24, 2008

Output cache not used. Reason: User can view an unpublished version of the current page

I was trying to enable output caching on an authenticated MOSS site and followed the below steps:

  • Site Actions -> Modify Site Settings -> Modify All Site Settings
  • Site Collection Administration -> Site Collection Output Cache
  • In here, I enabled the cache profile, disabled anonymous cache profile, set the authenticated cache profile to Extranet(Published Site)
  • I also enabled the "Enable debug cache information on Pages" to check if the caching was working as expected
  • Now, I logged in as the site administrator and checked the html source of the page. Instead of seeing the following message: "Rendered using cache profile:Extranet (Published Site) at: 2008- 02-24T10:08:03", this message came up : "8 Output cache not used. Reason: User can view an unpublished version of the current page".
  • The above was expected because, I was logged in as a site collection administrator. I logged off and logged in as a different user(reader access) and still was seeing the same message : "8 Output cache not used. Reason: User can view an unpublished version of the current page. "
  • I tried using different user id's but was still the same error message.
  • So, I went back to the site collection output cache profiles page and modified the Extranet(Published Site) property as shown below:

  • After this is done, I logged in as a reader and behold ! It works as expected spitting out a cached version of the page.
  • But the downside to the above setting is that the writers will be seeing a cached version of the page. I still need to figure out why the readers were able to see a unpublished version of the page.

Saturday, February 23, 2008

MOSS 2007 on Windows 2008

Recently I tried to install MOSS 2007 on Windows Server 2008. This blog post describes the sequence of events experienced by me.

Initially, I tried to upgrade the Windows 2003 server (enterprise) to Windows 2008 server(standard) but this is not possible. Migration seems to possible from standard 2003 -> standard 2008, standard 2003 -> enterprise 2008, enterprise 2003 -> enterprise 2008. You will not be able to upgrade from enterprise 2003 -> standard 2008.
After this, I did a fresh install of Windows 2008 server (both web and database, though database upgrade was not needed) and configured the required Roles(Web Server) for the web front end server. I was not able to directly install .NET 3.0 framework on 2008 as in Windows 2003. .NET 3.0 framework needs to be installed using the 'features' feature in Windows 2008. Also, I enabled other features like Load Balancing and WindowsActivation. Activating these features is quite easy in Windows 2008 compared to Windows 2003.
Having done the basic steps, I inserted the MOSS 2007 installation DVD and ran the exe. I did not record the exact error, but it was something simillar to this one: 'product id was not found'.
MOSS installation was blocked on Windows 2008 and it required MOSS SP1 to continue. But the problem is you have seperated files/exe's for MOSS 2007 and MOSS 2007 SP1. On Windows 2003 you need to install MOSS 2007 first and then later do an upgrade. I found a few blogposts on MOSS - Windows 2008 installation and they all pointed out to slipstream installation of MOSS 2007. Slipstream installation refers to the integration of updates, patches with the installation files of a product. I copied all the installation files from the MOSS 2007 DVD onto the c:\MOSS 2007 and then dowloaded the sp1 files from here:

WSS 3.0 sp1:
http://www.microsoft.com/downloads/details.aspx?FamilyId=4191A531-A2E9-45E4-B71E-5B0B17108BD2

MOSS 2007 sp1:
http://www.microsoft.com/downloads/details.aspx?FamilyId=AD59175C-AD6A-4027-8C2F-DB25322F791B&displaylang=en

Using winzip, I extracted the installation files to the directories like c:\MOSS-sp1 and c:\WSS-sp1. Then copy the files from these directories into the upgrades folder in c:\MOSS 2007 . I clicked on 'yes' for replace files prompts. Running the setup.exe after copying the sp1 files should directly take you to the MOSS setup console. From here onwards, it should be the same one as on Windows 2003.

Reference urls:

http://blogs.msdn.com/sharepoint/archive/2007/12/11/announcing-the-release-of-wss-3-0-sp1-and-office-sharepoint-server-2007-sp1.aspx

http://mindsharpblogs.com/ben/archive/2007/12/16/3837.aspx

Monday, February 18, 2008

MCTS (70-630) - Configuring MOSS 2007

I took the 70-630 exam yesterday and passed with a decent score. It was an easy one and should not be really difficult if you have already worked with MOSS 2007. It covers most of the administration stuff and it is sufficient to know the basics of MOSS 2007. I used Patrick Tisseghem's 'Inside Office Sharepoint Server 2007' and went through the articles on technet. Bill English's Administrator's companion is also supposed to be a good one but probably is not needed to get through this exam.

Tuesday, January 29, 2008

MOSS Indexing

Joel Olson has a great blog post on the anatomy of MOSS indexing. Here is an excerpt from his post. When a full crawl is started, then :
  • Indexer communicates with a WFE web service, the sitedata.asmx
  • Enumerates the URLs and gathers metadata
  • With the URLs it issues GETS for the content from the content database to retrieve the page content and subsequent documents and lists
When an incremental crawl is started, then:
  • Indexer communicates with a WFE web service sitedata.asmx to read the change log through WSS Object model
  • Does enumeration and returns changed/added/deleted URLs and metadata to the indexer
  • Indexer issues http GETs to index the relevant content
I can also add a few tips:
  • An incremental crawl will go ahead and delete any content it cannot find (even if it was previously found). Be careful about crawl rules being added and deleted. Also check to see if all your pages are working properly or else they will be deleted
  • Incremental crawl will index aspx files and all other document types during incremental crawl. It will NOT detect changes to aspx files
  • Incremental crawl is very fast compared to a full crawl.
  • You can easily run into memory exceptions (specially 'Error in Site Data Web Service: Out of Memory Exception'). This might be because of the number of documents in the library. The only way out can be to reduce the number of documents/migrate to 64 bit (I cannot confirm this statement...Iam still having a simillar problem). You should also try to add Impact rules and change the interval between each request.

Monday, January 28, 2008

Export MOSS Search Settings

For a long time now, I have been looking for a tool to export all my search settings from production to development environment and I thought the only way to do this is through the MOSS backup/restore process. But, there is a tool to do all this for you. You can basically export all your Content Sources, Managed Properties and Scopes using this tool. Check out the tool here:

http://www.codeplex.com/SSSPPC

Thursday, January 24, 2008

After 6 months with my IPhone

How does one feel after spending 6 months with his IPhone ? Does he feel really excited to own such an exquisite gadget or does he feel bad for spending approx 500 bucks for a phone which got reduced to 300 after a couple of weeks ? To find out more read on....
- points
  • Bad Speakers ...sometimes it really gets on my nerve. When talking on the fone while driving or listening to music you need really good speakers and this is something IPhone doesn't have.
  • Battery life...I need to charge it every night or my fone is dead the next morning.
  • Browser crash...Quite often the browser crashes or responds too slowly.
  • No video camera.
  • Cannot create custom apps without hacking it.....Creating our own apps would have been a great feature if available.
+ points
  • Now having mentioned the - points, the + points would be a long one starting with an excellent design making you will love it instantly. You cannot stop showing it your friends, co-workers and to others...
  • Google Maps.
  • Watching youtube videos without switching on your laptop.
  • Browsing internet and accessing your email from anywhere and anytime .
  • Google has been really good in developing applications customized to iphone and these really help using it.
  • Tracking your voicemail and sms from a particular caller....This is quite different from other phones.
I have not mentioned anything about the ipod features in an IPhone because this in not something I use everyday. I use my iphone as a music player probably a couple of times a week but mostly it ends up being my fone.
It has been very good to me even though I dropped and abused it a couple of times. I cannot imagine waking up one day and not finding my IPhone next to me. It greets me with an alarm every morning, gets me the latest news, shows my calender, gets my email and all this happens without you getting out from your bed. Don't you think this is enough to own an IPhone ?

Later,
Prashanth

Wednesday, January 23, 2008

AIM 6.5 on Vista with UAC turned off

Today, one of the users complained about wireless not working, the Network Sharing center taking ever to load and Remote Desktop not working. I checked the services and most of them were not started. I tried to start the Network List service but it was throwing an error:

"Insufficient system resources exist to complete the requested service"

I tried googling and the following came up:

http://forums.microsoft.com/technet/showpost.aspx?postid=2326150&siteid=17&sb=0&d=1&at=7&ft=11&tf=0&pageid=0

The posts were explaining exactly what I was facing. AIM 6.5 was causing a problem, but the user had installed AIM long time back and the problem started occuring recently. I uninstalled AIM, but it had no effect. The following steps solved the issue:
  • After uninstalling AIM, I turned on UAC
  • Restarted the system
  • Installed AIM and it started to work
You have to install AIM again to get the wireless and the rest of the stuff to work. Just uninstalling AIM and turning on UAC will NOT fix the problem.

Tuesday, January 22, 2008

MacBook Air

Check out the Macbook Air Ad here:



Also, check out the parody to the above one:

TechEd 2008

Registration for TechEd 2008 has opened and if you register before April 2008, you can save 200$. They have two tracks :
You will get to know more about the unreleased, state of the art technologies and also spend some really good time in Orlando, Florida.

Saturday, January 19, 2008

Hosts file getting deleted

Today, I modified the search indexer to point to a seperate wfe server instead of crawling all the wfe's. Once I modifed the setting, the following error started throwing up in the eventviewer:

Reason: Could not find file 'C:\WINDOWS\system32\drivers\etc\HOSTS'.

Event Type: Error
Event Source: Office SharePoint Server
Event Category: Office Server Shared Services Event ID: 6482
Date: 1/19/2008
Time: 6:12:03 AM
User: N/A
Computer: ******************
Description:Application Server Administration job failed for service instance Microsoft.Office.Server.Search.Administration.SearchServiceInstance Reason: Access to the path 'C:\WINDOWS\system32\drivers\etc\HOSTS' is denied.
Techinal Support Details:

System.UnauthorizedAccessException: Access to the path 'C:\WINDOWS\system32\drivers\etc\HOSTS' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamWriter.CreateFile(String path, Boolean append) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize) at System.IO.StreamWriter..ctor(String path, Boolean append) at System.IO.FileInfo.CreateText() at Microsoft.Search.Administration.Security.HOSTSFile.CleanupDedicatedGathering(Hashtable HOSTSFileMappings, StringBuilder HOSTSComments, IEnumerable obsoleteHosts, String dedicatedName, Boolean isDirty) at Microsoft.Search.Administration.Security.HOSTSFile.ConfigureDedicatedGathering(SearchServiceInstance searchServiceInstance, SPServer dedicatedWebFrontEndServer, IList`1 previousWebApplicationHostNames) at Microsoft.Office.Server.Search.Administration.SearchServiceInstance.SynchronizeDefaultContentSource(IDictionary applications) at Microsoft.Office.Server.Search.Administration.SearchServiceInstance.Synchronize() at Microsoft.Office.Server.Administration.ApplicationServerJob.ProvisionLocalSharedServiceInstances(Boolean isAdministrationServiceJob)

The above error shows up because the Sharepoint Timer job actually deletes the hosts file after you modify the wfe the crawler has to point to. I had taken a backup of file and I went ahead and restored it. But after restoring it back, the following error throws up in the eventviewer:

Reason: Access to the path 'C:\WINDOWS\system32\drivers\etc\HOSTS' is denied.

Event Type: Error
Event Source: Office SharePoint Server
Event Category: Office Server Shared Services
Event ID: 6482
Date: 1/19/2008
Time: 6:22:50 AM
User: N/A
Computer: ******************
Description:Application Server Administration job failed for service instance Microsoft.Office.Server.Search.Administration.SearchServiceInstance
Reason: Access to the path 'C:\WINDOWS\system32\drivers\etc\HOSTS' is denied.
Techinal Support Details:System.UnauthorizedAccessException: Access to the path 'C:\WINDOWS\system32\drivers\etc\HOSTS' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileInfo.Delete() at Microsoft.Search.Administration.Security.HOSTSFile.CleanupDedicatedGathering(Hashtable HOSTSFileMappings, StringBuilder HOSTSComments, IEnumerable obsoleteHosts, String dedicatedName, Boolean isDirty) at Microsoft.Search.Administration.Security.HOSTSFile.ConfigureDedicatedGathering(SearchServiceInstance searchServiceInstance, SPServer dedicatedWebFrontEndServer, IList`1 previousWebApplicationHostNames) at Microsoft.Office.Server.Search.Administration.SearchServiceInstance.SynchronizeDefaultContentSource(IDictionary applications) at Microsoft.Office.Server.Search.Administration.SearchServiceInstance.Synchronize() at Microsoft.Office.Server.Administration.ApplicationServerJob.ProvisionLocalSharedServiceInstances(Boolean isAdministrationServiceJob)


The following permissions need to be given to c:\Windows\System32\Drivers\etc folder for the wss_admin_wpg account :

  • Traverse Folder / Execute File
  • List Folder / Read Data
  • Read Attributes
  • Read Extended Attributes
  • Create Files / Write Data
  • Read Permissions
  • Delete Permissions ( I will explain this .....)

The delete permission also needs to be given because the timer job actually deletes and recreates the hosts file. I was a bit hesitant to give this but had to do so to get it to work. After the permissions are given, I did not see any other errors in the eventlog

Later..

Wednesday, January 16, 2008

Query.TotalRowsExactMinimum Property

Do you want to know what 'Query.TotalRowsExactMinimum' Property does ? Check it out here.....

http://msdn2.microsoft.com/en-us/library/microsoft.office.server.search.query.query.totalrowsexactminimum.aspx
There is no way one can understand what exactly it means ? Please let me know if someone knows what exactly it means.

Saturday, January 12, 2008

Phili code camp 2008.1

I just got back from Code camp and it was great. I started to blog using my IPhone and somewhere in middle, I lost interest to blog and therefore after the third session, you will not find anything except the session titles. I will update them later sometime. Also, please bear with me for the formatting of the text as it was done from an IPhone and right now I am really tired to make any changes....

Session 1:
Test driven development for T-SQL code
Write your test first and then the code.
Write the function that returns data.
Check that the function returns expected data.
How to deal with constraints?
Instead of directly dealing with the table with constraints, create a view that deals with a dummy table without any constraints. Create a procedure to change the table name. But obviously the production view cannot point to a dummy view.This is one of the disadvantages of using a dummy table. Also this would work only for unit testing and not integration testing.ETL would not work in this case either.Always execute your tests after code changes.
Naming: ut_testcasename
use suite of tests

Session 2:
Visual studio 2005 tools and add ins
vs express does not support add ins
command monitor
csproj files are really msbuild files
msbuild sidekick, a third party tool helps with msbuild
Enterprise library helps with basic application blocks
VSTO - visual ribbon and other add INS from vstudio
Resharper - grays out things not being used, helps with error detection and intellisense.It needs to be licensed.
T4 tool helps with color coding the template, use the *tt *t4 extensions.
Zenocode postbuild: .net obfuscator
Reflector: decompiler
Project line counter: specific projects,exlude designer autogenerated code.
Smart paster: paste as string or paste as comments or paste as region
Visual local history: slick tool for version historyFilecompare: Beyond compare
Enlarging tool tips: Tools --> Options --> Font & Colors -->Editor tool tip

Session 3:Sharepoint backup and restore
Session 4:
Exception handling
Session 5:
AJAX and Silverlight

Session 6:
AJAX and Sharepoint

Wednesday, January 9, 2008

Login failed for user 'YourUserName'. The user is not associated with a trusted SQL Server connection.

I was trying to add a new user to one of the databases and it was throwing me this error:

Login failed for user 'YourUserName'. The user is not associated with a trusted SQL Server connection.

I had seen this error before, but was not able to quickly realise the reason for the failure. I had created a sql server login, then a database user and finally mapped the sql server login to the database. The roles for the user were also set properly.

It was the sql server authentication modes. SQL Server was configured for only Windows authentication and not SQL authentication. Once SQL Server authentication was enabled, it worked fine. I had to reset the password after enabling SQL Server authentication mode.

Sunday, January 6, 2008

Taare Zameen Par (Indian Hindi movie)

This is one of the best Indian movies ever made. No wonder Aamir Khan is called "The Perfectionist".
Its a story of a young dyslexic kid (Ishaan), portrayed beautifully by Darsheel Safary. The story unfolds with Ishaan being hunted by the dancing letters (as called by Ishaan for his difficulties with decoding words). He lives in his own world inspite of the rigorous wordly competition and hence lags behind in studies and gets taunted both at home and school. Despite his pleas, his parents move him to a boarding school and eventually he looses interest in his best expertise, Painting. The way the director handled the emotions of Ishaan is worthy a praise and you will be able to recognize the character. You will laugh with him, sail through his canvas and also cry with him (not once but many times). Nikumbh (played by Aamir himself) is the new art teacher at the boarding school and it doesn't take him too much time to recognize Ishaan's problems. Being a dyslexic himself, he tries to explain to Ishaan's parents about their son's problem and also his great painting talent. He also goes the extra mile of helping Ishaan to overcome his problems in a very creative way. I will stop here without going further, as you should watch it to know the ending.

As I walked out of the theater, I could see fathers hugging their sons with affection. Most of them were wiping their tears while walking towards their cars.....

Links:
http://www.taarezameenpar.com/

Tuesday, January 1, 2008

Resetting search index error

I was trying to reset the search index on my dev box and the following error message comes up while doing so:

The application is unable to accept further updates because the last attempt to persist the state failed.

Checking the event logs show up following messages:

Unable to Reset search application 'Shared Services'. Microsoft.Office.Server.Search.Administration.DatabaseException: Unable to persist changes to the search application object due to a previous error persisting changes. See event log for more information on the cause. Only read operations are possible until the issue is resolved. ---> System.Runtime.InteropServices.COMException (0x80040DBA): The application is unable to accept further updates because the last attempt to persist the state failed. See the event log for more details. at Microsoft.Office.Server.Search.Administration.MSSITLB.IGatherApplication2.ValidateVersionForWrite(Int32 lLastVersion, Int32& plVersionOut) at Microsoft.Office.Server.Search.Administration.SearchApi.WriteAndReturnVersion(CodeToRun`1... .. remoteCode, VoidCodeToRun localCode, Int32 versionIn) --- End of inner exception stack trace --- at Microsoft.Office.Server.Search.Administration.SearchApi.WriteAndReturnVersion(CodeToRun`1 remoteCode, VoidCodeToRun localCode, Int32 versionIn) at Microsoft.Office.Server.Search.Administration.SearchApi.ResetApp(Int32 versionIn) at Microsoft.Office.Server.Search.Administration.SearchApi.ResetApp()

To fix it, I tried the following steps:
  • Operations -> Services on server -> Office Sharepoint Server Search - > stop
  • Started the service again
  • SSP site -> search settings
  • Here you need to associate the SSP with the search database
  • Once its done, go back to the search settings page and wait for sometime for the indexer to complete its job (probably 2-3 minutes)
  • Now the search index can be reset.

Happy new year

Wish you all a very happy and prosperous new year !