Skip to content
May 30, 2017 / kiranpatils

The Sitecore Basics Test : Symptoms of failing Sitecore Project

I have been fortunate enough to work on Sitecore projects since last 8 years of my overall 10 year’s experience. Throughout 10 years – I have  successful/unsuccessful projects.

I thought to prepare a list which helps you to identify [If you want to ;)] whether your Software project is failing or not and I like this article a lot — https://www.joelonsoftware.com/2000/08/09/the-joel-test-12-steps-to-better-code/ – Great test!

Recently I was reading Peopleware — It has the first chapter “Somewhere Today, a Project Is Failing“. – They did research on 500 projects — which they measured on project size, cost, defects, acceleration factors, and success or failure in meeting. Stats are as below:

  • 15 % : Canceled or “postponed” or they delivered products that were never used
  • 25% : For bigger projects, the odds are even worse, they lasted 25 work-years or more failed to complete

In earlier surveys, they discarded these failed data points and analyzed the others. Since 1979, they have been contacting folks who left from projects to find out what went wrong, Most part of the projects they studied, there was not a single technological issue to explain the failure.

I thought to compile similar set of list for Sitecore projects – Because while I’m writing and you are reading – Somewhere Today, a Sitecore Project Is failing.

Before we start would like to mention few things:

  1. Joel’s list is the base class for this list — Because Points which Joel has mentioned applies to any kind of project
  2. Will derive from Joel’s list and jot down my observations specific to Sitecore – It might fit or might not fit for your organization — Please use your own judgement [Listen your team’s views – Analyze – Conclude]. Before you derive something. If you have more better steps — please share

I’m excited to share what I learnt in 8 years, which you might learn in 8 minutes – That’s why I’m born – Born to share – Here we go:

Just a note : These symptoms applies to all kind of projects — Product/New Project/Enhancement and Support Project

  • Tough to onboard new Developer : If on boarding new developer is taking weeks or people say – No, we can’t onboard new developer new Developer in crunch time without logical reasons and gives you a reason that on boarding will take time from project developers or will take weeks. Then this is a sign of failing Sitecore project. This means everything is unmanaged. No one has documented on boarding steps [They are insecure?!] or current developers configured their Development environment anyhow and now they don’t recall what they did. My rule of thumb is — In 4-6 hours [Vary based on project’s external dependencies e.g. Commerce, SOLR, etc] and a document should be more than enough to onboard new developer. If your teams says No — Take a step back, listen their reasons. And analyze it.
  • Sitecore Developers don’t know what they are doing : During demo/in meeting, when you ask in-depth “Why” [Is this the best way to do this in Sitecore? Is there a simplified way to do this?] questions and Sitecore Developers can’t explain you in simplified manner — Something is not right. It’s time to get right partner/developer onboard!

https://s-media-cache-ak0.pinimg.com/originals/63/e1/34/63e1340fc40edcce7010ce9500937a1e.jpg

  • Huge Estimates : When you see huge estimates for simple set of tasks, It means that things are not rightly architected If project is new then it’s fine. As building robust framework takes time. But if it is taking longer for later sprints or for support and enhancement – Then you need to talk to your team. Again, It might be a case lead Developer has left and new Developers are trying to understand and implement solution – This is fine to have situation – And each project has a bit of learning curve, As there were no defined Sitecore project architecture standards — It was different company by company or in some cases project by project. And that’s why Sitecore and Sitecore community is excited to learn and implement Helix You should come out of cave, If you don’t know about Helix and read about it!

why-helix

 

