structurizr / onpremises

Structurizr on-premises installation
https://docs.structurizr.com/onpremises
MIT License
117 stars 45 forks source link

Structurizr working perfectly on docker container locally(laptop) but behaves weird when hosted on OpenShift. #117

Open messycoder101 opened 2 months ago

messycoder101 commented 2 months ago

Description

Structurizr working perfectly on docker container locally(laptop) but behaves weird when hosted on openshift. http://localhost:8080/signin opens up as hosturl:8080/dashboard/signin http://localhost:8080/workspace/1 opens as http://localhost:8080/workspace/create/workspace/1

all pages have this error message: "Sorry We can't find what you're looking for."

Steps to reproduce

I have to use an arbitrary user and own the structurizr data directory which is /usr/local/structurizr. This is my dockerfile which uses structurizr/onpremises image:

# Use the official Structurizr image as a base
FROM remote-docker-hub.artifactory.COMPANY.net/structurizr/onpremises:latest as base
# Create necessary directories, change ownership and permissions
RUN mkdir -p /usr/local/structurizr && \
    chown -R 1001:0 /usr/local/structurizr && \
    chmod -R g=u /usr/local/structurizr && \
    chown -R 1001:0 /usr/local && \
    chmod -R g=u /usr/local
# Switch to a non-root user
USER 1001

I have even tried using bare minimum dockerfile like this: FROM remote-docker-hub.artifactory.COMPANY.net/structurizr/onpremises:latest It runs fine locally but has issue running on openshift which is why I had to use the arbitrary user 1001 as written above.

Screenshot

image

Code sample

FROM remote-docker-hub.artifactory.COMPANY.net/structurizr/onpremises:latest

Configuration

structurizr/onpremises:latest

Severity

Minor

Priority

I have no budget and there's no rush, please fix this for free

More information

No response

simonbrowndotje commented 2 months ago

I know of organisations that are running the on-premises installation on OpenShift, but I have no experience myself I'm afraid. The server logs might provide some additional information.

messycoder101 commented 2 months ago

Hi Simon, thanks for getting back to me.

My guess is that the problem might be related to https configuration as I saw locally the application tries to run on http but our openshift load balancers enforce the use of https. Strangely enough structurizr/lite works on our cluster but not the onpremises version. I read somewhere in the documentation that https configuration could be done by modifying files related to tomcat. But that's too complicated to my understanding.

Do you think the above could be the real reason why onpremises version doesn't work for us?

Thanks :)

On Tue, 7 May, 2024, 11:15 am Simon Brown, @.***> wrote:

I know of organisations that are running the on-premises installation on OpenShift, but I have no experience myself I'm afraid. The server logs might provide some additional information.

— Reply to this email directly, view it on GitHub https://github.com/structurizr/onpremises/issues/117#issuecomment-2097713527, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMM7JYWH7TBSPRYN6WLFOTTZBCEQ3AVCNFSM6AAAAABHI5XWL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJXG4YTGNJSG4 . You are receiving this because you authored the thread.Message ID: @.***>

simonbrowndotje commented 2 months ago

Do you think the above could be the real reason why onpremises version doesn't work for us?

Impossible to say given the lack of information I'm afraid.

messycoder101 commented 2 months ago

These are the latest logs after I start the server and click the signin button (look at the bottom)

07-May-2024 09:52:50.475 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/10.1.16
07-May-2024 09:52:50.478 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Nov 10 2023 16:17:33 UTC
07-May-2024 09:52:50.478 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 10.1.16.0
07-May-2024 09:52:50.478 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
07-May-2024 09:52:50.478 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 5.14.0-284.57.1.el9_2.x86_64
07-May-2024 09:52:50.478 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
07-May-2024 09:52:50.478 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /opt/java/openjdk
07-May-2024 09:52:50.478 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 17.0.9+9
07-May-2024 09:52:50.479 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Eclipse Adoptium
07-May-2024 09:52:50.479 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /usr/local/tomcat
07-May-2024 09:52:50.479 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/local/tomcat
07-May-2024 09:52:50.485 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
07-May-2024 09:52:50.485 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
07-May-2024 09:52:50.485 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
07-May-2024 09:52:50.486 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
07-May-2024 09:52:50.486 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
07-May-2024 09:52:50.486 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
07-May-2024 09:52:50.486 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
07-May-2024 09:52:50.486 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util=ALL-UNNAMED
07-May-2024 09:52:50.486 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
07-May-2024 09:52:50.486 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
07-May-2024 09:52:50.486 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms512M
07-May-2024 09:52:50.486 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx512M
07-May-2024 09:52:50.486 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat
07-May-2024 09:52:50.486 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat
07-May-2024 09:52:50.486 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
07-May-2024 09:52:50.489 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [2.0.6] using APR version [1.7.0].
07-May-2024 09:52:50.491 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 3.0.2 15 Mar 2022]
07-May-2024 09:52:50.897 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
07-May-2024 09:52:50.977 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [792] milliseconds
07-May-2024 09:52:51.003 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
07-May-2024 09:52:51.004 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/10.1.16]
[INFO ] 2024-05-07 09:53:00.972 [main] ContextLoaderListener - Memory: used=113MB; free=381MB; total=494MB; max=494MB
[INFO ] 2024-05-07 09:53:00.973 [main] ContextLoaderListener -
[INFO ] 2024-05-07 09:53:00.973 [main] ContextLoaderListener - Internet connection: true
[INFO ] 2024-05-07 09:53:00.973 [main] ContextLoaderListener - Authentication: file
[INFO ] 2024-05-07 09:53:00.973 [main] ContextLoaderListener - API key: false
[INFO ] 2024-05-07 09:53:00.973 [main] ContextLoaderListener - Session: local
[INFO ] 2024-05-07 09:53:00.973 [main] ContextLoaderListener - Data storage: file
[INFO ] 2024-05-07 09:53:00.973 [main] ContextLoaderListener - Caching: none
[INFO ] 2024-05-07 09:53:00.973 [main] ContextLoaderListener - Workspace archiving: false
[INFO ] 2024-05-07 09:53:00.973 [main] ContextLoaderListener - Workspace scope: relaxed
[INFO ] 2024-05-07 09:53:00.974 [main] ContextLoaderListener - Search: lucene
[INFO ] 2024-05-07 09:53:00.982 [main] ContextLoaderListener - Graphviz (dot): true
[INFO ] 2024-05-07 09:53:00.983 [main] ContextLoaderListener - DSL editor: false
[INFO ] 2024-05-07 09:53:00.983 [main] ContextLoaderListener - ***********************************************************************************
[INFO ] 2024-05-07 09:53:00.983 [main] ContextLoaderListener - MIT License
[INFO ] 2024-05-07 09:53:00.983 [main] ContextLoaderListener -
[INFO ] 2024-05-07 09:53:00.983 [main] ContextLoaderListener - Copyright (c) 2024 Structurizr Limited
[INFO ] 2024-05-07 09:53:00.983 [main] ContextLoaderListener -
[INFO ] 2024-05-07 09:53:00.983 [main] ContextLoaderListener - Permission is hereby granted, free of charge, to any person obtaining a copy
[INFO ] 2024-05-07 09:53:00.983 [main] ContextLoaderListener - of this software and associated documentation files (the "Software"), to deal
[INFO ] 2024-05-07 09:53:00.983 [main] ContextLoaderListener - in the Software without restriction, including without limitation the rights
[INFO ] 2024-05-07 09:53:00.983 [main] ContextLoaderListener - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
[INFO ] 2024-05-07 09:53:00.983 [main] ContextLoaderListener - copies of the Software, and to permit persons to whom the Software is
[INFO ] 2024-05-07 09:53:00.983 [main] ContextLoaderListener - furnished to do so, subject to the following conditions:
[INFO ] 2024-05-07 09:53:00.983 [main] ContextLoaderListener -
[INFO ] 2024-05-07 09:53:00.983 [main] ContextLoaderListener - The above copyright notice and this permission notice shall be included in all
[INFO ] 2024-05-07 09:53:00.984 [main] ContextLoaderListener - copies or substantial portions of the Software.
[INFO ] 2024-05-07 09:53:00.984 [main] ContextLoaderListener -
[INFO ] 2024-05-07 09:53:00.984 [main] ContextLoaderListener - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
[INFO ] 2024-05-07 09:53:00.984 [main] ContextLoaderListener - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
[INFO ] 2024-05-07 09:53:00.984 [main] ContextLoaderListener - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
[INFO ] 2024-05-07 09:53:00.984 [main] ContextLoaderListener - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
[INFO ] 2024-05-07 09:53:00.984 [main] ContextLoaderListener - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
[INFO ] 2024-05-07 09:53:00.984 [main] ContextLoaderListener - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
[INFO ] 2024-05-07 09:53:00.984 [main] ContextLoaderListener - SOFTWARE.
[INFO ] 2024-05-07 09:53:00.984 [main] ContextLoaderListener - ***********************************************************************************
07-May-2024 09:53:06.107 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/local/tomcat/webapps/ROOT.war] has finished in [15,026] ms
07-May-2024 09:53:06.109 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
07-May-2024 09:53:06.176 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [15198] milliseconds
[WARN ] 2024-05-07 10:10:04.319 [http-nio-8080-exec-5] PageNotFound - No mapping for GET /dashboard/signin/dashboard/signin
[WARN ] 2024-05-07 10:10:04.323 [http-nio-8080-exec-5] PageNotFound - No endpoint GET /dashboard/signin/dashboard/signin.

Idk why it redirects to /dashboard/signin/dashboard/signin

When I manually go to the url localhost/signin, it signs me in but takes me to this url: localhost/workspace/create/workspace/1 instead of localhost/dashboard

And when again I try to manually type and go to localhost/dashboard and create a new workspace it takes me to localhost/workspace/create/workspace/2 instead of localhost/workspace/2

I'm sinking in deep deep waters.... sob sob

simonbrowndotje commented 2 months ago

My guess would be that something in your environment (e.g. nginx) is rewriting URLs incorrectly.

messycoder101 commented 2 months ago

Thanks again for your reply @simonbrowndotje I am not using any tool service other than openshift. I'm using the same dockerfile that I tested on local. Not sure why this redirection/rewriting happens, but thanks, I'll keep debugging.

messycoder101 commented 1 month ago

Hello, we're not using nginx. Just deploying the image on docker container hosted on openshift. Still haven't been able to figure out what's going on :(