cancel
Showing results for 
Search instead for 
Did you mean: 

Exception: "Cannot read property" although attribute deleted in items.xml

1,298

Hello, we had an own attribute CronJob#exportLevel . Since it was not needed anymore, we removed it from items.xml

The problem is, that we get an Exception on one of our systems when running a Cronjob now (see the attached file exception.txt to see the full stack trace):

 INFO   | jvm 1    | main    | 2019/07/25 14:48:53.892 | ERROR [TaskExecutor-master-8066-Task [8800222020534]] [PropertyJDBC] error reading property field 'exportLevel'/'p_exportlevel' of item '8800287359477'/'8800287359477'  (info was [exportLevel,p_exportlevel,class de.hybris.platform.util.ItemPropertyValue] ) 
 INFO   | jvm 1    | main    | 2019/07/25 14:48:53.892 |  stack: 
 INFO   | jvm 1    | main    | 2019/07/25 14:48:53.892 | ERROR [TaskExecutor-master-8066-Task [8800222020534]] [DefaultTaskService] Failed to execute task 8800222020534(hjmpTS:0).
 INFO   | jvm 1    | main    | 2019/07/25 14:48:53.892 |  de.hybris.platform.servicelayer.exceptions.SystemException: de.hybris.platform.persistence.hjmp.HJMPException: java.sql.SQLException: Invalid column name
 INFO   | jvm 1    | main    | 2019/07/25 14:48:53.892 | 


So we thought we should remove the corresponding AttributeDescriptorin order to solve the problem. But

 SELECT * FROM attributedescriptors WHERE lower(QualifierInternal) ='exportlevel'

returns an empty result. So the attribute does not exist, but is still defined in some hybris table... Which tables could we also check to find the attribute declaration?

In the exception, de.hybris.platform.cache.AbstractCacheUnit.get(AbstractCacheUnit.java:180) is called. So maybe we should empty some hybris cache to fix the problem? But resetting the HAC > Monitoring > Cache did not help. Do you have some idea what can we also check to understand the problem?

Thanks in advance!

Sven

rohit31_raj92
Active Participant
0 Kudos

When we remove attribute from items.xml, the attribute still remains in db so you may need to remove it . you can try removing orphaned attributes from hac .If still issue then please delete the attribute from table via sql commands etc.

you can also try remove attribute from hmc /backoffice .

0 Kudos

Thanks for your answer but it was incomplete. Where can we delete the attribute in the backoffice? We don't see it under System > Types > type "CronJob" > Properties.

If we want to remove the attribute from the DB using SQL, which in tables should we search for it? It is not declared in the table "attributedescriptors".

Did you read the exception?

Thanks in advance.

rohit31_raj92
Active Participant
0 Kudos

You mentioned you have attribute CronJob#exportLevel so you know in which tables you will search for. or that is not correct information. Yes table is required to search for attribute and remove it. Basically issue is that your attribute is deleted from items.xml but still persist in DB.

Note : I hope after removing attribute from items.xml you have done blank system update.

pavan_joshi1
Participant
0 Kudos

As said above, if you run update after removing from items.xml, what I feel is there might be a cluster sync issue which might result in this. This should improve in some time, once cluster sync is fine.
Else you can restart the nodes once, worst case, if it is this case.

Accepted Solutions (1)

Accepted Solutions (1)

former_member620692
Active Contributor
0 Kudos

There is a mistake (probably a typo) in the following query:

 SELECT * FROM attributedescriptors WHERE lower(QualifierInternal) ='exportlevel'

It should be:

 SELECT * FROM attributedescriptors WHERE lower(QualifierInternal) ='p_exportlevel'

Also, please make sure to perform ant clean all updatesystem after deleting the corresponding record from the database.

Caution: Please take a backup of the database before perfory manipulation directly on it.

Answers (2)

Answers (2)

rohit31_raj92
Active Participant
0 Kudos

Hi

