Thanks, yeah this is actually a configuration problem of the JCR Installer - it writes back the configuration to /apps/sling/config, however config directories are not in the search path. So when you restart, the repository is searched for configurations, the log manager config is not found as only directories named install are searched, and therefore the osgi installer removes the configuration as it assumes that the corresponding information from the repository has been removed. And this in turn removes the configuration from the config admin.
So basically we ship the jcr installer with a non working configuration :( I'll fix this Regards Carsten 2012/5/30 Pontus Amberg <[email protected]>: > On way of reproducing this is > > 1. Build the current trunk of sling > 2. Start the standalone JAR of Sling in a console with > java -jar <path to sling > src>/launchpad/builder/target/org.apache.sling.launchpad-7-SNAPSHOT-standalone.jar > 3. Open the web console in a browser http://localhost:8080/system/console > 4. In the Configuration change Log level of the "Apache Sling Logging > Configuration" to "Debug" > and click "Save" > > There should now be config files created in > <path where you started sling>/sling/commons/log/LogManager/factory/config/ > > 5. Shutdown Sling with ctrl-c > 6. Start sling again with > java -jar <path to sling > src>/launchpad/builder/target/org.apache.sling.launchpad-7-SNAPSHOT-standalone.jar > > The files in <path where you started > sling>/sling/commons/log/LogManager/factory/config/ > will now be deleted and the settings lost. > > /Pontus > > > On 2012-05-29 07:43, Carsten Ziegeler wrote: >> >> This looks strange. So what is the correct way of reproducing this? >> Creating a configuration through the web console? >> >> The ConfigRemoveTask should only be executed if a configuration is >> removed from one of the sources of the installer like the repository >> etc. So if it is this piece of code which removes the configuration >> from the config admin (and therefore from the config directory), then >> we have to find the root cause: who is triggering the deleting? >> >> Regards >> Carsten >> >> 2012/5/29 Ian Boston<[email protected]>: >>> >>> Thanks, >>> I had a further look at this. >>> I think the bug is quite old but never exposed as in 1.0.4 there was a >>> bug with the naming of configuraiton files. >>> >>> I had a lopk at the code and ran some tests. It seems that there is a >>> check to see if the configuration in the JVM and on disk are the same. >>> If they are the same the code deletes the configuration on Disk. >>> AFAICT, the code is triggered by an OSGi even after the configuration >>> from disk is loaded into the JVM, and so that trigger always causes >>> all configurations on disk to be deleted. The test to see if the >>> configurations are the same is valid. >>> >>> AFAICT, looking at the commit logs just after the 1.0.4 release there >>> were some file naming issues fixed that caused this behaviour to >>> activate. I think Carsten is going to have a much better idea what is >>> going on since he is active in this area. >>> >>> Ian >>> >>> On 27 May 2012 08:22, Pontus Amberg<[email protected]> wrote: >>>> >>>> Created an Issue in JIRA >>>> https://issues.apache.org/jira/browse/SLING-2495 . >>>> I didn't specify component or version. >>>> >>>> /Pontus >>>> >>>> >>>> On 2012-05-26 01:01, Ian Boston wrote: >>>>> >>>>> Yes, same here. >>>>> The config files all get deleted. >>>>> It happens after the bootstrap finished, and if I make the files >>>>> readonly they are not deleted but there is not exception in the logs. >>>>> >>>>> Not sure why, I'll continue looking. If you havent already could you >>>>> submit a bug report. >>>>> Thanks >>>>> Ian >>>>> >>>>> On 26 May 2012 07:28, Pontus Amberg<[email protected]> wrote: >>>>>> >>>>>> Where you able to reproduce the behaviour? I've also tried to use the >>>>>> org.apache.sling.launchpad-7-SNAPSHOT-standalone.jar produced >>>>>> by building the current trunk and I get the same behaviour when >>>>>> stopping& starting the standalone jar. >>>>>> >>>>>> >>>>>> /Pontus >>>>>> >>>>>> >>>>>> On 2012-05-18 10:17, Ian Boston wrote: >>>>>>> >>>>>>> On 18 May 2012 01:45, Pontus Amberg<[email protected]> >>>>>>> wrote: >>>>>>>> >>>>>>>> A file was created in /config/org/apache/sling/commons/log when I >>>>>>>> changed >>>>>>>> the >>>>>>>> log level in the Logger Configuration but when I restarted the >>>>>>>> system >>>>>>>> it >>>>>>>> was >>>>>>>> also removed at the startup. So the problem is not only affecting >>>>>>>> the >>>>>>>> Authenticator. >>>>>>>> >>>>>>>> I might add that I modified the property >>>>>>>> "installer.configuration.version" >>>>>>>> in >>>>>>>> installer/factories/configuration/pom.xml to 1.0.9-SNAPSHOT since It >>>>>>>> otherwise was impossible to build Sling with an empty Maven >>>>>>>> repository. >>>>>>>> I've added an issue in Jira about this >>>>>>>> https://issues.apache.org/jira/browse/SLING-2482 >>>>>>>> >>>>>>>> Might this be the reason I'm having troubles with the config files? >>>>>>> >>>>>>> >>>>>>> Could be. >>>>>>> I am trying to reproduce now. Been a hectic day, sorry for the delay. >>>>>>> Ian >>>>>>> >>>>>>>> /Pontus >>>>>>>> >>>>>>>> >>>>>>>> On 2012-05-17 01:19, Ian Boston wrote: >>>>>>>>> >>>>>>>>> AFAIK, This doesn't normally happen. >>>>>>>>> >>>>>>>>> Does it happen to any of the other config files, or just the >>>>>>>>> SlingAuthenticator.config ? >>>>>>>>> >>>>>>>>> Try adding a logging configuration, stopping and starting the >>>>>>>>> tomcat >>>>>>>>> instance. >>>>>>>>> >>>>>>>>> Ian >>>>>>>>> >>>>>>>>> >>>>>>>>> On 17 May 2012 09:09, Pontus Amberg<[email protected]> >>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>> I just noticed that config files stored in {sling.home}/config are >>>>>>>>>> purged >>>>>>>>>> when I >>>>>>>>>> restart the server that the Sling WAR archive is hosted on. >>>>>>>>>> >>>>>>>>>> If I for example add authentication requirements in the >>>>>>>>>> authentication >>>>>>>>>> service >>>>>>>>>> I can see that the SlingAuthenticator.config file is created in >>>>>>>>>> config/org/apache/sling/engine/impl/auth but when I restart the >>>>>>>>>> server >>>>>>>>>> the >>>>>>>>>> file >>>>>>>>>> is removed and the settings are lost. The folders are still there >>>>>>>>>> though. >>>>>>>>>> >>>>>>>>>> Is this a bug or is it a feature and if it is a feature how is it >>>>>>>>>> disabled? >>>>>>>>>> >>>>>>>>>> /Pontus >>>>>>>>>> >> >> > -- Carsten Ziegeler [email protected]
