Errors when trying to setup second instance of Sitecore Commerce Habitat site using Solr in same machine but different set of website ports
When a second instance of Sitecore Commerce with Habitat is setup (in totally different set of ports) in the same machine, the following errors start popping up...
Error - 1:
Happens in the first instance, after installing second instance of commerce in a totally different set of ports. If this is not related to multiple Sitecore Commerce Habitat Instance; the db index returns a null value. Check if Solr Service is running. If Solr is not running, start it, also reset IIS and try searching. If Solr is already running, restart Solr service and try searching. If it doesn't work, try rebuilding the concerned index that the website points to. For instance, if your storefront points to Master DB, go to Indexing manager and rebuild just the master db index.
Server Error in '/' Application.
Value cannot be null.
Description: An unhandled exception occurred.
Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: sitecoreSearchResults
Source Error:
Stack Trace:
Error - 2: Happens when a second instance of storefront is setup in totally different set of ports. As soon as the second instance is setup, the first instance throws errors. This error is thrown while trying to rebuild link databases.
Job started: RebuildLinkDatabasesIndex|System.NullReferenceException: Object reference not set to an instance of an object.
at Sitecore.Commerce.Engine.Connect.DataProvider.ReadOnlyCatalogDataProvider.GetChildIDs(ItemDefinition parentItem, CallContext context)
at Sitecore.Data.DataProviders.DataProvider.GetChildIDs(ItemDefinition item, CallContext context, DataProviderCollection providers)
at Sitecore.Data.DataSource.GetChildIDs(ID itemID)
at Sitecore.Nexus.Data.DataCommands.GetChildrenCommand.(Item )
at Sitecore.Nexus.Data.DataCommands.GetChildrenCommand.(Item )
at Sitecore.Data.Engines.EngineCommand`2.Execute()
at Sitecore.Data.Managers.ItemProvider.GetChildren(Item item, ChildListOptions options)
at Sitecore.Data.Managers.ItemProvider.GetChildren(Item item, SecurityCheck securityCheck, ChildListOptions options)
at Sitecore.Data.Items.Item.GetChildren(ChildListOptions options)
at Sitecore.Links.LinkDatabase.RebuildItem(Item item)
at Sitecore.Links.LinkDatabase.RebuildItem(Item item)
at Sitecore.Links.LinkDatabase.RebuildItem(Item item)
at Sitecore.Links.LinkDatabase.RebuildItem(Item item)
at Sitecore.Links.LinkDatabase.RebuildItem(Item item)
at Sitecore.Links.LinkDatabase.RebuildItem(Item item)
at Sitecore.Links.LinkDatabase.RebuildItem(Item item)
at Sitecore.Links.LinkDatabase.RebuildItem(Item item)
at Sitecore.Links.LinkDatabase.Rebuild(Database database)
at Sitecore.Shell.Applications.Dialogs.RebuildLinkDatabase.RebuildLinkDatabaseForm.Builder.Build()|Job ended: RebuildLinkDatabasesIndex (units processed: 1)
Reason: The possible cause is catalog node is missing child items (in one of the DBs and it mostly is the db that the first instance's Storefront was pointing to). On further analysis, could find that Template Overrides was missing actual items specified in this blog - https://andrewsutherland.azurewebsites.net/2020/03/20/sitecore-experience-commerce-resolving-site-catalog-association-lock/. Although the template overrides were corrected, the error affected other parts of the habitat content tree. Maybe try an IIS reset because that made the error go but wasn't permanent. Would comeback if switching over to the second instance and search for products.
Error - 3: Happens when trying to setup a second instance of Sitecore Commerce. Try to load content editor after switching over to Web db and the error is thrown. Used razl to load the web instance to check how the content tree looks and can see a lot of items missing in web db -
Server Error in '/' Application.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Stack Trace:
razl:
If this is not related to multiple Storefront instances, then the issue is, a publish needs to be done so, perform a publish. Now, load the content tree for the web db and items should load fine without any errors -
Next, point Storefront (/sitecore/content/Sitecore/Storefront/Settings/Site Grouping/Storefront) Database to web db to check if habitat tree items load fine - sometimes has missing items. So, need to restore the same.
While still pointing to web db, try to search for a known product in the Storefront. The web db search should return blank results if the web index is not populated yet. Switch over to Indexing manager and just rebuild the web index -
After checking that search functionality is fine in the storefront, Ensure to point Storefront Database back to Master and publish.
Error - 4: Happens when creating a second instance of Sitecore Commerce habitat storefront (totally different ports) in the same machine.
Server Error in '/' Application.
Exception Details: System.InvalidOperationException: Default Control Panel Storefront
Source Error:
Stack Trace:
The combination that caused the above error is:
Database: Web
Cache Html checkbox under Flags section is unchecked
Disable Browser Caching drop down is set to Yes
Changed Database from Web to Master, left other settings as-is and published the change to see the error go.
Error - 1:
Happens in the first instance, after installing second instance of commerce in a totally different set of ports. If this is not related to multiple Sitecore Commerce Habitat Instance; the db index returns a null value. Check if Solr Service is running. If Solr is not running, start it, also reset IIS and try searching. If Solr is already running, restart Solr service and try searching. If it doesn't work, try rebuilding the concerned index that the website points to. For instance, if your storefront points to Master DB, go to Indexing manager and rebuild just the master db index.
Server Error in '/' Application.
Value cannot be null.
Parameter name: sitecoreSearchResults
Description: An unhandled exception occurred.Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: sitecoreSearchResults
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
|
Error - 2: Happens when a second instance of storefront is setup in totally different set of ports. As soon as the second instance is setup, the first instance throws errors. This error is thrown while trying to rebuild link databases.
Job started: RebuildLinkDatabasesIndex|System.NullReferenceException: Object reference not set to an instance of an object.
at Sitecore.Commerce.Engine.Connect.DataProvider.ReadOnlyCatalogDataProvider.GetChildIDs(ItemDefinition parentItem, CallContext context)
at Sitecore.Data.DataProviders.DataProvider.GetChildIDs(ItemDefinition item, CallContext context, DataProviderCollection providers)
at Sitecore.Data.DataSource.GetChildIDs(ID itemID)
at Sitecore.Nexus.Data.DataCommands.GetChildrenCommand.(Item )
at Sitecore.Nexus.Data.DataCommands.GetChildrenCommand.(Item )
at Sitecore.Data.Engines.EngineCommand`2.Execute()
at Sitecore.Data.Managers.ItemProvider.GetChildren(Item item, ChildListOptions options)
at Sitecore.Data.Managers.ItemProvider.GetChildren(Item item, SecurityCheck securityCheck, ChildListOptions options)
at Sitecore.Data.Items.Item.GetChildren(ChildListOptions options)
at Sitecore.Links.LinkDatabase.RebuildItem(Item item)
at Sitecore.Links.LinkDatabase.RebuildItem(Item item)
at Sitecore.Links.LinkDatabase.RebuildItem(Item item)
at Sitecore.Links.LinkDatabase.RebuildItem(Item item)
at Sitecore.Links.LinkDatabase.RebuildItem(Item item)
at Sitecore.Links.LinkDatabase.RebuildItem(Item item)
at Sitecore.Links.LinkDatabase.RebuildItem(Item item)
at Sitecore.Links.LinkDatabase.RebuildItem(Item item)
at Sitecore.Links.LinkDatabase.Rebuild(Database database)
at Sitecore.Shell.Applications.Dialogs.RebuildLinkDatabase.RebuildLinkDatabaseForm.Builder.Build()|Job ended: RebuildLinkDatabasesIndex (units processed: 1)
Reason: The possible cause is catalog node is missing child items (in one of the DBs and it mostly is the db that the first instance's Storefront was pointing to). On further analysis, could find that Template Overrides was missing actual items specified in this blog - https://andrewsutherland.azurewebsites.net/2020/03/20/sitecore-experience-commerce-resolving-site-catalog-association-lock/. Although the template overrides were corrected, the error affected other parts of the habitat content tree. Maybe try an IIS reset because that made the error go but wasn't permanent. Would comeback if switching over to the second instance and search for products.
Error - 3: Happens when trying to setup a second instance of Sitecore Commerce. Try to load content editor after switching over to Web db and the error is thrown. Used razl to load the web instance to check how the content tree looks and can see a lot of items missing in web db -
Server Error in '/' Application.
Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
|
razl:
If this is not related to multiple Storefront instances, then the issue is, a publish needs to be done so, perform a publish. Now, load the content tree for the web db and items should load fine without any errors -
Next, point Storefront (/sitecore/content/Sitecore/Storefront/Settings/Site Grouping/Storefront) Database to web db to check if habitat tree items load fine - sometimes has missing items. So, need to restore the same.
While still pointing to web db, try to search for a known product in the Storefront. The web db search should return blank results if the web index is not populated yet. Switch over to Indexing manager and just rebuild the web index -
After checking that search functionality is fine in the storefront, Ensure to point Storefront Database back to Master and publish.
Error - 4: Happens when creating a second instance of Sitecore Commerce habitat storefront (totally different ports) in the same machine.
Server Error in '/' Application.
Default Control Panel Storefront
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.InvalidOperationException: Default Control Panel Storefront
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
|
The combination that caused the above error is:
Database: Web
Cache Html checkbox under Flags section is unchecked
Disable Browser Caching drop down is set to Yes
Changed Database from Web to Master, left other settings as-is and published the change to see the error go.
Comments
Post a Comment