You might have smart developers onboard on project. But past implementation has been super tightly coupled, One change can break N number of things or ruin someone’s evening plans or weekend 😦

  • Developer spends more time in figuring out “What” And “Why” then “How” : Your requirements are super vague. To work on feature A which is in reality 4 hours task. Developer spends 6 hours figuring out all material and still not clear what exactly needs to be done. As soon as he/she knows they are able to complete work in less than 4 hours. Other symptoms are – Team is more busy in meetings than being in zone – Scrum runs for hours and hours, Sprint planning runs for hours and hours, With whole project team. If you hearing <1 Man day task in next day scrum without any blocker — Then something is not right OR Your team is performing less than their capacity/velocity — Then you should talk to team!. Another sign is — If you ask two team members about Project schedule and you hear different answers — It’s time to talk. [Good read — About Watermelon Culture]
  • Developers don’t have good tools : From my point of view Sitecore Developers must need to have some good tools e.g. Reflector [My personal favorite], TDS Classic, Glass Mapper [If your team is still handy crafting models and not using code generation then they are investing their time in wrong things] etc.
  • Sitecore Items are not version controlled : This is the biggest sin from my point view. Your Sitecore items are as important as your code [In some cases more than code].  Can you imaging Software industry without version control? I know you tried that in college project[.zip of .zip, final .zip, .backup of .backup :)] — That doesn’t work – We are professionals. You are in to serious business — I like this chapter from 97 things every programmer should know book  : http://programmer.97things.oreilly.com/wiki/index.php/The_Professional_Programmer

“Professionals do not make a mess. They take pride in their workmanship. They keep their code clean, well structured, and easy to read. They follow agreed upon standards and best practices. They never, ever rush. Imagine that you are having an out-of-body experience watching a doctor perform open-heart surgery on you. This doctor has a deadline (in the literal sense). He must finish before the heart-lung bypass machine damages too many of your blood cells. How do you want him to behave? Do you want him to behave like the typical software developer, rushing and making a mess? Do you want him to say: “I’ll go back and fix this later?” Or do you want him to hold carefully to his disciplines, taking his time, confident that his approach is the best approach he can reasonably take. Do you want a mess, or professionalism? ”

Please read this : http://hedgehogdevelopment.github.io/tds/chapter1.html#why-tds-classic-works

“We have found TDS Classic easily affords an 8%-15% decrease in costs (time) to develop a Sitecore solution regardless of the size of the project. A 10% savings over 30 weeks for a 3 person team is 9 weeks of gained productivity. If the average team member salary is $75k per year this represents approximately $13k in savings.”

If you have budget constraints? Sitecore community folks have done lot of good things – Especially Kamsar‘s Unicorn

I love Sitecore items to be Version controlled because:

  • Developers can have their own Sitecore Database copy
  • Which is blessing when you have Developers who are connecting over VPN to your shared Database — VPN is still not the best solution our industry found
  • They can make Sitecore level changes without breaking anyone’s challenge
  • This is the first step for automatic deployment
  • Everyone is accountable
  • Easy to track, compare and revert!
  • Sitecore Configuration Patching is not used : This is also super important to have. Sitecore configuration patching helps you to keep your Sitecore configuration changes in control for development, deployment, troubleshooting and version upgrade. The day your configurations are out of your control — You are done!
  • Deployment makes your nervous : Obviously, when you say – Live/Production deployment people feel bit nervous. But each time it makes you super nervous and you have a lot of deployment failures/revert – This is sign of some loophole in system. It can be either process, wrong implementation, folks don’t know what they are doing, no/less code reviews, tightly coupled code, QA is not involved in project. Any Developer goes and deploys files in lower environment/in some cases production/live environment. No one takes a lead to take a lead on deployment failure. No one wants to retrospect. I have worked with a team, Where when you say production deployment. They start planning for party — Because they have full confidence on what they have done in their local machine/lower environments, is nothing but a master piece of professional and elegant work! If your deployment is still manual and runs for hours and hours [Think of Web farm with 20+ servers] then you need to stop development and start thinking to automate or semi automate your deployment process OR If you can’t automate please simplify the process. Discourage tame to make last-minute changes or change go live date.
  • No proper handshaking between teams : I always visualize Sitecore Development – Deployment is same as like Assembly line.  If one player/team is slow. It will slow down whole process. [Read The Goal book?]. It’s not because of technology. But no proper team environment. There are teams within teams. UI Developers should always be ahead of Backend developers and QA should be always ahead or aligned with backend developers. QA should be involved in process at right time. I always prefer to have BED and QA work parallelly – Developer writing code and QA writing test cases.

