Skip to Content
0
Aug 09, 2023 at 10:51 AM

Not able to import data in CategoryProductRelation and category after SAP commerce upgrade 2205

210 Views Last edit Aug 09, 2023 at 01:45 PM 2 rev

Hi All,

We need to update CategoryProductRelation and category tables on daily basis in production.But when we try to import data,it is failing with below error. and below is the impex i used to import data into category and CategoryProductRelation .

IMPEX:

$productRef=code,catalogVersion(catalog(id[default='TestProductCatalog']),version[default='Staged'])

$categoryRef=code,catalogVersion(catalog(id[default='TestProductCatalog']),version[default='Staged'])

INSERT_UPDATE CategoryProductRelation;source($categoryRef)[unique=true];target($productRef)[unique=true]

;testCat;testProduct

Error:

INSERT_UPDATE CategoryProductRelation;source(code,catalogVersion(catalog(id[default='TestProductCatalog']),version[default='Staged']))[unique=true];target(code,catalogVersion(catalog(id[default='TestProductCatalog']),version[default='Staged']))[unique=true];sequenceNumber

,,,,Exception : line 5: cannot create CategoryProductRelation with values ItemAttributeMap[ registry: null, type: <null>, data: {source=8797208281230, sequencenumber=1, target=8796668919809} ] due to [de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator@3022ba2b]:missing values for [source, target] in model LinkModel (<unsaved>) to create a new CategoryProductRelation, Exception : line 3: cannot create CategoryProductRelation with values ItemAttributeMap[ registry: null, type: <null>, data: {sequencenumber=1, source=8797208281230, target=8796668919809} ] due to [de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator@3022ba2b]:missing values for [source, target] in model LinkModel (<unsaved>) to create a new CategoryProductRelation;testCat;testProduct

And the given Source and target are existing in the system.Not sure why ia m getting MandatoryAttributesValidator issue.

Category Impex:

$productCatalog=TestProductCatalog

$catalogVersion=catalogversion(catalog(id[default=$productCatalog]),version[default='Staged'])[unique=true,default=$productCatalog:Staged]

INSERT_UPDATE Category;$catalogVersion[unique=true];code[unique=true]

;;test

Error:

INSERT_UPDATE Category;catalogversion(catalog(id[default=TestProductCatalog]),version[default='Staged'])[unique=true,default=TestProductCatalog:Staged][unique=true];code[unique=true]

,,,,Exception : line 9: cannot create Category with values ItemAttributeMap[ registry: null, type: <null>, data: {code=test, catalogversion=TestProductCatalog/Staged(8796125823577)} ] due to [de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator@3022ba2b]:missing values for [catalogVersion] in model CategoryModel (<unsaved>) to create a new Category, Exception : line 3: cannot create Category with values ItemAttributeMap[ registry: null, type: <null>, data: {code=test, catalogversion=SpainProductCatalog/Staged(8796125823577)} ] due to [de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator@3022ba2b]:missing values for [catalogVersion] in model CategoryModel (<unsaved>) to create a new Category;;test

I am just trying to create a simple test category but it is throwing missing mandatory attribute 'Catalog version' issue which is there in the impex.

I am able to create category from backoffice.But not sure why it is throwing error when I try to create with Impex.

Can someone please help here?

Thanks,

Sharada