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

knowagej 7.4.x start error? #50

Closed zengxc-1996 closed 3 years ago

zengxc-1996 commented 3 years ago

centos 7.x:

image

I tried to use all versions of 7.4.x with this error.

I ran it in the compose file.

Now I think there's something wrong with the mirror image.

I don't know how to deal with it. I am looking forward to your help. Thank you very much.

zengxc-1996 commented 3 years ago

docker-compose up -d

start error:

ERROR: for knowage  Cannot start service knowage: OCI runtime create failed: invalid mount {Destination:[/home/knowage/apache-tomcat/resources] Type:bind Source:/var/lib/docker/volumes/6c3677804e0662777041a3354d3d260d4a29a2abf8811af788bcd1e6b6d8d821/_data Options:[rbind]}: mount destination [/home/knowage/apache-tomcat/resources] not absolute: unknown
ERROR: Encountered errors while bringing up the project.

image

kerny3d commented 3 years ago

Hi, could you please attach to this issue the original YAML file? In particular, we need to check the volumes section of the main container.

Trying with:

version: "3.1"
services:
  knowage:
    image: knowagelabs/knowage-server-docker:8.0.0-SNAPSHOT
    depends_on:
      - knowagedb
      - knowagecache
      - hazelcast
    ports:
      - "8080:8080"
    networks:
      - main
    environment:
      - DB_HOST=$DB_HOST
      - DB_PORT=$DB_PORT
      - DB_DB=$DB_DB
      - DB_USER=$DB_USER
      - DB_PASS=$DB_PASS

      - CACHE_DB_HOST=$CACHE_DB_HOST
      - CACHE_DB_PORT=$CACHE_DB_PORT
      - CACHE_DB_DB=$CACHE_DB_DB
      - CACHE_DB_USER=$CACHE_DB_USER
      - CACHE_DB_PASS=$CACHE_DB_PASS

      - HMAC_KEY=$HMAC_KEY
      - PASSWORD_ENCRYPTION_SECRET=$PASSWORD_ENCRYPTION_SECRET
      - PUBLIC_ADDRESS=localhost

      - HAZELCAST_HOSTS=hazelcast
      - HAZELCAST_PORT=5701
    volumes:
      - ./resources:/home/knowage/apache-tomcat/resources

Seems to work just fine.

chrisv-dev commented 3 years ago

I stumbled upon this issue too. I did git clone this repository (commit c31b055260dbadc637ecb96760e48504563efce9). I used this docker-compose file ./Knowage-Server-Docker/docker-compose.yml. Then I extended it by these lines for the volume (as suggested):

 volumes:
      - ./resources:/home/knowage/apache-tomcat/resources

but I am still getting this ERROR:

ERROR: for knowage-server-docker_knowage_1  Cannot start service knowage: OCI runtime create failed: invalid mount {Destination:[/home/knowage/apache-tomcat/resources] Type:bind Source:/var/lib/docker/volumes/1e2b1917c0a45f9db3f53d86d9f914c6293d278d9872de94653a182b8a0aca12/_data Options:[rbind]}: mount destination [/home/knowage/apache-tomcat/resources] not absolute: unknown

docker inspect shows:

        "Mounts": [
            {
                "Type": "bind",
                "Source": "/home/some/Knowage-Server-Docker/Knowage-Server-Docker/resources",
                "Destination": "/home/knowage/apache-tomcat/resources",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "volume",
                "Name": "1e2b1917c0a45f9db3f53d86d9f914c6293d278d9872de94653a182b8a0aca12",
                "Source": "/var/lib/docker/volumes/1e2b1917c0a45f9db3f53d86d9f914c6293d278d9872de94653a182b8a0aca12/_data",
                "Destination": "[/home/knowage/apache-tomcat/resources]",
                "Driver": "local",
                "Mode": "",
                "RW": true,
                "Propagation": ""
            }
        ],

It looks like adding the volumes in docker-compose added the Type: "bind" item, but what about the Type: "volume" item. i guess it get's created because of VOLUME [${TOMCAT_RESOURCES}] in ./Knowage-Server-Docker/Dockerfile ? I'm wondering if these brackets [ ] should be there in the "Destination": "[/home/knowage/apache-tomcat/resources]", part

kerny3d commented 3 years ago

Looking at official documentation it seems correct. The VOLUME keyword declares a volume but doesn't affect the runtime, as far as I know.

chrisv-dev commented 3 years ago

After rechecking my opinion is that the VOLUME line might be missing quotes ( So, maybe it should be VOLUME ["${TOMCAT_RESOURCES}"] instead of VOLUME [${TOMCAT_RESOURCES}]

i reproduced the same error message with this simple dockerfile:

FROM ubuntu:18.04
VOLUME [/tmp]

on my system and it disappeared when changing to

FROM ubuntu:18.04
VOLUME ["/tmp"]
zengxc-1996 commented 3 years ago

After rechecking my opinion is that the VOLUME line might be missing quotes ( So, maybe it should be VOLUME ["${TOMCAT_RESOURCES}"] instead of VOLUME [${TOMCAT_RESOURCES}]

i reproduced the same error message with this simple dockerfile:

FROM ubuntu:18.04
VOLUME [/tmp]

on my system and it disappeared when changing to

FROM ubuntu:18.04
VOLUME ["/tmp"]

Hi, I have just tried it, and you are right. I think it is the key to the problem.

zengxc-1996 commented 3 years ago

Looking at official documentation it seems correct. The VOLUME keyword declares a volume but doesn't affect the runtime, as far as I know.

Hi, I hope you can modify the dockerfile as soon as possible. It's not working all the time, which makes me very upset.

If you have any other questions, please feel free to contact me.

Version 7.4.x is what I am using, please give priority to it, thank you.

kerny3d commented 3 years ago

I'm generating the 7.4.* images: it will take some times.

zengxc-1996 commented 3 years ago

I'm generating the 7.4.* images: it will take some times.

Hi, Thank you for your help.

After that, I will try again.

Keep in touch, man.

kerny3d commented 3 years ago

All 7.4 images deployed. Could you please pull the images again and try it out?

zengxc-1996 commented 3 years ago

I'm going to have a try now. Sorry for not replying in time because I was busy before.

Test results:

Man, good job. He looks great.

7.4: image

7.4.6: image

image

chendelin1982 commented 3 years ago

Great job @kerny3d