Friday, April 21, 2017

Sitecore Habitat Project Installation Tips and Errors




Have you installed Sitecore habitat? Not yet, just try it, it will not take more than an hour.

If you are lucky it will go in the first shot, but in real life we see lots of issues come at the execution time or run time, so here is the complexity of the Sitecore habitat project with GULP, NPM, Nodejs, Unicorn, configurations, your company network security etc.. Etc..

You have to be very careful at the time of Sitecore habitat installation, below are some tips regarding the Sitecore habitat installation:
  1. Installed the right version of Sitecore and WFFM that support the Sitecore Habitat Project, for example, currently, Sitecore 8.2 update 1 is compatible with habitat
  2. Change the configuration properly as per your Sitecore instance name, directory and source code path in gulpfile.js, gulp-config.js, z.Habitat.DevSettings.config File.
  3. Provide the required permission to your Sitecore instance > website folder
  4. Chose your project source code location at the time of node.js installation instead of the default location.
  5. Make sure you have installed the correct WFFM module with post-installation steps, try to avoid this installation using SIM.
  6. MongoDb service should be running in order to install WFFM. Otherwise, you will have an infinite loop in WFFM installation. 
  7. Disable xDB configuration if you are not using XDB.


I have invested a good amount of time in R&D in order to figure out the solutions of these silly problems/Errors. So don’t waste your time in these errors, it’s a very basic just be focused at the time of installation and follow the steps which are mentioned in the installation guide 


Here I am describing the 2 errors with a solution that I have faced recently during the Sitecore habitat installation:

1st error: Habitat Gulp Task > 03-Publish-All-Project Failed 

Build Error

 cmd: '"C:\\Program Files (x86)\\MSBuild\\14.0\\Bin\\MSBuild.exe" "C:\\projects\\Habitat\\src\\src\\Feature\\Person\\code\\Sitecore.Feature.Person.csproj" "/target:Build" /verbosity:minimal /toolsversion:14.0 /nologo /maxcpucount /property:Configuration="Debug" /property:DeployOnBuild="true" /property:DeployDefaultTarget="WebPublish" /property:WebPublishMethod="FileSystem" /property:DeleteExistingFiles="false" /property:publishUrl="C:\\inetpub\\wwwroot\\Habitat.dev.local\\Website" /property:_FindDependencies="false"' }[17:07:13] Build failed![17:07:13] 'Publish-Feature-Projects' errored after 16 s[17:07:13] Error: Command failed: "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" "C:\projects\Habitat\src\src\Feature\Person\code\Sitecore.Feature.Person.csproj" "/target:Build" /verbosity:minimal /toolsversion:14.0 /nologo /maxcpucount /property:Configuration="Debug" /property:DeployOnBuild="true" /property:DeployDefaultTarget="WebPublish" /property:WebPublishMethod="FileSystem" /property:DeleteExistingFiles="false" /property:publishUrl="C:\inetpub\wwwroot\Habitat.dev.local\Website" /property:_FindDependencies="false"    at ChildProcess.exithandler (child_process.js:204:12)    at emitTwo (events.js:106:13)    at ChildProcess.emit (events.js:191:7)    at maybeClose (internal/child_process.js:886:16)    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)[17:07:13] '03-Publish-All-Projects' errored after 36 s[17:07:13] Error in plugin 'run-sequence(Publish-Feature-Projects)'Message:    Command failed: "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" "C:\projects\Habitat\src\src\Feature\Person\code\Sitecore.Feature.Person.csproj" "/target:Build" /verbosity:minimal /toolsversion:14.0 /nologo /maxcpucount /property:Configuration="Debug" /property:DeployOnBuild="true" /property:DeployDefaultTarget="WebPublish" /property:WebPublishMethod="FileSystem" /property:DeleteExistingFiles="false" /property:publishUrl="C:\inetpub\wwwroot\Habitat.dev.local\Website" /property:_FindDependencies="false"Details:    killed: false    code: 1    signal: null    cmd: "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" "C:\projects\Habitat\src\src\Feature\Person\code\Sitecore.Feature.Person.csproj" "/target:Build" /verbosity:minimal /toolsversion:14.0 /nologo /maxcpucount /property:Configuration="Debug" /property:DeployOnBuild="true" /property:DeployDefaultTarget="WebPublish" /property:WebPublishMethod="FileSystem" /property:DeleteExistingFiles="false" /property:publishUrl="C:\inetpub\wwwroot\Habitat.dev.local\Website" /property:_FindDependencies="false"Stack:Error: Command failed: "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" 

Are you facing the same error, you have downloaded the habitat project from the github and trying to set up locally on your machine?

Solution

The problem is the permission issue of C:\inetpub\wwwroot\habitat.dev.local\Website\packages.config File. Your system treating this file as unprotected 

Just right click >Unblock this file and try again, it will work.

“The file has come from another system and might be blocked by some application running on the current system“. This type of problem is apparent with the Windows Vista and Windows XP SP2 running with IE 7 where the zone related data is maintained in the system with NTFS partition”


2nd Error : '05-Sync-Unicorn’ Invoke-WebRequest Error - 'Sitecore.ContentSearch.IIndexOperationsEx'

Starting '05-Sync-Unicorn'
Sync-Unicorn: Preparing authorization for http://habitat.dev.local/unicorn.aspx?verb=Sync&configuration=
Error: Invoke-WebRequest :
Error:
 Could not load type 'Sitecore.ContentSearch.IIndexOperationsEx' from assembly 'Sitecore.ContentSearch, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'.


Are you facing this error – Sitecore.contentSearch.IIndexoperationsEx?

I also faced the same error, I tried to figure the problem and found the solution

Solution

I installed the higher version of Sitecore 8.2 update 3, which is not compatible with habitat solution yet. Then I used the version mentioned in the wiki for Sitecore habitat (Sitecore 8.2 update 1)

Make sure you have installed the correct version of Sitecore and WFFM as below:
  1. Sitecore Experience Platform 8.2 Update 1 in Experience Platform or Experience Management mode
  2. Webforms for Marketers 8.2 Update 1 module. It should be installed prior to running Sync Unicorn gulp task.

Also, you may need to have running mongo instance when installing WFFM module, otherwise it may lead to never ending installation dialogue window.


I hope this article will help you during the installation of habitat project.

If you have any questions or concerns, please get in touch with me on twitter @sitecore_ashish or on Slack).

Happy Sitecoring and Habitat