Wednesday 30 December 2020

Create Sitecore bulk items from list

There are scenarios where we have to create item list in Sitecore - For example: Countries, States, Products or any dropdown item list.


Prerequisites


Sitecore PowerShell Extension must be installed.

List of items, for reference sharing list click to download CountryList, USStates, IndiaStates or any custom file.

Download script CreateBulkItem.ps1


Demo Time


Create a Sitecore item at below path 

/sitecore/system/Modules/PowerShell/Script Library/SPE/Tools/Package Generator/Content Editor/Context Menu/Packaging

by duplicating existing script item and paste CreateBulkItem.ps1 as below (update list text path in script)


Create Sitecore bulk items from list


Execution Steps

Now right click on the item/folder, where wanted to create item list as per screenshot
Name and Value field's must have default value set as $name in template's standard value


sitecore-bulk-item-step

sitecore-bulk-item-inputs

sitecore-bulk-item-success






bulk-item-list



Note: We can do this activity for different field values using json item list file, we only have to update PowerShell script and Sitecore steps will remains same .


Save your time, Hope this help.


Saturday 26 December 2020

ERROR: failed to register layer rename Access is denied

During execution of docker-compose, there are chances to get below issue as

C:\ProgramData\Docker\image\windowsfilter\layerdb\tmp\write-set-547194937 

C:\ProgramData\Docker\image\windowsfilter\layerdb\sha256\315e8c08db9b1b7e769ea42ea3ac985e1f8613472735b9a706145d53348f8d26: 

Access is denied


To resolve this issue, we have to make sure all mentioned ports are unique in docker-compose.yml by running below command.


If there is no output entries came for specific port - then we are good, else will have to change port number.

Please run below command in PowerShell as admin

netstat -aon | findstr 8090


Hope this help.

Container is unhealthy docker

During execution of docker-compose, there may be chance of getting that container is unhealthy.

Let's say

ERROR: for traefik  Container "d96f2d2804ef" is unhealthy.


To know exact Issue behind this issue and about status, run below command in PowerShell by pasting above container id

docker inspect --format "{{json .State.Health }}" d96f2d2804ef

Will be output in json exact error details.

To know more about issue run another command as

docker exec -it d96 bash (first 3 character of above issued container)



Hope this will help

Cannot start service cm: container is marked for removal and cannot be started

During Sitecore instance setup with docker-compose command, sometimes you may face below issue

ERROR: Cannot start service cm: container is marked for removal and cannot be started

or 

ERROR: Cannot start service mssql encountered an error during hcsshim sitecore docker

or

ERROR: Cannot start service solr encountered an error during hcsshim::System::Start: failure in a Windows system call: The virtual machine or container exited unexpectedly.


To resolve above issues, please follow below steps

Try below commands as PowerShell script(admin mode)

docker-compose down

docker-compose up -d


If issue not resolved then please try below approach


copy container id, for which facing issue then run below commands in PowerShell as admin

net stop docker

now manually delete Folder with matched container id from C:\Programdata\docker\containers

net start docker



Hope this help.

Sitecore 10 update 1 installation using SIF

In previous article, we did setup Sitecore 10 update 1 instance using docker

Now in this article will explain alternate way to setup Sitecore 10.0.1 instance using SIF



Pre-requisites