https://www.hash.com/forums/uploads/monthly_06_2007/post-3557-1180792087.jpg

  • Site performs poor without caching :Sitecore being an enterprise level CMS provides state-of-the art Sitecore caching. But lot of bad implementation tries to hide behind Sitecore caching – I always prefer to do load testing without Sitecore caching. If you can meet your thresholds during this then you will be able to beat your competitors when you go live! Also, It’s always good to have time for performance testing and tuning (Another gold mine is your Sitecore log files – Great Sitecore Developers always prefer to check log files before they Go-Live for Project/Product/Sprint). If your team says – We don’t have time for performance tuning — It’s time to talk!
  • Content authors need a lot of hand holding or coming up with lot of questions : This means things are not simplified enough or Sitecore’s OOB features are not used e.g. Add Rendering, Placeholder settings, Data source etc.
  • All plans fail without Content Matrix Plan : If you are ensuring UI, Backend, QA, Servers, DevOps folks, Process everything is good. But in case if you missed to plan, Content management/entry for your huge site — Then your project will get delayed. Because content management is also a critical task. If you have a new site and there is a lot of content your content team should start adding content as soon as they can

Found helpful? I repeat, this is not a fully comprehensive list. I’m sure you will have your learnings which you should share with us — So, you will be able to save that failing project.

Happy Sitecoring! 🙂

March 9, 2017 / kiranpatils

Helix, 8.2 DI and An error occurred when trying to create a controller of type ‘ScBasics.Feature.Nav.NavController’. Make sure that the controller has a parameterless public constructor

Challenge:

The best part of our lives is, Whatever/However experience you are you will face one exception/error which challenges your experience. And that’s what happened with me recently. And I am sure you agree — That’s when your basics come to rescue — Same was the case in my case.

We were deploying Helix based solution which was working like a charm in local. [In case you haven’t heard of Helix/Habitat yet – Which I don’t expect to be the case. But If heard and not explored/clear on it. Then this post might help you]

https://i1.wp.com/www.ybrikman.com/assets/img/blog/docker/say-works-on-my-machine.jpg

But as you know “life is not as easy as it seems to be” When we deployed it on Dev/QA environment. We met following error:

Sitecore.Mvc.Diagnostics.ControllerCreationException was unhandled by user code
  ControllerName=Navigation
  HResult=-2146233088
  Message=Could not create controller: ‘Navigation’.
The item being rendered is: ‘/sitecore/content/SCBasics/Home’.
The context item is: ‘/sitecore/content/SCBasics/Home’.
The current route url is: ‘{*pathInfo}’. This is the default Sitecore route which is set up in the ‘InitializeRoutes’ processor of the ‘initialize’ pipeline.
  Source=Sitecore.Mvc
  StackTrace:
       at Sitecore.Mvc.Controllers.SitecoreControllerFactory.CreateController(RequestContext requestContext, String controllerName)
       at Sitecore.Mvc.Controllers.ControllerRunner.GetController()
       at Sitecore.Mvc.Controllers.ControllerRunner.Execute()
       at Sitecore.Mvc.Presentation.ControllerRenderer.Render(TextWriter writer)
       at Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Render(Renderer renderer, TextWriter writer, RenderRenderingArgs args)
       at Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Process(RenderRenderingArgs args)
       at (Object , Object[] )
       at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
       at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
       at Sitecore.Mvc.Pipelines.PipelineService.RunPipeline[TArgs](String pipelineName, TArgs args)
       at Sitecore.Mvc.Pipelines.Response.RenderPlaceholder.PerformRendering.Render(String placeholderName, TextWriter writer, RenderPlaceholderArgs args)
       at (Object , Object[] )
       at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
       at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
       at Sitecore.Mvc.Pipelines.PipelineService.RunPipeline[TArgs](String pipelineName, TArgs args)
       at Sitecore.Mvc.Helpers.SitecoreHelper.Placeholder(String placeholderName)
       at ASP._Page_Views_Website_Layouts_Default_cshtml.Execute() in c:\…..\Website\Views\Website\Layouts\Default.cshtml:line 38
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
       at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
       at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData)
       at Sitecore.Mvc.Presentation.ViewRenderer.Render(TextWriter writer)
  InnerException:
       HResult=-2146233079
       Message=An error occurred when trying to create a controller of type ‘SCBasics.Feature.Navigation.Controllers.NavigationController’. Make sure that the controller has a parameterless public constructor.
       Source=System.Web.Mvc
       StackTrace:
            at System.Web.Mvc.DefaultControllerFactory.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType)
            at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName)
            at Sitecore.Mvc.Controllers.SitecoreControllerFactory.CreateController(RequestContext requestContext, String controllerName)
       InnerException:
            HResult=-2147467261
            Message=Context is null
            Source=Glass.Mapper
            StackTrace:
                 at Glass.Mapper.AbstractService..ctor(Context glassContext) in c:\TeamCity\buildAgent\work\8567e2ba106d3992\Source\Glass.Mapper\AbstractService.cs:line 103
                 at lambda_method(Closure , ServiceProvider )
                 at Sitecore.Mvc.Controllers.SitecoreDependencyResolver.GetService(Type serviceType)
                 at System.Web.Mvc.DefaultControllerFactory.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType)
            InnerException:

