KnowageLabs / Knowage-Server-Docker

Docker Image packaging for Knowage Server https://www.knowage-suite.com
GNU Affero General Public License v3.0
66 stars 77 forks source link

Redirect to knowage-vue doesn't work #47

Open taurus227 opened 3 years ago

taurus227 commented 3 years ago

I managed to get it to run with docker-compose up -d by making the following changes:

$ git diff
diff --git a/Knowage-Server-Docker/docker-compose.yml b/Knowage-Server-Docker/docker-compose.yml
index 1c0f791..c8916a7 100644
--- a/Knowage-Server-Docker/docker-compose.yml
+++ b/Knowage-Server-Docker/docker-compose.yml
@@ -6,7 +6,7 @@ services:
       - knowagedb
       - knowagecache
     ports:
-      - "8080:8080"
+      - "8081:8080"
     networks:
       - main
     environment:
diff --git a/Knowage-Server-Docker/server.xml b/Knowage-Server-Docker/server.xml
index c0c552f..56559f0 100644
--- a/Knowage-Server-Docker/server.xml
+++ b/Knowage-Server-Docker/server.xml
@@ -28,6 +28,7 @@
                        to authenticate users -->
                <Environment name="resource_path" type="java.lang.String" value="${catalina.home}/resources"/>
                <Environment name="service_url" type="java.lang.String" value="http://localhost:8080/knowage"/>
+               <Environment name="host_url" type="java.lang.String" value="http://my.domain.com:11081"/>
                <Environment name="sso_class" type="java.lang.String" value="it.eng.spagobi.services.common.JWTSsoService"/>
                <Environment description="HMAC key" name="hmacKey" type="java.lang.String" value="__HMAC-key__"/>
                <Environment description="File for security encryption location" name="password_encryption_secret" type="java.lang.String" value="${catalina.home}/conf/passwordEncryptionSecret"/>
@@ -88,7 +89,7 @@
                        sslProtocol="TLS" /> -->

                <!-- Define an AJP 1.3 Connector on port 8009 -->
-               <Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
+               <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" secretRequired="false"/>

                <!-- An Engine represents the entry point (within Catalina) that processes

Our external port 11081 is redirected to 8081 on this host. The secretRequired="false" added to AJP was needed to fix this exception:

30-Apr-2021 05:58:53.721 SEVERE [main] org.apache.catalina.core.StandardService.startInternal Failed to start connector [Connector[AJP/1.3-8009]]
        Caused by: java.lang.IllegalArgumentException: The AJP Connector is configured with secretRequired="true" but the secret attribute is either null or "". This combination is not valid.

This got me to the login screen. The host_url was an attempt to fix the problem described below, but it didn't do anything.

After I login as biadmin, I get redirected to http://my.domain.com:11081/knowage-vue and get the error:

The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

image

How to fix this?

kerny3d commented 3 years ago

Hi Robert,

thank you for you report: we have seen the same problem in our test environments and you are working on it.

As you can guess, the -SNAPSHOT version could have this type of problem. In particular I will check the content of the image because I suppose that the CD process is having a wrong behavior.

Just a note: the host_url variable is deprecated and we did a lot to remove all references from our code.

I will evaluate your patch but I'm pretty sure we already have problems before the runtime.

kerny3d commented 3 years ago

Hi Robert,

if you pull the new 8.0.0-SNAPSHOT I think we have resolved the problem.

taurus227 commented 3 years ago

OK, so now it's running, everything is up: image

I cannot see any errors in the console output of docker-compose up, but if I try to log in as biadmin I still get redirected to /knowage-vue and all I see is this:

image

Also, it keeps outputting the same 6 messages from knowager_1 and knowagepython_1 in what seems like an infinite loop:

