0
votes

After installing the spartacus with SAP CC 2011 backend, when I have tried to open asm with URL

https://localhost:4200/powertools-spa/en/USD/?asm=true

and then login as asagent for a b2b customer ()

the request for the cart has user as 'undefined' in the url

Request URL: https://localhost:9002/occ/v2/powertools-spa/users/undefined/carts?fields=carts(DEFAULT,potentialProductPromotions,appliedProductPromotions,potentialOrderPromotions,appliedOrderPromotions,entries(totalPrice(formattedValue),product(images(FULL),stock(FULL)),basePrice(formattedValue,value),updateable),totalPrice(formattedValue),totalItems,totalPriceWithTax(formattedValue),totalDiscounts(value,formattedValue),subTotal(formattedValue),deliveryItemsQuantity,deliveryCost(formattedValue),totalTax(formattedValue,%20value),pickupItemsQuantity,net,appliedVouchers,productDiscounts(formattedValue),saveTime,user,name)&lang=en&curr=USD

And the following error is displayed in the hybris logs

ERROR [hybrisHTTP26] [RestHandlerExceptionResolver] de.hybris.platform.servicelayer.exceptions.UnknownIdentifierException: Cannot find user with propertyValue 'undefined'

Is there anything I am missing as part of setup? And why do the users are going as undefined?

1

1 Answers

0
votes

Update: issue was caused by a user which didn't had customerId set. Spartacus issue to follow this bug: https://github.com/SAP/spartacus/issues/10244


I tested the scenario you mentioned with basic spartacus (no customization) and the userId was never set to value of undefined and all requests to API contained correct userId.

Do you have any customizations on top of spartacus? In this case that we be mostly related either to auth services or to the ActiveCartService.