cancel
Showing results for 
Search instead for 
Did you mean: 

Startup of SAP Commerce fails with error: typePK or Code was NULL in getPersistenceInfoInternal()

First few errors in console looks like this

[DBPersistenceManager] typePK or Code was NULL in getPersistenceInfoInternal()


As a result server not started. There is no other additional info which help to identify issue.
We faced with it at our SAP Commerce Cloud Dev environment, where we have to builds A(20210826.1) and B(20210827.1). Fails happense during update from A to B, after type system update internals not restarted with some exception. Two builds are totally fine to init system and everything works correctly. Looks like really some kind of bug during system update process, which cause that you will not be able to startup you hybris server.

I check what changes do we have in items.xml and there is nothing too fancy:
-add/remove some relations
-add/remove some product subtypes
-add/remove some attributes
-move some attributes from remove product subtypes to parent type

Can some body help with it?

0 Kudos

dorothee.wiethoff I saw you had similar issue with your type system.

https://answers.sap.com/questions/13229779/sap-commerce-startup-fails-with-error-typepk-or-co.html How did you identify missing attribute descriptor in your case?

View Entire Topic
0 Kudos

I believe solution is to identify wrong attribute descriptors and delete them(from simplified example which you can reproduce it's 'someAttributeWithVeryVeryLongName', 'someAttributeWithVeryVeryLongNameProduct').

In my case it was safe to delete types and all there attribute descriptors.
So I execute locally SQL script bellow and was able to start server and run hybris update successfully.

// cleanup TYPESYSTEMPROPS
delete from TYPESYSTEMPROPS where ITEMPK in (
    select pk from ATTRIBUTEDESCRIPTORS where ENCLOSINGTYPEPK in (
        select pk from COMPOSEDTYPES where INTERNALCODE in ('CustomOldProduct', 'CustomNewProduct', 'CustomOldProduct2SomeTypeRelation')
    )
    union
    select pk from COMPOSEDTYPES where INTERNALCODE in ('CustomOldProduct', 'CustomNewProduct', 'CustomOldProduct2SomeTypeRelation')
);

// cleanup COMPOSEDTYPES
delete from COMPOSEDTYPES where INTERNALCODE in ('CustomOldProduct', 'CustomNewProduct', 'CustomOldProduct2SomeTypeRelation');

// cleanup COLLECTIONTYPES
delete from COLLECTIONTYPES  where  INTERNALCODE like 'CustomOldProduct2SomeTypeRelation%';

// remove attributedescriptors for not existed types
delete from ATTRIBUTEDESCRIPTORS where pk in (
    select pk from ATTRIBUTEDESCRIPTORS where EnclosingTypePK not in (select PK from COMPOSEDTYPES)
);

// cleanup localization tables
delete from ATTRIBUTEDESCRIPTORSLP where itempk not in (select pk from ATTRIBUTEDESCRIPTORS);
delete from COLLECTIONTYPESLP where itempk not in (select pk from COLLECTIONTYPES);
delete from COMPOSEDTYPESLP where itempk not in (select pk from COMPOSEDTYPES);

// remove deployments of deleted COMPOSEDTYPES (for relation CustomOldProduct2SomeTypeRelation typecode="14000")
delete from ydeployments where TYPECODE in (14000)
0 Kudos

By the way your table names can be different if you did rolling updates, which is for sure case in Cloud environment(example

attributedescriptors9c).

Find correct table using queries like:

select * from YDEPLOYMENTS where NAME = 'AttributeDescriptor' order by TYPESYSTEMNAME desc

Probably first will be yours, but I don't know which type system is active in your system.