knowagepython_1  | [2021-05-01 01:58:46 +0000] [12] [DEBUG] HEAD /dataset/libraries
knowagepython_1  | 127.0.0.1 - - [01/May/2021:01:58:46 +0000] "HEAD /dataset/libraries HTTP/1.1" 200 0 "-" "Wget/1.20.1 (linux-gnu)"
knowage_1        | 01-May-2021 01:58:48.215 INFO [localhost-startStop-3] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/home/knowage/apache-tomcat/webapps/knowage] has finished in [17,628] ms
knowage_1        | 01-May-2021 01:58:48.220 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
knowage_1        | 01-May-2021 01:58:48.237 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-127.0.0.1-8009"]
knowage_1        | 01-May-2021 01:58:48.275 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 31117 ms
knowager_1       |  chr [1:29, 1:16] "base" "boot" "class" "cluster" "codetools" "compiler" ...
knowager_1       |  - attr(*, "dimnames")=List of 2
knowager_1       |   ..$ : chr [1:29] "base" "boot" "class" "cluster" ...
knowager_1       |   ..$ : chr [1:16] "Package" "LibPath" "Version" "Priority" ...
knowagepython_1  | [2021-05-01 01:58:51 +0000] [17] [DEBUG] HEAD /dataset/libraries
knowagepython_1  | 127.0.0.1 - - [01/May/2021:01:58:51 +0000] "HEAD /dataset/libraries HTTP/1.1" 200 0 "-" "Wget/1.20.1 (linux-gnu)"
knowager_1       |  chr [1:29, 1:16] "base" "boot" "class" "cluster" "codetools" "compiler" ...
knowager_1       |  - attr(*, "dimnames")=List of 2
knowager_1       |   ..$ : chr [1:29] "base" "boot" "class" "cluster" ...
knowager_1       |   ..$ : chr [1:16] "Package" "LibPath" "Version" "Priority" ...
knowagepython_1  | [2021-05-01 01:58:56 +0000] [25] [DEBUG] HEAD /dataset/libraries
knowagepython_1  | 127.0.0.1 - - [01/May/2021:01:58:56 +0000] "HEAD /dataset/libraries HTTP/1.1" 200 0 "-" "Wget/1.20.1 (linux-gnu)"
knowager_1       |  chr [1:29, 1:16] "base" "boot" "class" "cluster" "codetools" "compiler" ...
knowager_1       |  - attr(*, "dimnames")=List of 2
knowager_1       |   ..$ : chr [1:29] "base" "boot" "class" "cluster" ...
knowager_1       |   ..$ : chr [1:16] "Package" "LibPath" "Version" "Priority" ...
knowagepython_1  | [2021-05-01 01:59:02 +0000] [14] [DEBUG] HEAD /dataset/libraries
knowagepython_1  | 127.0.0.1 - - [01/May/2021:01:59:02 +0000] "HEAD /dataset/libraries HTTP/1.1" 200 0 "-" "Wget/1.20.1 (linux-gnu)"
kerny3d commented 3 years ago

Logs from knowager_1 and knowagepython_1 are perfectly normal because of the health checks in Python's Dockerfile and R's Dockerfile.

About the UI, you are using a custom hostname different from localhost:8080, isn't it? We will investigate, probably you could see some errors in your browser's console.

giseproiud commented 3 years ago

Same error:

Console error: Uncaught (in promise) TypeError: Cannot read property 'status' of undefined at axios.js:25

docker-compose.yml

version: "3.1" services: knowage: image: knowagelabs/knowage-server-docker:8.0.0-SNAPSHOT depends_on:

volumes: db: cache:

.env DB_HOST=knowagedb DB_PORT=3306 DB_DB=knowagedb DB_USER=knowageuser DB_PASS=knowagepassword CACHE_DB_HOST=knowagecache CACHE_DB_PORT=3306 CACHE_DB_DB=knowagecache CACHE_DB_USER=knowageuser CACHE_DB_PASS=knowagepassword HMAC_KEY=abc123 PASSWORD_ENCRYPTION_SECRET=def456

Previously there was an error related to quartz, but executing "the creation scripts provided for the DBMS in use" fixed it. At this moment the logs do not show errors, but

image

zengxc-1996 commented 3 years ago

I also encountered this problem during deployment. How can I solve it?

image

kerny3d commented 3 years ago

Thank you for all your report.

Please remember that the 8.0.0-SNAPSHOT version is a development version and we use it to discover and work on issues.

And please remember that if you want a production-ready version please use a non SNAPSHOT version.

zengxc-1996 commented 3 years ago

Thank you for your reminding. It is very important to me.

Should I use this mirror: docker pull knowagelabs/knowage-server-docker:latest Instead of: docker pull knowagelabs/knowage-server-docker:8.0.0-SNAPSHOT

kerny3d commented 3 years ago

I would suggest you the last non-SNAPSHOT major tag like 7.4 then: docker pull knowagelabs/knowage-server-docker:7.4

zengxc-1996 commented 3 years ago

Thank you for your advice. I'm trying my best.