User story #4079
closedWhen Rudder does not start due to an error in rudder-users.xml, the webapp will display an usable error log
Description
If the rudder-users.xml is invalid, the app simply returns an error 503, and have sybilin log message : "lineNumber: 52; columnNumber: 36; Element type "user" must be followed by either attribute specificati"
It would be great to have a REAL error log !
Updated by Jonathan CLARKE about 11 years ago
- Tracker changed from Bug to User story
- Status changed from New to 8
- Assignee set to Vincent MEMBRÉ
- Target version changed from 2.4.12 to 2.8.0~rc1
This is important, but not worth disturbing stable code for. Let's add this to 2.8.
Updated by Vincent MEMBRÉ about 11 years ago
On any version of Rudder, if a user in xml is missing an attribute, this is not a problem.
You already get a logger error or warning when a field is missing or not correct, and the user is ignored.
However is the XML is not valid at all, and exception is thrown. And we should add a correct message, easy to read, that would b esend to core log (/var/log/rudder/core).
My proposition is:
[2013-10-22 17:26:54] ERROR application - Rudder user xml: An error occured while parsing the users xml file, and you won't be able to connect to Rudder webapp until you correct it. [2013-10-22 17:26:54] ERROR application - Rudder user xml: XML file is not correct, error message is: Le type d'élément "user" doit se terminer par la balise de fin correspondante "</user>". (line 105, column 3)
instead of
[2013-10-22 17:26:54] ERROR org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoAuthenticationProvider' defined in class path resource [bootstrap/liftweb/AppConfigAuth.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.security.authentication.AuthenticationProvider bootstrap.liftweb.AppConfigAuth.demoAuthenticationProvider()] threw exception; nested exception is org.xml.sax.SAXParseException; lineNumber: 105; columnNumber: 3; Le type d'élément "user" doit se terminer par la balise de fin correspondante "</user>". at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE] Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.security.authentication.AuthenticationProvider bootstrap.liftweb.AppConfigAuth.demoAuthenticationProvider()] threw exception; nested exception is org.xml.sax.SAXParseException; lineNumber: 105; columnNumber: 3; Le type d'élément "user" doit se terminer par la balise de fin correspondante "</user>". at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:169) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE] Caused by: org.xml.sax.SAXParseException: Le type d'élément "user" doit se terminer par la balise de fin correspondante "</user>". at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) ~[na:1.7.0_03] 2013-10-22 17:26:54.258:WARN::Failed startup of context org.mortbay.jetty.webapp.WebAppContext@11901790{/,/home/vincent/workspace/rudder-project/rudder/rudder-web/src/main/webapp} org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoAuthenticationProvider' defined in class path resource [bootstrap/liftweb/AppConfigAuth.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.security.authentication.AuthenticationProvider bootstrap.liftweb.AppConfigAuth.demoAuthenticationProvider()] threw exception; nested exception is org.xml.sax.SAXParseException; lineNumber: 105; columnNumber: 3; Le type d'élément "user" doit se terminer par la balise de fin correspondante "</user>". at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1015) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) at bootstrap.liftweb.LiftInitContextListener.contextInitialized(LiftInitContextListener.scala:89) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:549) at org.mortbay.jetty.servlet.Context.startContext(Context.java:136) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) at org.mortbay.jetty.Server.doStart(Server.java:224) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at runjettyrun.Bootstrap.main(Bootstrap.java:97) 2013-10-22 17:26:54.259:WARN::Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoAuthenticationProvider' defined in class path resource [bootstrap/liftweb/AppConfigAuth.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.security.authentication.AuthenticationProvider bootstrap.liftweb.AppConfigAuth.demoAuthenticationProvider()] threw exception; nested exception is org.xml.sax.SAXParseException; lineNumber: 105; columnNumber: 3; Le type d'élément "user" doit se terminer par la balise de fin correspondante "</user>".: org.xml.sax.SAXParseException; lineNumber: 105; columnNumber: 3; Le type d'élément "user" doit se terminer par la balise de fin correspondante "</user>". at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1375) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1708) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2898) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:302) at scala.xml.factory.XMLLoader$class.loadXML(XMLLoader.scala:40) at scala.xml.XML$.loadXML(XML.scala:57) at scala.xml.factory.XMLLoader$class.load(XMLLoader.scala:52) at scala.xml.XML$.load(XML.scala:57) at bootstrap.liftweb.AppConfigAuth$.parseUsers(AppConfigAuth.scala:367) at bootstrap.liftweb.AppConfigAuth.demoAuthenticationProvider(AppConfigAuth.scala:112) at bootstrap.liftweb.AppConfigAuth$$EnhancerByCGLIB$$e9d6aff.CGLIB$demoAuthenticationProvider$2(<generated>) at bootstrap.liftweb.AppConfigAuth$$EnhancerByCGLIB$$e9d6aff$$FastClassByCGLIB$$905e35fb.invoke(<generated>) at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:280) at bootstrap.liftweb.AppConfigAuth$$EnhancerByCGLIB$$e9d6aff.demoAuthenticationProvider(<generated>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:149) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:570) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1015) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) at bootstrap.liftweb.LiftInitContextListener.contextInitialized(LiftInitContextListener.scala:89) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:549) at org.mortbay.jetty.servlet.Context.startContext(Context.java:136) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) at org.mortbay.jetty.Server.doStart(Server.java:224) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at runjettyrun.Bootstrap.main(Bootstrap.java:97)
Updated by Vincent MEMBRÉ about 11 years ago
- Subject changed from When there is a typo in the rudder-users.xml, the applicatin fails to start, and fails to provide meaningful error message to When Rudder does not start due to an error in rudder-users.xml, the webapp will display an usable error log
Updated by Matthieu CERDA about 11 years ago
- Status changed from 10 to Pending release
Updated by Vincent MEMBRÉ about 11 years ago
- Status changed from Pending release to Released
This bug has been fixed in Rudder 2.8.0~rc1, which was released on Friday 25/10/2013.
Check out:
- The release announcement: http://www.rudder-project.org/pipermail/rudder-announce/2013-October/000057.html
- The full ChangeLog: http://www.rudder-project.org/foswiki/bin/view/System/Documentation:ChangeLog28
- Download information: https://www.rudder-project.org/site/get-rudder/downloads/