Skip to main content

ERROR: DoCommand Failed:Invalid or missing value for property 'Domain'

 Hello Folks,

Its Sunday evening and i am in my balcony planning to publish few blogs (which are in my drafts from long time) before this Sunday is over :) So today i wanted to share quick info on one of the issue we were running into while creating a user on commerce side 

Scenario

So, Here is a thing, we were implementing custom domains for our client for their multi site tenant setup, so they have one instance for US, one for Canada likewise and they wanted a user creation to be in that domain 

Now our storefronts already had proper domain mapped on sitecore side like following 

  

But as soon as we were trying to create a user from storefront using OOTB registration component, it was giving below exception 

972 01:47:16 ERROR DoCommand Failed:Invalid or missing value for property 'Domain'.

972 01:47:16 INFO  AUDIT (DemoUS\Anonymous): Add user to role: DemoUS\Extranet User, user: DemoUS\test1@test.com

972 01:47:16 ERROR Invalid or missing value for property 'Domain'.

972 01:47:16 ERROR User created but external Id was not provided.

 

Now looking at the exception it was time to look into commerce side as we have seen before that while creating a customer it needs a domain, now because for a custom domain, existing OOTB json files of domains will not have that domain and because of that, from sitecore when code run it tries to find that domain which is used while creating a user and it is not able to find it, so simple solution to this is to add that domain to existing list of domains which are available in commerce.

 

Solution

Now on authoring environment you will find different environment configuration file, in our case we already had our custom environment bootstrapped, so it was referring to our custom environment files, Click Here to read how to create custom environments

 

So What is needed is to open respective environment files json files and add our specific domains there, like below 


1) Go to \CommerceAuthoring_local.ce\wwwroot\data\Environments on your respective roles (i am taking example of authoring here)

2) Find "domain" in the file and add your custom domain, like following 

 

 

3) Now make sure to run bootstrap to allow changes to be applied and now make sure that you are able to see this domain on customer object while you are creating a customer on commerce side like following 

 

 

 

 

And you should be good to go, next time you create a user it should also create a customer too with that custom domain :) 

 

TIP: This is only applicable if you are using SXA and commerce flow, if you are using commerce in headless environment, you will get the same exception but solution is totally different for that, Read Here the solution written by one of my colleague "Aakash Savalagi" for it 

 

Happy Sunday and good night. 

 

 

 

Comments

Popular posts from this blog

Why SitecoreAI - Getting into the shoes of the customer how to select right CMS

Hi Team, Lately, I have been talking to lot of our customers / potential customers and having pre-sales demos where one question always comes is "Why Sitecore" ?  Now this question can be for any product which is out for sell. And as a technician I always get into product technical features, but at the same time as a pre-sales guy, it also makes me think, surely all competitive products have same features, so definitely answer to this is not in the technicalities.  If you step back and think, we are also a customer in our daily life and buy lot of things, what is that process we go through? When we buy, how can your customer decide if this is a right fit for you or not, why we select A over B? Is it price? is it service? Is it a brand? Is it about features? Is it about brand loyalty?  When it is a technical product, I am sure it cannot start with the technicalities of the product or selecting product itself, 100% not, I feel decision is always business strategy first and ...

Hell of sitecore aliases pipeline breaking the site with 500 error

Hello Friends, I belive this blog post is very important for everyone because, It has some very serious effect on working of your headless website, i will share my experience what we faced and how we resolved it Issue we started facing Our site started giving "Key cannot be null or empty" with YSOD like following  Side affect Because of this 500 error, Our site pages were showing 500 custom error page intermittently and our MAU (Monthly Active User) drop rate increased. Sitecore KB There is already Sitecore KB article talking about this error but the patch which is provided on this link is confusing as well as very huge and it could bring other issues along with it as that upgrade patch also has lot of other things too which i did not want to introduce in our stable CMS. Known Issues - Retrieving the child items of resource items is not thread-safe Observation Though the surfaced exception was looking similar and giving same error and behavior given on this article, We looked...

Zero to Hero - A real life RCA of exact issue in Sitecore Managed Cloud environment

Hello All, The purpose of today's post is to share a real life burning and escalated scenario which was new to me and how did I approach it and how big the escalations were and what was the outcome Sitecore's goodwill was at stack not because Sitecore is not capable of handling it but just because our environment was Sitecore Managed Cloud, and any issue that comes if its infra, back end code, front end code will be first pointed as Sitecore issue and that is where our consultancy and experience will play a role to prove that it is not Sitecore issue.  Issue we faced Out of the blue our site started giving "504 Gateway Time-out", and it was reported that almost everyone is getting this error, but when we used to browse the site, everything looked good and never 504. 504 Gateway Time-out error tells that, That the request went to Content Delivery servers of Sitecore from gateway, but gateway did not get response in time from those CDs and hence it gave time out error. ...