axelor / axelor-open-suite

The Axelor Open Suite based on Axelor Open Platform
http://axelor.com
Other
842 stars 681 forks source link

Unable to uninstall stock module #315

Open santino83 opened 7 years ago

santino83 commented 7 years ago

Hello,

Set stock module to be uninstalled via graphic interface, restarting the server got the following error:

[localhost-startStop-1] INFO com.axelor.meta.loader.ModuleManager - easypbx-crm 2017-05-20 18:17:14,139 [localhost-startStop-1] DEBUG com.axelor.meta.loader.ViewLoader - Loading view: meta-sequence-grid 2017-05-20 18:17:16,508 [localhost-startStop-1] DEBUG com.axelor.meta.loader.ViewLoader - Loading view: meta-sequence-form 2017-05-20 18:17:16,595 [localhost-startStop-1] DEBUG com.axelor.meta.loader.ViewLoader - Creating default views: /tmp/axelor/generated/views/MetaSequence.xml 2017-05-20 18:17:25,017 [localhost-startStop-1] INFO com.axelor.meta.loader.ModuleManager - Uninstall module: axelor-stock 2017-05-20 18:17:26,157 [localhost-startStop-1] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - ERROR: update or delete on table "meta_menu" violates foreign key constraint "fk_jk6vvh0bx8cx8o1tjacx6dtcn" on table "meta_menu" Dettaglio: Key (id)=(167) is still referenced from table "meta_menu". 2017-05-20 18:17:26,286 [localhost-startStop-1] ERROR com.axelor.web.servlet.InitServlet - org.hibernate.exception.ConstraintViolationException: could not execute statement javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387) at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310) at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:316) at com.axelor.db.Query.count(Query.java:298) at com.axelor.db.Query.remove(Query.java:382) at com.axelor.meta.loader.ModuleManager.uninstall(ModuleManager.java:235) at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:70) at com.axelor.meta.loader.ModuleManager$1.run(ModuleManager.java:131) at com.axelor.auth.AuditableRunner$1.call(AuditableRunner.java:58) at com.axelor.auth.AuditableRunner$1.call(AuditableRunner.java:55) at com.axelor.auth.AuditableRunner.run(AuditableRunner.java:90) at com.axelor.auth.AuditableRunner.run(AuditableRunner.java:55) at com.axelor.meta.loader.ModuleManager.initialize(ModuleManager.java:140) at com.axelor.web.servlet.InitServlet.init(InitServlet.java:50) at javax.servlet.GenericServlet.init(GenericServlet.java:158) at com.google.inject.servlet.ServletDefinition.init(ServletDefinition.java:121) at com.google.inject.servlet.ManagedServletPipeline.init(ManagedServletPipeline.java:82) at com.google.inject.servlet.ManagedFilterPipeline.initPipeline(ManagedFilterPipeline.java:103) at com.google.inject.servlet.GuiceFilter.init(GuiceFilter.java:220) at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260) at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:105) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4841) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5535) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:189) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:3358) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:3558) at org.hibernate.action.internal.EntityDeleteAction.execute(EntityDeleteAction.java:102) at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:395) at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:387) at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:310) at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:349) at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:67) at org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1166) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1223) at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101) at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:287) ... 28 more Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "meta_menu" violates foreign key constraint "fk_jk6vvh0bx8cx8o1tjacx6dtcn" on table "meta_menu" Dettaglio: Key (id)=(167) is still referenced from table "meta_menu". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2455) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2155) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:288) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:430) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:356) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:168) at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:135) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:147) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:186)

Deleting all menu entries (referencing the stock module) from database solve the problem

version: WIP-4.1

opensam commented 5 months ago

Please close all outdated issues. It is v8 time today.