You might say that’s easy “controller has a parameterless public constructor.” – Just add this and it should work 🙂 But same code works in local, and second thing is we are using Sitecore 8.2 DI for controllers. And in that case, it is not required to have parameter less public constructor. And if it is same error for you, it means that, your DI is not working.

You are also facing same error? Then this post might help you!

Solution:

So, as every developer on this earth does, We also did a quick Google search and found following links, which were helpful:

  1. http://sitecore.stackexchange.com/questions/2929/no-parameterless-constructor-defined-for-this-object-after-upgrade-to-sitecore8 – dnstommy’s reply gave us a hint that our DI is not working
  2. Apart from this there were no any good results on web. So, now it was time to look back in code and see how things laid down and figuring out what’s going on

Troubleshooting process:

public static class ServiceCollectionExtensions
  {
    public static void AddMvcControllersInCurrentAssembly(this IServiceCollection serviceCollection)
    {
      AddMvcControllers(serviceCollection, Assembly.GetCallingAssembly());
    }
// Removed for simplicity
 public static void AddMvcControllers(this IServiceCollection serviceCollection, params Assembly[] assemblies)
    {
      var controllers = GetTypesImplementing<IController>(assemblies)
        .Where(controller => controller.Name.EndsWith("Controller", StringComparison.Ordinal));

      foreach (var controller in controllers)
      {
        serviceCollection.AddTransient(controller);
      }
    }
// Removed for simplicity
}
  • Looking at code, it makes sense. But it works in local. But not when deployed. So, after troubleshooting a bit. Thought to log what we get in calling assembly — We also faced challenge here. Sitecore logging will not work at this layer. So, we had to use plain old StreamWriter [You remember, I told. Basics!?]
  • The log results were something like this:
    • In local : In Calling assembly we were getting Feature assemblies
    • In QA/Dev : In Calling assembly we were getting Sitecore.Kernel
  • It was clear, Assembly.GetCallingAssembly() was misbehaving
  • Quick Google search reveled the mystery, GetCallingAssembly works different in Debug and Release mode https://blog.codeinside.eu/2014/10/05/Be-Aware-Of-Asssembly-GetCallingAssembly-Behaviour/
  • In local we are using Debug mode and on QA/Dev – We are using Release mode
  • Root cause “The JIT compiler moves code around to optimize for performance. Small methods (up to about 56 Byte IL-Code if I remember it right) can be inlined where the method call was before. But the compiler does this only in release, not in debug mode. Also when attaching the debugger to our release build the JIT compiler stopped inlining to enable debugging and our bug was gone” : Source : http://www.ticklishtechs.net/2010/03/04/be-careful-when-using-getcallingassembly-and-always-use-the-release-build-for-testing/
  • Last post had an approach — Adding [MethodImplAttribute(MethodImplOptions.NoInlining)] on method — Which somehow didn’t work for us
  • But then thought to look for some better options and we found it!
  • We added one more Service configurator in Foundation which has following code:
namespace SCBasics.Foundation.DependencyInjection.Services
{
    public class RegisterAllFeatureControllers : IServicesConfigurator
    {
        public void Configure(IServiceCollection serviceCollection)
        {
            /* We were facing issue in Release mode
               Which was not resolving  
            */
            serviceCollection.AddMvcControllers("SCBasics.Feature.*");
        }
    }
}
  • Above code, uses an alternate method for adding MVC Controllers and best part of this approach is. You no need to register your controllers, which you added in feature project. This foundation project will automatically do it! [BTW, Nothing is automatic, we wrote one time code for it ;-)]

Happy Coding! 🙂

