Showing posts with label SITECORE. Show all posts
Showing posts with label SITECORE. Show all posts

Tuesday 1 June 2021

Install-SitecoreConfiguration : Missing required parameter: name

This may be one issue at the time of Sitecore instance setup and to resolve this issue, please follow below steps

Open and update files for 

  • sitecore-XP0.json
  • xconnect-xp0.json


and once opened file, search "Arguments": { "Name" 

If found then replace with "Arguments": { "name" and save.


Now execute installation script again, hope this will help.

Tuesday 25 May 2021

Install-SitecoreConfiguration : Cannot retrieve the dynamic parameters for the cmdlet. Unrecognized escape sequence

 If facing below issue at the time of Sitecore instance setup


Install-SitecoreConfiguration : Cannot retrieve the dynamic parameters for the cmdlet. Unrecognized escape sequence.


Then would suggest to update files for

xconnect-xp0.json

sitecore-XP0.json

scinstall.ps1 (in your case, installation script file name may be different)


by searching '\' in above files and replace with "\\" in file path

for example: 

earlier setting was 

$PSScriptRoot\Sitecore 9.0.2 rev. 180604 (OnPrem)_single.scwdp.zip

and replaced with 

$PSScriptRoot\\Sitecore 9.0.2 rev. 180604 (OnPrem)_single.scwdp.zip


and once all settings updated in script, then execute again.


Hope this will help.


Wednesday 12 May 2021

How to remove all data from Sitecore Solr index ?

Challenge:

Few days back, was working on sitecore solr search related issue that 


From solr portal, was able to retrieve data from index even deleted items (solr index caching issue).

But in the code getting null value for item's properties.


Tried many alternatives to resolve issue (IISRESET, config review, code debug, index rebuild), but no luck.


Approach to fix above issue:

After removing all data from solr index, and then index rebuild issue was resolved.




Steps:

1. From browser open hosted solr portal

2. choose index

3. go to document tab


or copy below URL and hit

1. https://localhost:8987/solr/your_index_name/documents


after this


choose Document Type as Solr command (raw xml or JSON)

then paste query

<delete><query>*:*</query></delete>

and Submit document.

Wednesday 5 May 2021

How to get license details for a Sitecore instance using Sitecore PowerShell script ?

Since I was trying to get license details for a Sitecore instance, so thought to share with all.


below are ways to get Sitecore license details using Sitecore PowerShell script as

$licensePath = [Sitecore.Configuration.Settings]::LicenseFile
[xml]$licenseDocument = Get-Content -Path $licensePath
$licenseDocument.signedlicense.Signature.Object.license |Format-Table -AutoSize



Tuesday 4 May 2021

How to read list data from file, using Sitecore PowerShell script

Challenge:

There were scenario, where I was trying to get list of strings from text file and tried as below

[string[]]$ItemIdList = Get-Content -Path 'D:\ItemIds.txt'

but getting issue as file not found.


Approach to resolve:


With below lines of script, trying to first upload at temp/upload path (it will create directories if not exist).

And then reading list of strings from text file.

$dataFolder = [Sitecore.Configuration.Settings]::DataFolder
$tempFolder = $dataFolder + "\temp\upload"
$filePath = Receive-File -Path $tempFolder -overwrite'
[string[]]$ItemIdList = Get-Content -Path $filePath

Friday 23 April 2021

How to get list of items with linked items using Sitecore PowerShell script ?

I was trying to get list of items with directly linked items using PowerShell script.
Since from Sitecore content editor at a time can see linked items only for individual items, so thought to share with all.

Below is the script hope, this will help

    
$allImages = Get - ChildItem - Path 'master:/sitecore/media library/Images' - recurse
$results = @();
$allImages | ForEach - Object {
    $sproperties = @{
        SID = $_.ID
    }

    $referer = Get - ItemReferrer - ID  $sproperties.SID
    $properties = @{
        Name = $_.Name
       ID = $_.ID
       Path = $_.ItemPath
       LinkedItemIds = $referer.ID
    }
    $results += New - Object psobject - Property $properties
}

$results | Select - Object - Property Name, Path, LinkedItemIds

Wednesday 10 March 2021

Sorry, there was an error : unauthorized_client Sitecore

Issue

Sometimes, after fresh instance setup maybe getting error on the login screen


sitecore-login-issue


Fix

1. go to C:\inetpub\wwwroot\<identityServer Instance Name>\Config\production\Sitecore.IdentityServer.Host.xml

2. update AllowedCorsOriginsGroupN values from http to https

3. AppPool recycle



Now check, hope this will work.

Tuesday 9 March 2021

Sitecore Forms are not displaying Issue

Problem

While working with Sitecore forms  9.x version, We usually face issue that sometime Forms not display.
To resolve this issue we generally do index rebuild. Even after this form still not displaying.


Root cause

        Generally this issue occurs because of indexAllFields set as False. 


Fix

Please click here to download patch config and add at your path ~/App_Config/Include/zzz


Note: This fix will work for any of azure/solr/lucene search providers.

Hope this works.

Monday 8 March 2021

Sitecore dictionary item not getting phrase value intermittent issue

While working with Sitecore dictionary items, there are scenarios where not getting phrase value for dictionary items. And this issue intermittent(occasional type) not always facing this issue.

After spending time to find root cause of this issue - found that it's because of Dictionary Caching Issue.

And to resolve issue, there are several ways - can choose as per your fit.



1. Solve this issue by doing Global Change - Reset Dictionary Cache at application level

Please put below line of code in your application startup file

Sitecore.Globalization.Translate.ResetCache(true)


2. Solve this issue by Manual Steps - Reset Dictionary Cache

  • Shut down your app pool
  • Remove dictionary.dat from webroot/temp/ folder
  • Start your app pool again

3. Solve this issue by inserting custom pipeline - On Publish event reset dictionary cache.

update below config in Sitecore.config directly or add as new patch config inside (~/App_config/Include)

<event name="publish:end">

<handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">

<sites hint="list">

<site>website</site>

</sites>

</handler>

<handler type="CustomNamespacePath, Customdll" method="CustomMethodName"/>

</event>


<event name="publish:end:remote">

<handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">

<sites hint="list">

<site>website</site>

</sites>

</handler>

<handler type="CustomNamespacePath, Customdll" method="CustomMethodName"/>

</event>


After above config change, write logic to reset dictionary cache in your custom class  which will mention in above config file.




Hope this will help, please share your thoughts - incase of any better approach/feedback.

Thursday 18 February 2021

How to view Sitecore content delivery showconfig.aspx

All Sitecore configuration get compiled and consolidate in showconfig.aspx file. And this config is the best way to verify default or custom configuration using

https://sc101.cm/sitecore/admin/showconfig.aspx

But recently we were facing configuration issue on CD server since there were no default way to verify showconfig.aspx on content delivery server.


Just to hack this and look showconfig.aspx for content delivery server please follow below steps:


1. Download config click here and save to your instance path wwwroot/sc101.cd

2. From Talend API Tester/Postman, put below input to get output(CD server showconfig.aspx as response) as below screenshot


sitecore-content-delivery-showconfig





Method Type: GET

URL: https://YourInstanceName/sitecorecontentdeliveryshowconfig.aspx

Header keys apikey: 464799ae52214c80b7fc81408f8efbe0




Now check your output. Hope this help.

Wednesday 17 February 2021

How to create sitecore custom index ?

With Sitecore, If there are lots of data on the instance where search needed, then Sitecore default index will not be good because it will be time and memory consuming.

In that case - creating custom index will be better approach which contains only searched items.


Let's start with creating solr custom index


Go to your solr installed location by copying sitecore_web_index and rename with sitecore_custom_index [<instancename>_web_index - so don't confused with sitecore]



once copied, then open core.properties and update name property under this directory as below screenshot



after above changes, restart solr service.

Now go to path \App_Config\Sitecore\ContentSearch and copy Sitecore.ContentSearch.Solr.Index.Web.config and rename with Sitecore.ContentSearch.Solr.Index.Custom.onfig as below


once file created open update settings for 
indexname, rootpath, which items wanted to include and exclude in index. as below



Let me know if feel any issue or feedback.

Tuesday 16 February 2021

Could not find add method: AddPrefetch (type: System.String)

 Issue:

After the initial unicorn setup with Sitecore instance, there may be a chance to get below issue

Could not find add method: AddPrefetch (type: System.String)

and there is no more information into log files. 



Fix:
To resolve this issue, 
ensure ranbow.*.dll, unicorn.*.dll, configy.dll and Kamsar.WebConsole.dll properly deployed in wwwroot/instancename/bin directory.

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.