Skip to content

Docker build passes even though landing page does not load #554

Open

Description

@ismisepaul

There is currently no test to see if the webpage loads when the build for docker is complete.

Below an an issue with the sed command not working where its supposed to replace TLS_KEYSTORE_FILE in /usr/local/tomcat/conf/ with the actual value but it fails. The file is not referenced when the application starts up and cannot produce the landing page.

There needs to be a test developed to catch this.

Evidence of build passing - https://travis-ci.com/OWASP/SecurityShepherd/jobs/294068223

ecshep_tomcat | 04-Mar-2020 18:16:59.971 SEVERE [main] org.apache.catalina.core.StandardService.initInternal Failed to initialize connector [Connector[HTTP/1.1-8443]]
secshep_tomcat | 	org.apache.catalina.LifecycleException: Protocol handler initialization failed
secshep_tomcat | 		at org.apache.catalina.connector.Connector.initInternal(Connector.java:1032)
secshep_tomcat | 		at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
secshep_tomcat | 		at org.apache.catalina.core.StandardService.initInternal(StandardService.java:552)
secshep_tomcat | 		at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
secshep_tomcat | 		at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:848)
secshep_tomcat | 		at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
secshep_tomcat | 		at org.apache.catalina.startup.Catalina.load(Catalina.java:639)
secshep_tomcat | 		at org.apache.catalina.startup.Catalina.load(Catalina.java:662)
secshep_tomcat | 		at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
secshep_tomcat | 		at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
secshep_tomcat | 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
secshep_tomcat | 		at java.lang.reflect.Method.invoke(Method.java:498)
secshep_tomcat | 		at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:303)
secshep_tomcat | 		at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
secshep_tomcat | 	Caused by: java.lang.IllegalArgumentException: /usr/local/tomcat/conf/TLS_KEYSTORE_FILE (No such file or directory)
secshep_tomcat | 		at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:100)
secshep_tomcat | 		at org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:72)
secshep_tomcat | 		at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:246)
secshep_tomcat | 		at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1118)
secshep_tomcat | 		at org.apache.tomcat.util.net.AbstractJsseEndpoint.init(AbstractJsseEndpoint.java:223)
secshep_tomcat | 		at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:587)
secshep_tomcat | 		at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:74)
secshep_tomcat | 		at org.apache.catalina.connector.Connector.initInternal(Connector.java:1030)
secshep_tomcat | 		... 13 more
secshep_tomcat | 	Caused by: java.io.FileNotFoundException: /usr/local/tomcat/conf/TLS_KEYSTORE_FILE (No such file or directory)
secshep_tomcat | 		at java.io.FileInputStream.open0(Native Method)
secshep_tomcat | 		at java.io.FileInputStream.open(FileInputStream.java:195)
secshep_tomcat | 		at java.io.FileInputStream.<init>(FileInputStream.java:138)
secshep_tomcat | 		at java.io.FileInputStream.<init>(FileInputStream.java:93)
secshep_tomcat | 		at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
secshep_tomcat | 		at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
secshep_tomcat | 		at org.apache.tomcat.util.file.ConfigFileLoader.getInputStream(ConfigFileLoader.java:89)
secshep_tomcat | 		at org.apache.tomcat.util.net.SSLUtilBase.getStore(SSLUtilBase.java:197)
secshep_tomcat | 		at org.apache.tomcat.util.net.SSLHostConfigCertificate.getCertificateKeystore(SSLHostConfigCertificate.java:206)
secshep_tomcat | 		at org.apache.tomcat.util.net.SSLUtilBase.getKeyManagers(SSLUtilBase.java:282)
secshep_tomcat | 		at org.apache.tomcat.util.net.openssl.OpenSSLUtil.getKeyManagers(OpenSSLUtil.java:98)
secshep_tomcat | 		at org.apache.tomcat.util.net.SSLUtilBase.createSSLContext(SSLUtilBase.java:246)
secshep_tomcat | 		at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:98)
secshep_tomcat | 		... 20 more

Activity

  1. moved this to In Progress in Security Shepherdon Apr 1, 2026
  2. moved this to In Progress in Security Shepherdon Apr 1, 2026
  3. moved this from In Progress to Next Release Backlog in Security Shepherdon Apr 1, 2026
  4. ismisepaul commented on Oct 23, 2026

    @ismisepaul
    MemberAuthor

    Status update.

    Partly covered by #946 (not merged yet). It adds src/test/scripts/tomcat-config-test.sh, which runs in the CI build job after docker compose build. The script reads conf/server.xml from the built Tomcat image and fails if any placeholder (HTTPS_PORT, TLS_KEYSTORE_FILE, TLS_KEYSTORE_PASS, ALIAS) wasn't replaced. That catches the exact failure reported here.

    Still missing: CI never starts the containers. Because the check above only reads the config file, a build where Tomcat fails at runtime would still pass. Examples: the keystore file is missing from the image, the WAR fails to deploy, or there's another SEVERE startup error.

    Next steps once #946 is merged

    1. Add a startup smoke test script under src/test/scripts/ and run it in the build job right after tomcat-config-test.sh. It should:
      • run docker compose up -d
      • wait, with a bounded timeout, until https://localhost:${HTTPS_PORT}/ answers (curl -k, since the cert is self-signed)
      • check that a fresh install redirects to setup.jsp, and that the HTTP port redirects to HTTPS
      • fail if the secshep_tomcat logs contain SEVERE startup or connector errors, and print the logs on failure
      • always run docker compose down -v (via a trap)
    2. Show it fails: temporarily break the keystore path in docker/tomcat/serverxml.patch and confirm the script fails.
    3. Add the script to the local CI steps in AGENTS.md.

    This issue can be closed once that's merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions