SalesforceCommerceCloud / b2c-crm-sync

... a contemporary perspective on how to integrate B2C Commerce and the Salesforce Customer 360 Platform to power frictionless customer experiences in the B2C domain.
https://salesforcecommercecloud.github.io/b2c-crm-sync/
BSD 3-Clause "New" or "Revised" License
64 stars 47 forks source link

B2CContactProcess error when registering a new customer from commerce cloud site #106

Closed nek4life closed 1 year ago

nek4life commented 2 years ago

Describe the bug When a customer registers in commerce cloud the profile appears to be synced to service cloud, however the account ID and contact ID are not updated in commerce.

The account export is marked as failed and there is an error response logged

Thu, 27 Jan 2022 01:40:31 GMT: Status 400 (Bad Request): [{"actionName":"B2CContactProcess","errors":[{"statusCode":"UNKNOWN_EXCEPTION","message":"An error occurred when executing a flow interview.","fields":[]}],"isSuccess":false,"outputValues":null}]

To Reproduce Steps to reproduce the behavior:

  1. Register for an account on commerce cloud sandbox connected to service cloud sandbox
  2. View customer in business manager
  3. observe b2csync fields

Expected behavior Contact and Account IDs should be synced back to commerce Export should be marked as successful

Additional context Problem happens intermittently with test accounts. Have had a number of successes as well. Also can take a failed account and publish to service from commerce and obtain missing ID fields

Error may also happen on subsequent logins on an account that had failures previously

jbachelet commented 2 years ago

Hello, Thank you again for posting an issue here. Can you please provide any error log you received by email from the Salesforce Core org? Asking this because the error shown here seems to be related to a failed flow interview, which should send an email to the user who runs the flow (meaning the one used to authenticate with the core org from B2C Commerce).

Without this, it is not easy to debug here.

FYI, on our testing instances, the sync is working fine at all stages (profile creation, login, subsequent login, profile updates...)

nek4life commented 2 years ago

@ali-mushaf are you receiving emails for the user I'm currently authenticating with?

@jbachelet do you know if there are logs I could view anywhere regarding this flow while I'm trying to track down some emails?

I am also creating test users with emails that have a + in them. Not sure if it is related, but could be something to test on your end as well.

myemail+test1@somewhere.com as an example

nek4life commented 2 years ago

I'm seeing two separate error emails. The second error has more information, though contains sensitive details. I'll be reaching out on the SFCC Slack to discuss the best way to get the rest of the error information to you.

A platform event message couldn’t launch the "B2C Commerce: Platform Event: Process Contact Update" flow. Contact Salesforce Customer Support with Error ID 1913430003-552896 (-1644319935).

`Error Occurred: This error occurred when the flow tried to create records: DUPLICATE_VALUE: duplicate value found: B2C_Customer_ID__c duplicates value on record with id: 0037j00000hPzVf. You can look up ExceptionCode values in the SOAP API Developer Guide.

Salesforce Error ID: 1804361846-118824 (-1671455222)`

jbachelet commented 2 years ago

Okay so this issue is happening because of an issue with the Duplicate rule configured on your instance, and the data related to it. This breaks the flow triggered when B2C updates a profile into the Core platform.

In order to see the logs in Core, please refer to this documentation: https://help.salesforce.com/s/articleView?id=sf.code_viewing_log_details.htm&language=en_US&r=https%3A%2F%2Fwww.google.com%2F&type=5. Please note that this might not be directly related to the framework itself, but more related to how you configured the duplicate rule, which is a standard Salesforce feature.

nek4life commented 2 years ago

@jbachelet as far as I know the only non-standard rule we have setup in our org is the B2C connector rule. It is as follows. I can followed the instructions and reviewed the related issue in the docs and ensured the order is correct

Screen Shot 2022-01-27 at 10 55 13 AM

jbachelet commented 1 year ago

Hello,

This has been fixed in #212 and released in v2.0.0.

Thanks