On a fresh AEM 6.5 SP4. Whenever I install either a new AEM archetype project or the WKND starter project, AEM (or Sightly most likely) seem to unregister, and only come back once the OSGi Bundle is fully Active. Is a brief 4-10 seconds outage I get the image below
There is also a long stack trace but this is what it says
02.06.2020 01:09:53.093 *ERROR* [172.19.0.1  GET /sites.html/content HTTP/1.1] org.apache.sling.servlets.resolver.internal.SlingServletResolver Original error null 02.06.2020 01:09:53.095 *ERROR* [172.19.0.1  GET /sites.html/content HTTP/1.1] org.apache.sling.engine.impl.DefaultErrorHandler Error handler failed:java.io.IOException java.io.IOException: Error handler failed: org.apache.sling.api.scripting.ScriptEvaluationException
We would understand our own pages to be down during deployment, but we do not understand why the rest of the platform (likes sites.html or assets.html) have to go down. Is this the expected behaviour?
You are absolutely correct.
Whenever you install the AEM archetype project or the WKND starter project using your maven skills, for example, mvn clean install -PautoInstallSinglePackage, at the most basic level, you are uploading and installing AEM components and scripts to AEM (you can find it in CRX/DE,http://localhost:4502/crx/de/index.jsp. At the same time, the backend bundle is being installed (typically the bundle is named "core" by using the AEM archetype project, and the .jar lives inside of the /apps/my-site/install folder which is detected by the JCR installer provider, which installs this package into the OSGI framework.).
When the backend bundle is installed, some AEM backend services are orchestrated to restart (based on the OSGI service registry rules), so that your bundle can be registered and consumed by other backend bundles.
During the services restart, some areas of your website will be affected, and this is expected. you must wait until the service is restarted for you to continue.
In summary, you must wait until the service is restarted for you to continue.
I hope this helps.
Seems you are deploying AEM archetype project (OOTB) or the WKND starter project (or Sightly most likely) on a fresh instance, this looks like to be an expected behavior. All consoles like sites.html or assets.html can only be accessible when bundles/services are up and running.