Please go through the link mentioned below for more information for Proper way to remove columns :

*https://answers.sap.com/questions/12748493/view.html*

You mentioned you have attribute CronJob#exportLevel so you know in which tables(LFullExportCronJob) you will search for. or that is not correct information. Yes table is required to search for attribute and remove it. Basically issue is that your attribute is deleted from items.xml but still persist in DB.

Note : I hope after removing attribute from items.xml you have done blank system update.

Try below code for removing :

REMOVE AttributeDescriptor;qualifier[unique=true];enclosingType(code)[unique=true]

; exportLevel; LFullExportCronJob

Clean All Orphaned Types

   1.Open the hybris Administration   Console.
   2.Go to the Maintenance tab and select Cleanup option.
   3.The Cleanup page in the Type system tab displays.
   4.Ensure both check boxes are selected and click the Clear all   orphaned types button.
   5.Orphaned types are removed

Please let me know if this helps you or you need more details or way to help you.

rohit31_raj92
Active Participant

Did it helps? Please let me know if not

0 Kudos

thanks, it helped

jseidl
Explorer
0 Kudos

"cleanup" via HAC only solved the issue for the node where the cleanup was executed.

In our case I had to do a system-update via HAC with just option "update running system" enabled. This prevented having to restart all 5 cluster nodes in order for the drop to take effect.

Just for reference: Before system-update we also got this JDBC error as mentioned in this question:

2020-05-15 09:52:42,948 ERROR hybrisHTTP25 [PropertyJDBC] - error reading property field 'xxxxxxx'/'p_xxxxxxx' of item '8796683010092'/'8796683010092'  (info was [xxxxxxx,p_xxxxxxx,class java.lang.Double] ) <br>

After system-update the error was gone (so obviously the relevant cache - probably the EJBPropertyRowCache in PropertyJDBC class) was cleared and so we didn't have to restart the server.

0 Kudos

Hi rohit31.raj92

when i'm running following impex, it is throwing me an error:

Impex:

REMOVE AttributeDescriptor;qualifier[unique=true];enclosingType(code)[unique=true]

; returnRequestPOS; RTOEntry

Error:
REMOVE AttributeDescriptor;qualifier[unique=true];enclosingType(code)[unique=true]

,,,,could not remove item 8797614800983 due to attribute descriptor RTOEntry.returnRequestPOS:java.lang.Integer is not removable.;returnRequestPOS;RTOEntry

I have tried all possible way out(deleted from backoffice, deleted direct from the Database), but I'm still getting error whenever I try to create RTOEntry.

Please help me out.

Thanks in advance!

rohan1607
Explorer
0 Kudos

Hi p_negi - did you find a way to remove the column information from attribute descriptor when the remove impex errors out with the error message that you posted? "could not remove item XYZ due to attribute descriptor ABC:java.lang.Integer is not removable."

0 Kudos

Hi, Do you know under which type the attribute has been added. That will be easy to delete, if you have code from items.xml, please provide so that it will be easy to confirm and will give you the steps to delete.

0 Kudos

Hello sri and thanks for the reply:

the attribute was defined this way:

     <enumtype code="LExportLevel">
         <value code="ITEM_LEVEL"/>
         <value code="VARIANT_LEVEL"/>
     </enumtype>

         <itemtype code="LFullExportCronJob" extends="CronJob" generate="true" autocreate="true">
             <attributes>
                 <attribute qualifier="exportLevel" type="LExportLevel">
                     <modifiers optional="false"/>
                     <persistence type="property"/>
                 </attribute>
             </attributes>
         </itemtype>

What would be the steps to completely remove it from the DB and fix the above error? Thanks in advance!

rohit31_raj92
Active Participant
0 Kudos

You can remove it using SQL queries to remove the attribute exportLevel from table LFullExportCronJob .

You can get follow the link, which have lot of examples to remove columns and very good link to go through.

https://answers.sap.com/questions/12748493/view.html