Failed to set value for profile property ‘email_address’.
ravikanth | June 15, 2010For past few days, the below exception has taken away my sleep. This error occurs in our pre-prod environment and it is totally unpredictable. You may get or may not get with the same data. Profile registration is first page to any ecommerce application and as it is failing here and as usual everyone swords are towards me for the fix.
|
An exception of type ‘Microsoft.CommerceServer.Runtime.Profiles.CommerceProfileSystemException’ occurred and was caught. ———————————————————————————————————————— |
Since the error is happening in translator, I suspect that I am passing wrong data to the commerce server. I verified that user_id (guid) and email address are sent from controller class. I google or binged but no luck.
Missile trigger happens at one place and damage at another place. This problem comes under same category. Everybody sees this as commerce server exception as below error found in event log with lot of “commerce” words. After lot of efforts, I found that the error is due to assigning to wrong GUID and email_ID. For example, consider following data.
| user_ID | email ID |
| Guid1 | user1@test.com |
| Guid2 | user2@test.com |
First I sign-in with user 1 and both user_id and email_id are stored in cookie. I press sign-out email_id is removed from cookie but not user_id. The second time, I logged in with user2 now this time, the user 2 email_id is keep in cookie but its GUID is not updated (as the old object already exist in the cookie). When I try to save user profile, I am passing GUID1 and user2@test.com to commerce server and it is throwing exception as the update operation tries to update row 1 with user2@test.com in email_id field (which is a unique key).