March 9, 2017 / kiranpatils

Quick Helix deployment approach

Challenge:

I have been looking at a why, how we can deploy Helix approached solution without adding lot of tools and complexities. After investing some quality time. Have been able to do it. Few tweaks are required to this process. So, it can be automated. But basic idea should get you going!

Solution:

As you know each Foundation/Feature/Project – might have one web project Files which needs to be deployed to webroot. And TDS Items as well. Let’s look at each of them:

  1. Files : To deploy files, I prefered to use my old and gold – Web deploy! As you know for webdeploy and Visual studio publish for web project to work you need .pubxml and it holds few configurations. To centralize those configurations, here’s what we did:
    1. In Configuration folder created .targets file e.g. scbasics-pubsettings.targets
    2. Which contains publish related configurations  e.g. WebPublishMethod,MSDeployServiceURL etc.
    3. Each Web Project has its own .pubxml file which points to .targets file which we created earlier <Import Project=”..\..\..\..\..\..\Configuration\scbasics-publishsettings.targets” />
    4. So, using above approach, Configurations are centralized. So, in case if you have to change anything. You change it at one place rather than changing lot of places [depends on your feature/foundation/project count]
  2. TDS : We had access of Target server using HTTP. So, we just added required configuration in TdsGlobal.Config for that particular environment. And TDS is smart enough to take care of it!

I have not been able to hook it with Teamcity and do automated deployment yet. But when I do it using .sln — I can foresee only one challenge — Build ordering – Because your project should be built at last and it should copy root’s Web.Config. But that can be resolved with some ways — Which I’ve left for you! 🙂 Or you know If I spend time on it, will share with you — I expect the same! 😉

One more Helix puzzle resolved!

Happy Deployment! 🙂

March 2, 2017 / kiranpatils

TDS error while generating update package

Challenge:

It was Friday evening and it was time to sign off for the day and go on long weekend trip. Just before that we had a task to send a deployment package. And suddenly my friend Vikram shouted — While generating TDS Update package, We are getting this error

TDS: The package builder failed. Please see build output log for more details

When I went to his desk and said – Oh that’s easy. Just look at output log and we should be done! But It’s real world life, which is not as easy as it seems. You are also facing same error? Searching for solution? Then this post is for you:

Solution:

After trying few things we thought to do quick search and we found following great articles:

  1. https://theagilecoder.wordpress.com/2015/06/09/tds-the-package-builder-failed-after-project-rename/
  2. https://aldrichdev.wordpress.com/2016/06/09/tds-the-package-builder-failed-please-see-build-output-log-for-more-details/

Both have listed good suggestions. But neither of it worked for us. But might work for you. So, please do it before you move on. What, you already tried and then landed on this post. Then please keep reading. We thought to look at Build log level. By default they are minimal after changing it to Diagnostic. And when we tried again, we were able to find root cause from build output window that one of the .item was corrupted. As such it was not mandatory to have it. So, we deleted it AND It worked!

build-output

Happy Weekend! 🙂

February 17, 2017 / kiranpatils

Sitecore Helix Basics

Challenge:

Hey Friends, I’m excited to share many of first post of 2017! So, far it has been great year and I know a lot of you are MVP now or MVP Again — Congratulations Very well deserved! – Please make sure you help someone else become one — Because sharing is caring — Nice story

Since last year we have been hearing a lot about Habitat and then Helix and lot of people appreciating what Habitat or Helix is. You also heard/read about it? But:

  • You are afraid of It? Because Habitat solution is huge and you get confused how to set it up. Because it involves a lot of tools to set up e.g. gulp etc. [This is good point to upgrade your web/technology knowledge. It is evolving a lot. All of us accept that FED Technology is seeing lot of huge changes, and .NET Core team is doing super awesome stuff. If you don’t upgrade your self, there are chances of you being dinosaur in this industry]
  • Confused between Habitat and Helix
  • You setup your Habitat solution. But when you opened it. You got overwhelmed?
  • In this process, you don’t know how to get started and what’s the starting path for you to embrace Sitecore Helix?

Then this post is for you — This post will do 95% job to help you getting started on Helix — What about other 5%? — Will share about it before end of this post. So, let’s Helix

Solution:

