Habitat
Habitat copied to clipboard
installation gotchas
I set this up last Friday. I ran into a bunch of issues, worked through all of them, some with the help of posts here. So I wanted to post back some thanks and note the gotchas that got me in case it helps anyone else.
WFFM
- yes indeed, it requires mongodb to be running or you will get an infinite package installation spinner. (I saw this note somewhere, here or in the wffm doc)
NPM
- I ran NPM Install with admin privledges, and it finished. However running gulp was a command not found error for my repo directory. To fix the problem I ran this and then gulp could execute: npm install --global gulp-cli
Step 3: Publish All Projects
- this step can fail if you have any of the config files open in notepad++
Double Slashes
- instanceRoot in the gulp-config.js needs to have double-slashes. The config file correctly does, but when I put in my custom path I was looking at the Getting Started page which has single slashes. My bad, won't get most people, but got me :-)
Syncing with Unicorn
- I had the same problem as some other folks here. I was using Task Runner Explorer in VS and it would appear to start the task and then nothing would happen. The posts here helped me out, you have to either run it from the command line so you get the security prompt that VS is squashing, or right click on each file in the scripts/Unicorn folder and select Unblock.
150 Character Path Limit
- I used a custom directory for my repository which was a couple levels deeper than the default. When running the Unicorn step I was getting errors that the path was too long, in my case 153 characters. So I picked up everything and moved it closer to the root.
- after moving everything, calling the Unicorn step specifically it was still using the old path. Running the whole set of tasks (running "default") cleared that and it used the correct path going forward.
Package.xml locked
- Sometimes running all the tasks from the "default" entry results in a Package.xml file is locked error. I'm assuming it's getting locked in the 02-Nuget-Restore task and not being released before it is needed by a later task. At that point, running each step manually worked and I didn't get any locked errors.
Thanks for all the help everyone!
Amazing comments. Thanks @raigunn
Another thing worth noticing might be that all (except test projects) package.config files' build action are set to "Content" which means the package.config will be copied to the website while publishing. This is fine when publishing just one module. But when it comes to publishing all modules (such as running the default gulp task) and due to the number of modules the package.config in webroot sometimes get locked (I guess the previous file lock handle was not released yet) and the package.config from the module being copied cannot replace it and this will throw an exception and stop the task runner.
@Eldblom it might be worth changing all those package.config files' build action "None"?
We had the same issue. You can fix it by excluding files from publishing in your global publishsettings.targets file:
<ExcludeFilesFromDeployment>packages.config</ExcludeFilesFromDeployment>
Reopen the solution or the change might not work.
Thanks @sklagenberg that is a good one :)
@Eldblom RE: gulp
May make sense to add a "gulp" script (which npm will reference from node_modules/
) and modify directions to run that script. e.g. (edit to (package.json`):
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "gulp"
}
Now you can instruct users to run npm run build
. (Alt. you could name it "start" and npm start
would work, but makes it too ambiguous IMHO).
Just a thought. -bch
Hi, I have trouble getting the sync-unicorn step to be executed.
I have tried running through Task Runner Explorer via Visual Studio and no luck, it just sits at "starting 05-sync-unicorn". I have also tried running it via command line, cmd.exe /c gulp -b "C:\Home\Habitat" --color --gulpfile "C:\Home\Habitat\Gulpfile.js" 05-Sync-Unicorn and it just sits there as well with no prompt for permission.
Any advise is appreciated. Thanks!
Karen
Hey @Karen,
Are you using latest master branch? Please check the following prerequisites:
- By default the solution now requires Visual Studio 2017
- Make sure you are using Sitecore 8.2 Update 4 (rev 8.2.170614)
- Make sure you have installed corresponding WFFM module
- Make sure you have updated the configuration files (e.g. gulp-config.js, publishsettings.targets, z.Habitat-DevSettings.config) to match your local environments
- After all above, make sure your Sitecore is running.
Then, build the solution to see if everything builds and then run the default task in Task Runner Explorer. If it failed the first time, try more times. If it still does not work perhaps you can post some lines around where it went wrong from the Task Runner Explorer log window. Also check Sitecore logs see if there are suspicious exceptions.
Cheers, Dennis
Hi @codingdennis,
Thanks for the quick response! Other than the point "requires Visual Studio 2017," everything else was updated. We have visual studio 2015. Also I can get grunt to build manually from step 01-04 without any issue.
There is no way around the 2017 requirement?
Regards, Karen
Hi, @codingdennis, Thanks for listing down the requirements. I am using Sitecore 8.2 update-5 which seems to be using MongoDB.Driver 2.0 and the Habitat is using the older version and b/c of that as soon as you publish the project whole thing goes down.
Is this something which fairly new?
Meanwhile, I am downloading the 8.2 update-4 and give a try and see if that work ok
I am having problems on step 5 with MongoDB
Exception Details: System.IO.FileLoadException: Could not load file or assembly 'MongoDB.Bson, Version=2.4 at MongoDB.Bson.Serialization.BsonClassMap.RegisterClassMap[TClass](Action1 classMapInitializer) at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbObjectMapper.RegisterModelExtension[T]() .4.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
using Sitecore 8.2 update-5
any help would be appreciated.
Hi All, I am hitting the same issues as abajournas. A fresh sitecore instance works fine, task manager till task-4 works fine. Task 5 fails, when try to access the site i get the same issue Could not load file or assembly 'MongoDB.Bson, Version=2.4.4.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileLoadException: Could not load file or assembly 'MongoDB.Bson, Version=2.4.4.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Hi All, Finally able to install habitat, following steps followed.
- Uninstalled mongodb 3.4 guess its not supported by habitat. This resolved the mongodb.beson issue.
- Need to unzip the WFFM zip and add the "Web Forms for Marketers 8.2 rev. 161129" as a module. This help to resolve the unicorn issue related to forms.
Thanks @nitinnegi. Checking prerequisites Habitat and the specific version of Sitecore is vital for successful installation.
Agreed.
@nitinnegi, I am running into the same issues. Did you revert mongodb from 3.4 to 3.2?
No just uninstall it and then install Sitecore fresh.
On Fri, 17 Nov 2017 at 8:41 am, wilson353 [email protected] wrote:
@nitinnegi https://github.com/nitinnegi, I am running into the same issues. Did you revert mongodb from 3.4 to 3.2?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Sitecore/Habitat/issues/281#issuecomment-345071690, or mute the thread https://github.com/notifications/unsubscribe-auth/AYStKjJeJOnIYx3GVTOkINlmiDOzgRHMks5s3KwPgaJpZM4MNiSl .
-- Best Regards Nitin Negi 0414 227 425 Unless you try to do something beyond What you have already mastered, You will Never Grow :-Ronald E Osborn
VS 2017 seems to be a prerequisite for Habitat. But can work with VS2015 as well. Only issue I faced was with MsBuild. Gulp task was referring to v15 of msbild. Had to change the version of msbuild in the gulp-config.js to '14'. Everything thing went well thereafter.
@nitinnegi
I uninstalled Mongo 3.4 completely, and did not try to install any lower version since you did not mention any step like that, and i still get that same error. Is their anything I should look at ?
[13:42:52] Starting '05-Sync-Unicorn'...
Error: Invoke-WebRequest :
Error:
Could not load file or assembly 'MongoDB.Bson, Version=1.10.0.62,
Is anyone else having issues withthe builld deleting all the CSS files during the build ? I have tried to build the habitat v9 and V8.2.5 branches on both visual studio 2017 and 2015 and during the build the CSS files seem to get deleted. I am assuming this is an gulp-msbuild issue - I am using version 0.4.8 any ideas ?