On 01/21/2014 03:38 PM, Jan Dobes wrote: > ----- Original Message ----- >> From: "Johannes Renner" <jren...@suse.de> >> To: spacewalk-devel@redhat.com >> Sent: Friday, January 17, 2014 12:30:09 PM >> Subject: [Spacewalk-devel] [PATCH] Allow null as createdBy and >> lastModifiedBy for custom data values >> >> Hello, >> >> I found another issue with the custom data values: It's a known and fixed bug >> (889633) >> that the indexing job will crash when initially *not* setting the >> lastModifiedBy column. >> This column can still get null whenever a creator or modifier is deleted >> since there is >> a ON DELETE SET NULL on these columns. We therefore have to allow null there, >> please see >> and apply my attached patch. >> >> This can also be problematic when there is values that were created before >> installing >> the fix for 889633. These will have null as lastModifiedBy as long as they >> have never >> been edited. Even after installing that fix, the old values will make the >> indexer crash. >> The attached patch will also fix such cases. >> >> Otherwise what we see is the same exception as with the above bug and no >> custom data >> values are being indexed: >> >> INFO | jvm 1 | 2014/01/16 08:47:51 | --- Cause: >> java.lang.RuntimeException: Error setting >> property 'setLastModifiedBy' of >> 'com.redhat.satellite.search.db.models.ServerCustomInfo@75807580'. >> Cause: java.lang.IllegalArgumentException] >> INFO | jvm 1 | 2014/01/16 08:47:51 | at >> com.redhat.satellite.search.scheduler.tasks.GenericIndexTask.execute(GenericIndexTask.java:91) >> >> Regards, >> Johannes >> >> -- >> SUSE LINUX Products GmbH, HRB 16746 (AG Nürnberg) >> GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer >> >> _______________________________________________ >> Spacewalk-devel mailing list >> Spacewalk-devel@redhat.com >> https://www.redhat.com/mailman/listinfo/spacewalk-devel > > Hello Johannes, > > I'm not sure how to reproduce this. I tried to create user, create custom > key, assign value to system, delete user, changing values... > Except some ISEs in WebUI, indexation works fine. > Even if tried to insert directly to db on clean PostgreSQL Spacewalk nightly: > > insert into rhnServerCustomDataValue values (1000010000, 6, 'qwerty', null, > null, current_timestamp, current_timestamp); -- with certain key and system, > both values null > > It properly indexed, after changing value too. I tested with searching by > Custom Info.
Hello, I can reproduce it using your insert statement (with existing server and key ids of course). This was with a previous version of our product, though, since this was currently the only server around not having that patch installed. I can imagine that in the meantime the issue has been fixed by a library update as well? I can see that ibatis has been updated (and the exception came from there, see my attachment for the complete stacktrace): - ibatis-2.3.0.677.jar -> mybatis-3.2.3.jar Note that in order to see that exception in the logs I had to set: log4j.logger.org.quartz=INFO,SearchAppender (/usr/share/rhn/search/classes/log4j.properties) If it has been fixed by a library update you don't have to commit the patch of course. Will try again to reproduce it tomorrow with a server running recent mybatis. Regards, Johannes -- SUSE LINUX Products GmbH, HRB 16746 (AG Nürnberg) GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
INFO | jvm 1 | 2014/01/21 17:53:58 | 2014-01-21 17:53:58,621 [QuartzScheduler_Worker-7] INFO org.quartz.core.JobRunShell - Job updateIndex.serverCustomInfo threw a JobExecutionException: INFO | jvm 1 | 2014/01/21 17:53:58 | org.quartz.JobExecutionException: com.ibatis.common.jdbc.exception.NestedSQLException: INFO | jvm 1 | 2014/01/21 17:53:58 | --- The error occurred in com/redhat/satellite/search/db/server_custom_info.xml. INFO | jvm 1 | 2014/01/21 17:53:58 | --- The error occurred while applying a result map. INFO | jvm 1 | 2014/01/21 17:53:58 | --- Check the getServerCustomInfoByIdOrDate-AutoResultMap. INFO | jvm 1 | 2014/01/21 17:53:58 | --- The error happened while setting a property on the result object. INFO | jvm 1 | 2014/01/21 17:53:58 | --- Cause: java.lang.RuntimeException: Error setting property 'setCreatedBy' of 'com.redhat.satellite.search.db.models.ServerCustomInfo@2a0d2a0d'. Cause: java.lang.IllegalArgumentException [See nested exception: com.ibatis.common.jdbc.exception.NestedSQLException: INFO | jvm 1 | 2014/01/21 17:53:58 | --- The error occurred in com/redhat/satellite/search/db/server_custom_info.xml. INFO | jvm 1 | 2014/01/21 17:53:58 | --- The error occurred while applying a result map. INFO | jvm 1 | 2014/01/21 17:53:58 | --- Check the getServerCustomInfoByIdOrDate-AutoResultMap. INFO | jvm 1 | 2014/01/21 17:53:58 | --- The error happened while setting a property on the result object. INFO | jvm 1 | 2014/01/21 17:53:58 | --- Cause: java.lang.RuntimeException: Error setting property 'setCreatedBy' of 'com.redhat.satellite.search.db.models.ServerCustomInfo@2a0d2a0d'. Cause: java.lang.IllegalArgumentException] INFO | jvm 1 | 2014/01/21 17:53:58 | at com.redhat.satellite.search.scheduler.tasks.GenericIndexTask.execute(GenericIndexTask.java:91) INFO | jvm 1 | 2014/01/21 17:53:58 | at org.quartz.core.JobRunShell.run(JobRunShell.java:216) INFO | jvm 1 | 2014/01/21 17:53:58 | at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549) INFO | jvm 1 | 2014/01/21 17:53:58 | Caused by: com.ibatis.common.jdbc.exception.NestedSQLException: INFO | jvm 1 | 2014/01/21 17:53:58 | --- The error occurred in com/redhat/satellite/search/db/server_custom_info.xml. INFO | jvm 1 | 2014/01/21 17:53:58 | --- The error occurred while applying a result map. INFO | jvm 1 | 2014/01/21 17:53:58 | --- Check the getServerCustomInfoByIdOrDate-AutoResultMap. INFO | jvm 1 | 2014/01/21 17:53:58 | --- The error happened while setting a property on the result object. INFO | jvm 1 | 2014/01/21 17:53:58 | --- Cause: java.lang.RuntimeException: Error setting property 'setCreatedBy' of 'com.redhat.satellite.search.db.models.ServerCustomInfo@2a0d2a0d'. Cause: java.lang.IllegalArgumentException INFO | jvm 1 | 2014/01/21 17:53:58 | at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:188) INFO | jvm 1 | 2014/01/21 17:53:58 | at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123) INFO | jvm 1 | 2014/01/21 17:53:58 | at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:615) INFO | jvm 1 | 2014/01/21 17:53:58 | at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:589) INFO | jvm 1 | 2014/01/21 17:53:58 | at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118) INFO | jvm 1 | 2014/01/21 17:53:58 | at com.redhat.satellite.search.db.Query.loadList(Query.java:66) INFO | jvm 1 | 2014/01/21 17:53:58 | at com.redhat.satellite.search.scheduler.tasks.GenericIndexTask.getRecords(GenericIndexTask.java:188) INFO | jvm 1 | 2014/01/21 17:53:58 | at com.redhat.satellite.search.scheduler.tasks.GenericIndexTask.execute(GenericIndexTask.java:67) INFO | jvm 1 | 2014/01/21 17:53:58 | ... 2 more INFO | jvm 1 | 2014/01/21 17:53:58 | Caused by: java.lang.RuntimeException: Error setting property 'setCreatedBy' of 'com.redhat.satellite.search.db.models.ServerCustomInfo@2a0d2a0d'. Cause: java.lang.IllegalArgumentException INFO | jvm 1 | 2014/01/21 17:53:58 | at com.ibatis.sqlmap.engine.accessplan.PropertyAccessPlan.setProperties(PropertyAccessPlan.java:52) INFO | jvm 1 | 2014/01/21 17:53:58 | at com.ibatis.sqlmap.engine.exchange.JavaBeanDataExchange.setData(JavaBeanDataExchange.java:112) INFO | jvm 1 | 2014/01/21 17:53:58 | at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.setResultObjectValues(BasicResultMap.java:373) INFO | jvm 1 | 2014/01/21 17:53:58 | at com.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback.handleResultObject(RowHandlerCallback.java:64) INFO | jvm 1 | 2014/01/21 17:53:58 | at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:382) INFO | jvm 1 | 2014/01/21 17:53:58 | at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(SqlExecutor.java:301) INFO | jvm 1 | 2014/01/21 17:53:58 | at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:190) INFO | jvm 1 | 2014/01/21 17:53:58 | at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205) INFO | jvm 1 | 2014/01/21 17:53:58 | at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173) INFO | jvm 1 | 2014/01/21 17:53:58 | ... 9 more INFO | jvm 1 | 2014/01/21 17:53:58 | Caused by: java.lang.IllegalArgumentException INFO | jvm 1 | 2014/01/21 17:53:58 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) INFO | jvm 1 | 2014/01/21 17:53:58 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) INFO | jvm 1 | 2014/01/21 17:53:58 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) INFO | jvm 1 | 2014/01/21 17:53:58 | at java.lang.reflect.Method.invoke(Method.java:611) INFO | jvm 1 | 2014/01/21 17:53:58 | at com.ibatis.sqlmap.engine.accessplan.PropertyAccessPlan.setProperties(PropertyAccessPlan.java:46) INFO | jvm 1 | 2014/01/21 17:53:58 | ... 17 more
_______________________________________________ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel