Decathlon / ara

Agile Regression Analyzer
Apache License 2.0
78 stars 19 forks source link

local installation does not work on Ubuntu (with Docker and docker compose) #222

Closed bbutel closed 4 years ago

bbutel commented 4 years ago

Describe the bug On documentation for Mac (or a GNU/Linux PC), it is written: after retrieve docker-compose.yaml file, run "docker-compose up" failed In console log, i've got : "Error: Could not find or load main class org.springframework.boot.loader.PropertiesLauncher"

Entire log provided in attachment. Also note that some link into the document are dead: https://github.com/Decathlon/ara/blob/version/4.1.0/docker/README.adoc#head error.log

dktsni commented 4 years ago

Hi @bbutel !

Thanks for your interest in ARA and sorry for the lack of response for now, busy period.

Since the 4.1.0 version, we've applied a fix to the docker's entrypoint. Could you try with the new version of the docker images (or re run your docker-compose up which will download the new version of the images) ?

bbutel commented 4 years ago

Still not working but error is not the same (see attached logs). When I got to http://localhost:8080, nothing happens

log.txt

dktsni commented 4 years ago

Hmm, it seems that your server is unable to communicate with your database...

Could you please do a

docker-compose down
docker ps -a

And give me the output of this ?

I'll investigate also on my own computer and keep you in touch

bbutel commented 4 years ago

Before running "docker-compose down": docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 550c97c57c64 decathlon/ara-server:latest "sh /opt/ara/entrypo…" 40 seconds ago Exited (137) 5 seconds ago pocreport_server_1 296920fc2c48 decathlon/ara-db:latest "docker-entrypoint.s…" 41 seconds ago Exited (0) 3 seconds ago pocreport_db_1

After running"docker-compose down": docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

dktsni commented 4 years ago

Interesting !

Can you try again a docker-compose up after running a docker-compose down ?

Note : When you do a Ctrl+C in a terminal after a docker-compose up it will not stop the containers, you have to manually do a docker-compose down everytime 🙂

dktsni commented 4 years ago

Hello again @bbutel !

After doing a docker-compose up, could run the following commands in another terminal please :

docker inspect --format='{{print .Image 0}}' app_db_1
docker inspect --format='{{print .Image 0}}' app_server_1

and give me the output of these two commands ?

I suspect that the docker-compose command doesn't download the newer version of the images and keep the one you have locally :)

The retrieved SHA256 should be :

bbutel commented 4 years ago
docker inspect --format='{{print .Image 0}}' app_db_1
Error: No such object: app_db_1
docker inspect --format='{{print .Image 0}}' app_server_1
Error: No such object: app_server_1
docker ps
CONTAINER ID        IMAGE                         COMMAND                  CREATED              STATUS              PORTS                    NAMES
3d344a670ec6        decathlon/ara-server:latest   "sh /opt/ara/entrypo…"   About a minute ago   Up 59 seconds       0.0.0.0:8080->8080/tcp   pocreport_server_1
6058530475ff        decathlon/ara-db:latest       "docker-entrypoint.s…"   About a minute ago   Up About a minute   0.0.0.0:3306->3306/tcp   pocreport_db_1
bbutel commented 4 years ago

docker inspect --format='{{print .Image 0}}' pocreport_server_1 sha256:bcc614e8b36011d515c6ecba182e46a8e021052a47bc427c77db1735e05dd9600 docker inspect --format='{{print .Image 0}}' pocreport_db_1 sha256:8ff2f19dc723cfe7289799016b41d0c27a0f0224ed1a5ae5f2fb134078a4eb190

indeed, sha are not the same

dktsni commented 4 years ago

Could you try update the docker-compose file and replace the latest (in line 8 and 16) by 4.1.0 and retry please ?

bbutel commented 4 years ago

Done. After updating compose file, both images are downloaded but docker-compose up ends with the same behavior as before.

docker-compose up > error_log.txt Creating network "pocreport_default" with the default driver Creating pocreport_db_1 ... Creating pocreport_db_1 ... done Creating pocreport_server_1 ... Creating pocreport_server_1 ... done

error_log.txt

dktsni commented 4 years ago

Ok, the error log shows that the Host host.docker.internal can't be resolved (which is the DNS used by docker-compose). It seems that this is an issue on older version of Docker for mac : https://github.com/docker/for-linux/issues/264#issuecomment-389371854

What's the version of your Docker for mac ? (In your tray, click on the Docker icon, and in the menu click on About Docker Desktop) I'm interested in the following informations :

dktsni commented 4 years ago

For information I'm unable to reproduce the error with the following version of docker for mac

Screenshot 2020-01-09 at 15 26 52
bbutel commented 4 years ago

`docker version Client: Docker Engine - Community Version: 19.03.5 API version: 1.40 Go version: go1.12.12 Git commit: 633a0ea838 Built: Wed Nov 13 07:29:52 2019 OS/Arch: linux/amd64 Experimental: false

Server: Docker Engine - Community Engine: Version: 19.03.5 API version: 1.40 (minimum version 1.12) Go version: go1.12.12 Git commit: 633a0ea838 Built: Wed Nov 13 07:28:22 2019 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.2.10 GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339 runc: Version: 1.0.0-rc8+dev GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657 docker-init: Version: 0.18.0 GitCommit: fec3683 `

Note that I'm not on Mac but on Ubuntu

dktsni commented 4 years ago

Ok 😄

Could you check that the line docker.host.internal appears in your /etc/hosts file (Host and container) ?

I think that this is not a problem relative strictly to ARA but to Docker itself 🤔 Here I find someone who also got your problem and fix it (with a workaround) : https://dev.to/bufferings/access-host-from-a-docker-container-4099

I'll try with an Ubuntu OS if I reproduce your error

dktsni commented 4 years ago

Hi @bbutel !

Just to let you know : I managed to reproduce your error on a Ubuntu 18.04 LTS VM.

I'll look into it a little deeper

dktsni commented 4 years ago

Hi again @bbutel !

I figured it out ! Like I thought, the bug was not in ARA but in Docker itself. It seems that the host.docker.internal DNS isn't implemented in Docker for GNU/Linux (see https://github.com/moby/moby/pull/40007).

As a workaround, you can edit your docker-compose.yml file and replace the host.docker.internal with this IP address 172.17.0.1

On my side, I will update the docs.

dktsni commented 4 years ago

Regarding the dead link on https://github.com/Decathlon/ara/blob/version/4.1.0/docker/README.adoc#head, it's because those path are relatives and the branch version/4.1.0 is now deleted. You can refresh your browser and check the doc directly on master or on version/5.0.0

bbutel commented 4 years ago

Thx, its works