Before we get further in technical details. Let’s try to understand what is the dictionary meaning of “Helix” – Wiki says “an object having a three-dimensional shape like that of a wire wound uniformly in a single layer around a cylinder or cone, as in a corkscrew or spiral staircase.”

Source : Wiki

It will be great to hear about naming directly from horse’s mouth some day.

Let’s get on point, How I got started on Helix? Exactly in same order:

Okay, Thank you for those resources. But can you please share your basics with me? So, I can get quickly started. Sure, here we go. I will share my learnings and understandings:

  • What is difference between Habitat vs Helix?
    • Helix :
      • Sitecore® Helix is a set of official guidelines and recommended practices for Sitecore Development.
      • Set of architecture conventions and guidelines that describe how to apply recommended technical design principles to a Sitecore project.
      • Secure implementations in a future proof way by architecting them as maintainable and extensible business centric modules
      • Development process recommendations to make it as easy as possible to build, test, extend, and maintain Sitecore implementations
    • Habitat :
      • Habitat is an example project that follows the Helix principles and recommended practices.
      • PLEASE DON’T USE HABITAT AS FOUNDATION/STARTER KIT FOR YOUR NEW PROJECT – HABITAT IS NOT BUILT FOR THAT
  • Why we need Helix?
    • Dependencies : If you look at dependencies, left side-show non helix project — Where any module is talking to any module — And as project becomes huge. No one makes small change with confidence — To make a one line change — Developer/QA/Stakeholders — Have to keep their fingers crossed. And still they have issues and because of it, they either have to miss dinner/lunch/outing with friends/baseball match/cricket match. But when things are done Helix way — right side. There are some standard ways – How each module talks to each other — And that gives everyone full confidence before making any change! — It is simple maths — Invest on strong foundation and take returns in a longer run! dependencies
    • Following diagram, clarifies that — As the project dependencies grow — lot of time spent on coupling rather than feature — and that increase time taken as well!why-helix
  • There are some logical layers defined, and you try to follow it – This image is very self explanatory. You just need to know three things – Foundation, Feature, Project – And each one of them should hold things which suits to their name:layers-basic
  • Benefit of using proposed layers — See this example – When you have multiple sites — They can have all foundational and featured things available! – Standard Sitecore Multisite way of doing things:layer-example
  • Helix also guides you how you need to structure your templates – Which are heart of any Sitecore projects : helix-template-inheritance
  • There are few Helix dependency rules you need to follow — You can break it. But then there is no point in using Helix:helix-rules
    • There is a strict reference hierarchy of module categories. Projects -> Features -> Foundations.
    • Project modules cannot reference other projects, but can reference any Features and Foundations.
    • Feature modules cannot reference any Project modules or other Feature modules. They can reference Foundations
    • Foundations can only reference other Foundations.
  • How to add advance things like GlassMapper, Sitecore 8.2 DI, Code Gen, TDS : Good question, We spend sometime and made it possible. This thread might help you get quick started [If not, give me a shout] : http://sitecore.stackexchange.com/questions/4370/few-questions-related-to-helix
  • If you think — There are a lot of Manual steps involved in adding a feature and foundation – Look at the great work done by Marc : http://blog.marcduiker.nl/2016/12/28/hands-on-with-sitecore-helix-using-powershell-add-module.html
  • Akshay also did good stuff taking this forward for initial setup : https://www.akshaysura.com/2017/01/21/habi-what-a-tat-create-a-sitecore-helix-solution-from-scratch-using-powershell/

It seems a lot? I know, I realized after writing. But I wanted to share all our basics with you. Because when we had to start, we were literally struggling to get started. But now, we did it. Thought to share with you. So, it saves some of your time, which you can spend with your loved ones or for other important things!

In Summary,

  • Helix is not a rocket science, It is same Sitecore code. But how and where you write it — That is standardized by Sitecore — As Sitecore support team is also using same methodology. So, it is easy for them to help you troubleshoot
  • Just imagine, your company adopts Helix and all projects which your company does, does in Helix [Including your project :-)]. After sometime, any developer can jump from one project to another project – Project on boarding will be super easy — (S)he just need to know business domain. I have seen lot of project leads, don’t allow new developers on board even though they can support more developers in project — Because of project on boarding — Helix helps us all speak same language!
  • “Helix is like Maths, Once you get it. You enjoy it and would like to do it again and again”

