[xwiki-users] Delete page - Error number 0 in 3: Exception while hibernate execute
We are running XWiki 5.4.3 We have upgraded the server on which XWiki runs, but we now get an error when we want to delete a page: Error number 0 in 3: Exception while hibernate execute com.xpn.xwiki.XWikiException: Error number 0 in 3: Exception while hibernate execute at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:1266) at com.xpn.xwiki.store.XWikiHibernateBaseStore.executeWrite(XWikiHibernateBaseStore.java:1346) at com.xpn.xwiki.store.XWikiHibernateRecycleBinStore.saveToRecycleBin(XWikiHibernateRecycleBinStore.java:123) at com.xpn.xwiki.XWiki.deleteDocument(XWiki.java:3801) at com.xpn.xwiki.XWiki.deleteDocument(XWiki.java:3776) at com.xpn.xwiki.XWiki.deleteAllDocuments(XWiki.java:5521) at com.xpn.xwiki.XWiki.deleteAllDocuments(XWiki.java:5510) at com.xpn.xwiki.web.DeleteAction.action(DeleteAction.java:93) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:293) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:129) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462) at javax.servlet.http.HttpServlet.service(HttpServlet.java:646) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:121) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:126) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:66) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: org.hibernate.exception.GenericJDBCException: could not insert: [com.xpn.xwiki.doc.XWikiDeletedDocument] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:64) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2345) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2852) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:320) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210) at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195) at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93) at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:713) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:701) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:697) at com.xpn.xwiki.store.XWikiHibernateRecycleBinStore$1.doInHibernate(XWikiHibernateRecycleBinStore.java:128) at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:1260) ... 46 more Caused by: java.sql.SQLException: Field 'XDD_ID' doesn't have a default value at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3847) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3783) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2447) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2594) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1901) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2113) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2049) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2034) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57) ... 63 more What could be the cause? Where should we start looking? -- View this message in context: http://xwiki.475771.n2.nabble.com/Delete-page-Error-number-0-in-3-Exception-... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi Hamster, On 8 Oct 2015 at 12:46:44, Hamster ([email protected](mailto:[email protected])) wrote:
We are running XWiki 5.4.3
We have upgraded the server on which XWiki runs, but we now get an error when we want to delete a page:
First, could you tell us to what version you are upgrading?
Error number 0 in 3: Exception while hibernate execute com.xpn.xwiki.XWikiException: Error number 0 in 3: Exception while hibernate execute at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:1266) at com.xpn.xwiki.store.XWikiHibernateBaseStore.executeWrite(XWikiHibernateBaseStore.java:1346) at com.xpn.xwiki.store.XWikiHibernateRecycleBinStore.saveToRecycleBin(XWikiHibernateRecycleBinStore.java:123) at com.xpn.xwiki.XWiki.deleteDocument(XWiki.java:3801) at com.xpn.xwiki.XWiki.deleteDocument(XWiki.java:3776) at com.xpn.xwiki.XWiki.deleteAllDocuments(XWiki.java:5521) at com.xpn.xwiki.XWiki.deleteAllDocuments(XWiki.java:5510) at com.xpn.xwiki.web.DeleteAction.action(DeleteAction.java:93)
[snip]
Caused by: java.sql.SQLException: Field 'XDD_ID' doesn't have a default value at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3847) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3783) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2447) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2594) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1901)
[snip]
What could be the cause? Where should we start looking?
This looks like some error of upgrading the schema. Are you sure that you have enabled data migration: xwiki.store.migration=1 xwiki.store.migration.databases=all Thanks -Vincent
We are not upgrading XWiki at all, we created a new server where XWiki runs on. :-) In short: Our ICT created a new ubuntu server with TomCat7, Java7 and localhost MySQL server. They then put xwiki.war in the TomCat7 folder. They made an SQL dump of the "old" XWiki and restored that on the new MySQL server (and created an xwiki user with all priveleges to the xwiki database). They edited the Hibernate file so it refers to the new xwiki database. They edited setenv.sh with the settings for the Java Heap Space. They then opened/started XWiki and SKIPPED the upgrade (it's not an upgrade but a new server). -- View this message in context: http://xwiki.475771.n2.nabble.com/Delete-page-Error-number-0-in-3-Exception-... Sent from the XWiki- Users mailing list archive at Nabble.com.
On Thu, Oct 8, 2015 at 4:05 PM, Hamster <[email protected]> wrote:
We are not upgrading XWiki at all, we created a new server where XWiki runs on. :-)
In short: Our ICT created a new ubuntu server with TomCat7, Java7 and localhost MySQL server. They then put xwiki.war in the TomCat7 folder. They made an SQL dump of the "old" XWiki and restored that on the new MySQL server (and created an xwiki user with all priveleges to the xwiki database). They edited the Hibernate file so it refers to the new xwiki database. They edited setenv.sh with the settings for the Java Heap Space.
They then opened/started XWiki and SKIPPED the upgrade (it's not an upgrade but a new server).
Using a new XWiki war (with a different version) with an old (existing) database (=wiki pages) is an upgrade. The wiki pages are using APIs provided by the war. If you change the war version you need to update the wiki pages. The job of the Distribution Wizard you skipped is to ensure the wiki pages are in sync with the war version.
-- View this message in context: http://xwiki.475771.n2.nabble.com/Delete-page-Error-number-0-in-3-Exception-... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
It's not a new war file, it's the same war file (only now on a different server) I will try to explain again :-) We have "Server A" (running XWiki 5.4.3) but we want to move everyting to "Server B" (which will also runs XWiki 5.4.3). On "Server A" we made a dump of the MySQL (all the xwiki pages). On "Server B" we have installed ubuntu, TomCat7, Java7. We then copied the war file from "Server A" to "Server B". On server "B" TomCat extracted the war file automaticly. We then restored the dump on "Server B". So "Server B" has the same war file and xwiki pages as on "Server A". Does this make any sense? :-) -- View this message in context: http://xwiki.475771.n2.nabble.com/Delete-page-Error-number-0-in-3-Exception-... Sent from the XWiki- Users mailing list archive at Nabble.com.
So with the same war file and the same database...do we still need to run the upgrade process? -- View this message in context: http://xwiki.475771.n2.nabble.com/Delete-page-Error-number-0-in-3-Exception-... Sent from the XWiki- Users mailing list archive at Nabble.com.
If you put the same WAR version you won't get the Distribution Wizard anyway (otherwise you would get it every time you restart). On Fri, Oct 9, 2015 at 10:31 AM, Hamster <[email protected]> wrote:
So with the same war file and the same database...do we still need to run the upgrade process?
-- View this message in context: http://xwiki.475771.n2.nabble.com/Delete-page-Error-number-0-in-3-Exception-... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
On Fri, Oct 9, 2015 at 11:31 AM, Hamster <[email protected]> wrote:
So with the same war file and the same database...do we still need to run the upgrade process?
Besides the war and the database there is also the permanent directory which holds important things like: * the extension index (which extensions have been installed) * the Solr search index * various job statuses, including the status of the Distribution Wizard * caches * etc. The Distribution Wizard appears because the extension index is empty. You have the wiki pages but the XWiki UI is not properly marked as installed so the Distribution Wizard offers to install (actually repair) it. Hope this helps, Marius
-- View this message in context: http://xwiki.475771.n2.nabble.com/Delete-page-Error-number-0-in-3-Exception-... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Thanks guys, that should give us some clues to work on! -- View this message in context: http://xwiki.475771.n2.nabble.com/Delete-page-Error-number-0-in-3-Exception-... Sent from the XWiki- Users mailing list archive at Nabble.com.
We still receiving the error messages after trying to delete a page or attachment. I also tried to do a upgrade and repair with the Distribution Wizard, but the error messages remain. The error message in the Catalina.out: 2015-10-20 10:23:00,312 [] WARN o.h.u.JDBCExceptionReporter - SQL Error: 1364, SQLState: HY000 2015-10-20 10:23:00,312 [] ERROR o.h.u.JDBCExceptionReporter - Field 'XDD_ID' doesn't have a default value 2015-10-20 10:23:00,315 [] WARN c.x.x.w.XWikiAction - Uncaught exception: Error number 0 in 3: Exception while hibernate exate execute com.xpn.xwiki.XWikiException: Error number 0 in 3: Exception while hibernate execute Caused by: org.hibernate.exception.GenericJDBCException: could not insert: [com.xpn.xwiki.doc.XWikiDeletedDocument] Caused by: java.sql.SQLException: Field 'XDD_ID' doesn't have a default value -- View this message in context: http://xwiki.475771.n2.nabble.com/Delete-page-Error-number-0-in-3-Exception-... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi LA, Could you confirm that you’ve done the DB migration as I suggested in my first reply to Hamster? “ This looks like some error of upgrading the schema. Are you sure that you have enabled data migration: xwiki.store.migration=1 xwiki.store.migration.databases=all " Thanks -Vincent On 20 Oct 2015 at 10:31:42, LA ([email protected](mailto:[email protected])) wrote:
We still receiving the error messages after trying to delete a page or attachment. I also tried to do a upgrade and repair with the Distribution Wizard, but the error messages remain. The error message in the Catalina.out:
2015-10-20 10:23:00,312 [] WARN o.h.u.JDBCExceptionReporter - SQL Error: 1364, SQLState: HY000 2015-10-20 10:23:00,312 [] ERROR o.h.u.JDBCExceptionReporter - Field 'XDD_ID' doesn't have a default value 2015-10-20 10:23:00,315 [] WARN c.x.x.w.XWikiAction - Uncaught exception: Error number 0 in 3: Exception while hibernate exate execute
com.xpn.xwiki.XWikiException: Error number 0 in 3: Exception while hibernate execute Caused by: org.hibernate.exception.GenericJDBCException: could not insert: [com.xpn.xwiki.doc.XWikiDeletedDocument] Caused by: java.sql.SQLException: Field 'XDD_ID' doesn't have a default value
I can confirm this, also tried to do a upgrade to 6.4.5, also with the Distribution Wizard. Everything works only deleting a page doesn't. -- View this message in context: http://xwiki.475771.n2.nabble.com/Delete-page-Error-number-0-in-3-Exception-... Sent from the XWiki- Users mailing list archive at Nabble.com.
On 20 Oct 2015 at 10:42:47, LA ([email protected](mailto:[email protected])) wrote:
I can confirm this, also tried to do a upgrade to 6.4.5, also with the Distribution Wizard. Everything works only deleting a page doesn’t.
Are you using the Filesystem storage for attachments? Thanks -Vincent
No, we do not using the Filesystem Storage for attachments. -- View this message in context: http://xwiki.475771.n2.nabble.com/Delete-page-Error-number-0-in-3-Exception-... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi, So I checked our schema and the XDD_ID field is the primary key for the Deleted Documents table: <class name="com.xpn.xwiki.doc.XWikiDeletedDocument" table="xwikirecyclebin" mutable="false"> <id name="id" column="XDD_ID"> <generator class="native" /> </id> This definition has not changed since forever so the problem is elsewhere. Since that id is generated I don’t see how it cannot have a default value…. Now is it possible that you have enabled the STRICT_TRANS_TABLES mode for your mysql instance (see http://stackoverflow.com/questions/15438840/mysql-error-1364-field-doesnt-ha... What version of mysql are you running? Thanks -Vincent On 20 Oct 2015 at 10:53:33, LA ([email protected](mailto:[email protected])) wrote:
No, we do not using the Filesystem Storage for attachments.
-- View this message in context: http://xwiki.475771.n2.nabble.com/Delete-page-Error-number-0-in-3-Exception-... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi, The version of mysql is 14.14 Distrib 5.5.44, it is running on Ubuntu and xWiki is on the same server. The STRICT_TRANS_TABLES mode is not enabled. -- View this message in context: http://xwiki.475771.n2.nabble.com/Delete-page-Error-number-0-in-3-Exception-... Sent from the XWiki- Users mailing list archive at Nabble.com.
Finally solved this problem, the Auto Increment in the xwikirecyclebin Column Xdd_ID was unchecked. Since I checked this button, I can delete pages again. -- View this message in context: http://xwiki.475771.n2.nabble.com/Delete-page-Error-number-0-in-3-Exception-... Sent from the XWiki- Users mailing list archive at Nabble.com.
Also for the table xwikiattrecyclebin Column XDA_ID auto increment was unchecked. When check this button, Attachments can be removed. Thanks for your fast response and your tips. -- View this message in context: http://xwiki.475771.n2.nabble.com/Delete-page-Error-number-0-in-3-Exception-... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi, Glad that you solve it. Do you know why you had a column with autoincrement removed? Normally you shouldn’t have this by default AFAIK. Does it mean someone had played with the schema on your side? Thanks -Vincent On 20 Oct 2015 at 16:22:40, LA ([email protected](mailto:[email protected])) wrote:
Finally solved this problem, the Auto Increment in the xwikirecyclebin Column Xdd_ID was unchecked. Since I checked this button, I can delete pages again.
-- View this message in context: http://xwiki.475771.n2.nabble.com/Delete-page-Error-number-0-in-3-Exception-...
No, I don't know. Probably it has happen in the proces of migrating from Windows Mysql to Linux Mysql. -- View this message in context: http://xwiki.475771.n2.nabble.com/Delete-page-Error-number-0-in-3-Exception-... Sent from the XWiki- Users mailing list archive at Nabble.com.
Ok thanks anyway. This is good information. I don’t remember seeing this before on this list so I’m sure it’ll help future users. Thanks -Vincent On 21 Oct 2015 at 07:42:22, LA ([email protected]) wrote: No, I don't know. Probably it has happen in the proces of migrating from Windows Mysql to Linux Mysql. View this message in context: http://xwiki.475771.n2.nabble.com/Delete-page-Error-number-0-in-3-Exception-... Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (5)
-
Hamster -
LA -
Marius Dumitru Florea -
Thomas Mortagne -
vincent@massol.net