Click here Packages for XP Single download and unzip (at Let's say D:\Sitecore101SIF)

Paste license.xml file at D:\Sitecore101SIF


Installation

Open PowerShell as admin and execute below commands in sequence

cd D:\Sitecore101SIF
Install-Module SitecoreInstallFramework  [ensure version is  2.3.0]
Install-SitecoreConfiguration -Path .\Prerequisites.json

below solr command is optional if solr 8.4.0 already working as https
Install-SitecoreConfiguration -Path Solr-SingleDeveloper.json

Update parameter values in XP0-SingleDeveloper.ps1
.\XP0-SingleDeveloper.ps1

That's it.


Demo Time






Friday 25 December 2020

Sitecore 10 update 1 Installation using docker

Recently Sitecore has released latest version 10.0.1 with new updates and improvements.

In this article, going to setup an Sitecore instance using docker.

sitecore-10-update-1


Let's start with Pre-requisites


Pre-requisites

Docker must be installed, running and Switched to Windows Container mode

docker-desktop-windows




Download Container Deployment Package from below link and unzip (at Lets say D:\SitecoreDocker101)

https://dev.sitecore.net/Downloads/Sitecore_Experience_Platform/100/Sitecore_Experience_Platform_100_Update1.aspx

sitecore-docker-container


download init.ps1 and paste at D:\SitecoreDocker101\ltsc2019\xp0

run cmd (admin) and trigger iisreset /stop
if any port from docker-compose.yml are is use (
can check by netstat -aon | findstr <portNo> from PowerShell)
then stop that service to avoid any interrupt during installation.


Installation Steps


Open PowerShell as admin and run below commands in sequence

  cd D:\SitecoreDocker101\ltsc2019\xp0

  .\init.ps1  (will ask for instance name, sql password, sitecore admin password and license path)

  docker-compose up -d


Demo

Open docker desktop dashboard view, will see Sitecore-xp0 up and running.

from PowerShell, run below commands

  docker ps (To get container ids for images)

  docker exec -it <container id> ipconfig  (replace with container id of cm server)

copy IP address, and run on chrome

sitecore-10-update-1

Common Issues:

http://succorpoints.blogspot.com/2020/12/error-failed-to-register-layer-rename.html

http://succorpoints.blogspot.com/2020/12/not-able-to-find-network-sitecore.html

http://succorpoints.blogspot.com/2020/12/cannot-start-service-cm-container-is.html

http://succorpoints.blogspot.com/2020/12/container-is-unhealthy-docker.html

Thursday 24 December 2020

not able to find network sitecore-xp0_default Sitecore docker

may be getting this issue while setting up Sitecore instance using docker. To fix this issue

please run below command on powershell as admin in sequence


docker-compose stop

docker-compose down

iisreset

docker-compose up -d


with this new network container id will be generated.

Hope this will help.

Friday 18 December 2020

There is no action to display Sitecore Form Issue

While working with Sitecore forms, may be facing below issue - on click of form submit action button
as attached image

there-is-no-action-to-display-sitecore



Error Message: There is no action to display.


Possible Cause: It may be because of caching issue.

Fix: Try to resolve this issue, either close the browser and clean history and check if resolved or open sitecore form explorer CMS view in Incognito(private) mode.

Hope this will help and save your time.

Friday 4 December 2020

This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Sitecore

Facing an issue that after setting up Fresh Sitecore Instance, not able to access local instance.
getting issue as below




and Config error as 

This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".


To resolve this issue,

Please update below setting as per screenshot

  1. Windows search -  "Turn Windows Features on or off"

  2. Expand ASP.NET 4.5 advanced services > WCF section

  3. Check HTTP Activation.

  4. You'll be asked to restart the system.




Hope this will help.

Monday 30 November 2020

An item with the same key has already been added Sitecore EXM

If you are using Sitecore EXM campaign on Form submit button, then you may be facing below issue on UI screen as 

Send Email Failed...


and if you will see Sitecore EXM log will get that error information as

an item with the same key has already been added


Message: an item with the same key has already been added.


To overcome with this issue, would suggest to go back on the Form Builder and ensure that all form Fields name are unique, and if not then please update will started working.

Hope above tips will help to resolve this issue.

Thursday 26 November 2020

The date range is invalid. Please select a date range that is within the range of the list Sitecore Forms

 From last few days working on Sitecore forms and come up with common issue while development.
And to save developers time sharing fixes/work around as much I can:


You may be getting error as 


The date range is invalid. Please select a date range that is within the range of the list.

while trying to generate Sitecore form report, even you have selected right date range or as complete list.


The reason here is because Form must have at least one record, if Fresh form has been created and without any records generating report then will get this issue.


Hope this minor check will help you.

Sunday 11 October 2020

You cannot have a sparse serialized tree. You may need to serialize this item's parents: Unicorn Sitecore Issue



If you are using unicorn with your Sitecore solution, and trying to install any module or any sitecore package. Then there may be some chances to get below error as 


"You cannot have a sparse serialized tree. You may need to serialize this item's parents"


If yes, then just disable configuration file as Unicorn.DataProvider.config which you can get inside App_Config directory.


now install module/package. And once installation done please must follow below best practices



1. once installation done, enable Unicorn.DataProvider.config again

2. If using unicorn for Sitecore item sync, then avoid to install sitecore packages.




Please comment, if issue still persist.

Tuesday 8 September 2020

Avoid IISRESET command, restart only relevant APP with SINGLE command

Hope you all doing great, 

I believe we all are using IISRESET after local/staging environment publish activity which earlier mentioned that to avoid IISRESET but I was also not following.



Major concern not to use IISRESET because it restart all the hosted applications on IIS, which should not happen.

Think about a scenario where 5 teams are using same development environment for different application.


To know more in deep - why to Avoid IISRESET?


In this article come up with the solution with single line command to avoid IISRESET. Hope this will save time to everyone.

First i will suggest to make below path globally accessible and this is one time activity

right click on This PC and select properties

From the left side click on Advanced System Settings

Click on Environment Variables and then from System variables section select Path as below 

then click on New and add below path

C:\Windows\System32\inetsrv 


now press OK OK OK


Now let's run one line command as mentioned steps, Please follow


  • press win + R
  • now paste below command (replace YourSitecoreName with your application name)

"C:\Windows\System32\cmd.exe" /c appcmd.exe  stop site /site.name:"YourSiteName" && appcmd.exe  start site /site.name:"YourSiteName"


  • Now press CTRL+SHIFT+ENTER (used to run command as admin)

once it works successfully, in future just run command as above steps only with single line command.


Hope this will and help and save time.
Please comment, if find any better approach.