I am sure you must be curious t o know what else 5% I need to do to get 100% knowledge on Sitecore Helix? It’s simple — Get your hands on it. Coding is like swimming. You have to dive in to swim/code!

It was fun to work along with Muktesh and Varun on Helix basics! Thanks to all folks who already wrote about it, which helped us to get it started sooner!

Good read:

  1. http://helix.sitecore.net/
  2. http://www.sugcon.eu/wp-content/uploads/2016/05/Introducing-Sitecore-Habitat.pdf
  3. http://www.sugnl.net/~/media/SUGNL/Meetings/Developer%20track%2019%20oktober%202016%20Achmea/Downloads/SUGNL%20Meeting%20Achmea%2020161019%20%20Robbert%20Hock%20%20Symposium%20recap.pdf
  4. https://www.dynatrace.com/blog/adding-the-how-to-what-for-sitecore-helix-test-automation/
  5. http://www.hhog.com/blog/sitecore-helix-fxcop-rules/

Happy Sitecoring! 🙂

December 20, 2016 / kiranpatils

Sitecore Azure Basics

Challenge:

In a small city, there is a company. Where two people work – Mr. Basics and Ms. Curious. As name suggests Ms. Curious was always curious about anything. Whenever she used to see something new, she used to go to his friend. Mr. Basic. Again as name suggests Mr. Basic was always clear with his basics. And when anyone used to come to him with questions. He was helping them understand with all the basic information he had!

Disclaimer — All characters in this publication are entirely fictitious and any resemblance to real persons, living or dead, is purely coincidental.

Also, If you noticed in following posts I used male characters. But knowingly in this story I am adding female character. I would like to encourage more girls to code : https://girlswhocode.com/

  1. https://sitecorebasics.wordpress.com/2015/04/04/sitecore-multisite-basics/
  2. https://sitecorebasics.wordpress.com/2013/02/06/transfer-tool-media-transfer-bug/

So, Ms. Curious came to know about Sitecore Azure which is buzzing since 8.2 update-1 launch and she has already been through few articles on web. But still she prefers to talk to her friend Mr. Basics. So, Mr. basics as always explains all basic details about Sitecore Azure to Ms. Curious. This post shares chat between them. Which you might find helpful. If you are in same boat as Ms. Curious!

Solution:

Read from left to right :

1 23 45 67 8

Hope you found this chat helpful! Also, Would like to Thanks to all SC Community members for sharing their learnings as well SC documentation team for nice documentation. Which allowed Mr. basics to simplify Azure learnings. Thank you all of them!

Before you go to last section, Would like to say Thank you (Yes, you!) my dear reader for reading, sharing, visiting, and commenting on my blog. This blog is my open diary. Which I share with you. 2016 had been great year, on our blog — We got 85K views and 15 blog posts. Which makes 167 blog posts overall and 327802 Page views! Thank you – Humble, Grateful!

azure-happy-holidays

Happy Holidays, Have a great time with your loved ones!

Resources:

  1. http://www.sitecore.net/en/company/blog/489/five-reasons-why-microsoft-azure-web-apps-and-sitecore-are-a-match-made-in-heaven-4415
  2. http://blog.baslijten.com/category/azure/
  3. https://jermdavis.wordpress.com/2016/12/12/the-brave-new-world-of-azure-paas/
  4. https://doc.sitecore.net/cloud/
  5. https://mhwelander.net/2014/09/23/sitecore-azure-for-beginners-part-1-what-is-microsoft-azure/
  6. https://www.cmsbestpractices.com/choosing-the-right-hosting-option-for-sitecore/
  7. https://docs.microsoft.com/en-us/azure/app-service-web/app-service-web-overview
  8. https://tryappservice.azure.com/
November 3, 2016 / kiranpatils

Sitecore Instance Manager error

Challenge:

It is near to midnight in India and my phone is saying me that I should go to sleep. But before I go for sleep. Would like to make sure I blog my learning which took most part of my day and was scrathing my head.

So, I got a new laptop which has Windows 10 on it. Was trying to configure your and mine favorite Sitecore Tool – SIM (If you haven’t heard of Sitecore Instance Manager (SIM) and you are newbie then it’s fine. It is Army knife of Sitecore Developer, and a must need to have tool in your toolset)

