-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Directory
-
Tags:
-
Backlog priority:450
-
Sprint:nxplatform 11.1.30, nxplatform 11.1.31, nxplatform 11.1.32
-
Story Points:2
When creating entries in the Users & Groups menu using Studio users or groups with the same name it prevents the Directory Service from starting up correctly, see after.
We should make the platform more resilient to such situations.
- The most appropriate behaviour would be to keep updating the entries that are duplicated with the values of the latest line imported, logging in warning that entry already exists, values are updated. We could do this on master with an upgrade note.
- since this would be a functional change, in the hotfix we might want to just ignore the duplicated line and log it in warning.
====================================================================== = Component Loading Status: Pending: 0 / Missing: 0 / Unstarted: 1 / Total: 776 - service:org.nuxeo.ecm.directory.DirectoryServiceImpl ======================================================================
This is particularly critical when the user and group creation policy is set to always.
For a demo, it has lead to a complete server corruption (don't pay attention to WOPI, it is not related to it directly)
2019-11-13T17:15:03,494 ERROR [WOPI_http-nio-127.0.0.1-8080-exec-14] [org.nuxeo.runtime.model.ComponentManager] Component service:org.nuxeo.ecm.directory.DirectoryServiceImpl notification of application started failed: Entry with id gcarlin already exists
org.nuxeo.ecm.directory.DirectoryException: Entry with id gcarlin already exists
at org.nuxeo.ecm.directory.sql.SQLSession.createEntryWithoutReferences(SQLSession.java:933) ~[nuxeo-platform-directory-sql-10.10-HF06.jar:?]
at org.nuxeo.ecm.directory.DirectoryCSVLoader.loadData(DirectoryCSVLoader.java:110) ~[nuxeo-platform-directory-core-10.10-HF02.jar:?]
at org.nuxeo.ecm.directory.AbstractDirectory.lambda$null$0(AbstractDirectory.java:120) ~[nuxeo-platform-directory-core-10.10-HF02.jar:?]
at org.nuxeo.runtime.api.Framework.doPrivileged(Framework.java:271) ~[nuxeo-runtime-10.10-HF10.jar:?]
at org.nuxeo.ecm.directory.AbstractDirectory.lambda$loadData$1(AbstractDirectory.java:118) ~[nuxeo-platform-directory-core-10.10-HF02.jar:?]
at org.nuxeo.runtime.transaction.TransactionHelper.lambda$runInTransaction$5(TransactionHelper.java:587) ~[nuxeo-runtime-jtajca-10.10-HF14.jar:?]
at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:607) ~[nuxeo-runtime-jtajca-10.10-HF14.jar:?]
at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:587) ~[nuxeo-runtime-jtajca-10.10-HF14.jar:?]
at org.nuxeo.ecm.directory.AbstractDirectory.loadData(AbstractDirectory.java:118) ~[nuxeo-platform-directory-core-10.10-HF02.jar:?]
The problem is that we couldn't start Nuxeo:
- Even by removing the Studio package with nuxeoctl
- Even by updating the Studio package with a good configuration
- Even by removing every packages
So the server couldn't start because we had this error right after starting it:
019-11-13T18:25:40,476 ERROR [main] [org.nuxeo.runtime.tomcat.NuxeoLauncher] Failed to handle event: configure_startjava.lang.ClassNotFoundException: org.nuxeo.osgi.application.loader.FrameworkLoader at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1343) ~[catalina.jar:9.0.14] at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1173) ~[catalina.jar:9.0.14] at org.nuxeo.osgi.application.FrameworkBootstrap.initialize(FrameworkBootstrap.java:121) ~[nuxeo-runtime-launcher-10.10.jar:?] at org.nuxeo.runtime.tomcat.NuxeoLauncher.handleEvent(NuxeoLauncher.java:104) [nuxeo-runtime-tomcat-adapter-10.10.jar:?] at org.nuxeo.runtime.tomcat.NuxeoLauncher.lifecycleEvent(NuxeoLauncher.java:84) [nuxeo-runtime-tomcat-adapter-10.10.jar:?] at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123) [catalina.jar:9.0.14] at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5029) [catalina.jar:9.0.14] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [catalina.jar:9.0.14] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:713) [catalina.jar:9.0.14] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690) [catalina.jar:9.0.14] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:695) [catalina.jar:9.0.14] at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:631) [catalina.jar:9.0.14] at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1832) [catalina.jar:9.0.14] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?] at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) [tomcat-util.jar:9.0.14] at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118) [?:?] at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:526) [catalina.jar:9.0.14] at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:425) [catalina.jar:9.0.14] at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1577) [catalina.jar:9.0.14] at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:309) [catalina.jar:9.0.14] at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123) [catalina.jar:9.0.14]
Obviously, the Studio user should have checked his configuration, but we have 0 warning, leading to a very bad situation.