Repoinit frequently giving issues on server restart
Hi All,
Some time ago, we started using Repository Initializer from Sling to perform some initial setup of eg paths and permissions:
https://sling.apache.org/documentation/bundles/repository-initialization.html
What we're seeing is that these frequently give issues on a server restart, also in UAT / PROD.
In case such a repo init script fails at package installation time, an exception is logged to the error.log file but nothing obvious happens. In case such an exception happens on server startup, the JCR repository doesn't get initialized and AEM won't start up at all. To remedy this, manual actions are needed every restart to remove the config file from disk and allow AEM to start up normally.
To remedy this, a few actions are needed:
- As this is quite inconvenient and we lose quite a lot of time on this, we should review the existing repo init scripts and ensure they run properly in all cases. For example, the script should still run OK in case some repository paths are missing, in case some of the properties already have some value (single value / multi-value), etc.
- We should also come up with some guidelines or best practices during development time to ensure these scripts are as stable as they can be and will never block the server startup due to some exceptions.
Can you take a look at the suggestions above and ensure the config files are improved and that we have some guidelines to avoid similar issues in the future? Thanks!