After installing was trying to pass through initial configuration and it was tough to pass through following dialog.

“You probably don’t have necessary permissions set. Please try to click ‘Grant’ button before you proceed.”

 

If you are also facing this then this post might help you. So, let’s see what I found while troubleshooting this.

Solution:

  1. I went to c:\inetpub\wwwroot – And made sure that NETWORK SERVICE user has full access on main folder and sub folders – It was there!
  2. Did a quick search and found few good articles:
    1. http://sitecoreblog.patrickperrone.com/2015/04/a-simple-error.html
    2. https://github.com/Sitecore/Sitecore-Instance-Manager/wiki/Troubleshooting
    3. In Summary, This seems file system related error. But behind the scenes it also tries to check SQL rights. So, go back and make sure your connection string is right. What I would suggest you to do is. Take that username and password and try to login using SQL Server Management studio and try to create dummy database and delete it using same credentials. This should work. Also, make sure you are running your SQL Service using NETWORK SERVICE account
    4. Also, please make sure you are  running SIM as Administrator user
  3. One more thing, Make sure your SIM.EXE is not blocked, as it was downloaded from Web. If so, please unblock it
  4. After doing SQL Server related changes make sure you restart SQL Server – Then only changes will take effect

Then I got busy with other things and thought to find Plan B. Which was installing Plain Sitecore using Sitecore installer. I did that using Sitecore Installer (exe) was able to install Sitecore successfully!

But still that problem was still going on in back of my mind [We are same! ;)]. So, thought to ask few awesome Sitecore developers internally they gave few ideas. But everything was tried. Was about to go to bed and thought to troubleshoot a bit and then go for sleep. And I tried to reproduce the issue. But couldn’t, it was fixed! How?

As per my understanding:

  1. All above mentioned changes
  2. And Installing Sitecore using Sitecore installer

Fixed this issue! I can’t say it confidently. Till I get fresh laptop where I try exact same steps or one of you also try the same and confirm it for us!

Or Alen might have some idea and he improves that error message which indicates exact error message.

After writing above line, I realized that SIM is now open source and Alen and Sitecore’s vision will be fulfilled. If I am able to find this BUG and Fix it or narrow it down. So, I went ahead and cloned repository in my local and have been able to locate code which is causing this behavior. message variable is same for both scenarios – File system and local

https://i.imgur.com/3ugOPlS.png

And this is what TestSqlServer method does:

After looking at code, I noticed that there has been lot of logging going on. So, thought to find out log file and found it here : C:\Users\<USERNAME>\AppData\Roaming\Sitecore\Sitecore Instance Manager\Logs and found following errors:

1 13:25:09,168 DEBUG                           SQL Server Account name: LocalSystem
1 13:25:19,185 ERROR Cannot create a test database
System.Data.SqlClient.SqlException (0x80131904): Cannot open database “DBNAMEWHICHDOESNTEXIST” requested by the login. The login failed.
Login failed for user ‘lsa’.
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at SIM.Adapters.SqlServer.SqlServerManager.TestSqlServer(String rootPath, String connectionString)
ClientConnectionId:093bd696-1e58-4662-9e5b-2a172e5619ae
Error Number:4060,State:1,Class:11
1 13:25:42,751 DEBUG                           return False (System.Boolean)

After verifying connection string setting in SIM, I noticed some change:

Not working : user id=sa;password=*****;Data Source=MACHINENAME\SQLEXPRESS;Database=DBNAMEWHICHDOESNTEXIST

Working : Data Source=(local)\SQLEXPRESS;Initial Catalog=master;User ID=sa;Password=******;Connect Timeout=1

Working one must have been modified by Sitecore installer. Because I haven’t changed it.

This would have been easy fix. If error message was in sync with backend error — Now, we understand end user’s challenges better! 😉

In Summary,

  1. If you are getting such error, along with file system verify SQL related configurations
  2. Look at SIM Logs
  3. Don’t forget SIM is open source, clone repository and troubleshoot!
  4. Found and fixed it? Don’t forget to contribute your fix to make SIM better — Yes, Yes, I am also going to do that. Once I test my solution in local

Have a seamless SIM installation! 🙂

%d bloggers like this: