Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 2.6.0 crashes in docker #18

Open
andrese02 opened this issue Feb 1, 2023 · 4 comments
Open

Version 2.6.0 crashes in docker #18

andrese02 opened this issue Feb 1, 2023 · 4 comments

Comments

@andrese02
Copy link

There seems to be multiple errors occuring in the docker containers that crash the nodes and making the whole system unusable in docker setup.

Environment:

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:        22.04
Codename:       jammy
java --version
java 11.0.17 2022-10-18 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.17+10-LTS-269)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.17+10-LTS-269, mixed mode)
docker --version
Docker version 20.10.17, build 100c70180f

Compiling and image building is done in taking the shortcuts mentioned in #17

The containers seem to start up fine (docker compose up), but upon initialisation both application servers (siga-01, siga-02) crash.
20230201_02_00_log.log

Database container keeps on running it is possible to connect to it, but the database siga_db (referenced in the docker file) is completely empty.

Assuming that docker is not usable at this version.

@nibbydev
Copy link
Contributor

nibbydev commented Feb 2, 2023

From the logs provided I can see that the siga-01 and siga-02 instances are unable to connect to the siga-db container. I wasn't able to reproduce this naturally, but I did get the the exact same error messages when I changed the spring.datasource.url properties in the docker-compose.yaml file to gibberish:

image

Could it be that something in your docker files has changed?

@andrese02
Copy link
Author

Thank you for the feedback.

I did change the docker configuration, as i was running postgres on the same host under the default port (5432). I mapped it to 5433 and changed the configuration accordingly.
Howevere i wasn't sure if this is somehow related to the crashes or not as i believe that the conf was correct.

I did some extensive testing and i actually managed to get the docker containers work (at least they werent crashing anymore).
Final change done was to remove the port from connection string for all cases and have the postgres to use default port.

docker-compse.yml

services
[SNIP]
  siga-01:
    image: siga-webapp:latest
    environment:
	  [SNIP]
	  - spring.datasource.driver-class-name=org.postgresql.Driver
	  # WAS: - spring.datasource.url=jdbc:postgresql://siga-db:5432/siga_db
          - spring.datasource.url=jdbc:postgresql://siga-db/siga_db
[SNIP]
  siga-02:
    image: siga-webapp:latest
    environment:
	  [SNIP]
          - spring.datasource.driver-class-name=org.postgresql.Driver
	  # WAS: - spring.datasource.url=jdbc:postgresql://siga-db:5432/siga_db
          - spring.datasource.url=jdbc:postgresql://siga-db/siga_db
[SNIP]

I do not know, what is the cause of this. It could be mu local setup, it could be configuration of the postgres host, it could be network related, etc.

I'll have to reconfigure the local postgres in the hostmachine, after that i can get back to report, are the containers actually working or not.

@naare
Copy link
Contributor

naare commented Feb 3, 2023

Please be aware that we provide Docker files for development and testing purposes only!

https://github.com/open-eid/SiGa#running-siga-with-docker

You must assess and ensure the suitability for other purposes (production usage) yourself.

@andrese02
Copy link
Author

I am aware that docker is only suitable for testing and development. I am running and developing a web application that uses live SiGa in its signing flow. However, due to historical reasons, this application is not (yet) dockerised and it needs the postgres to work. Luckily, that app can connect to any port the postgres is configured to.

I can confirm, that docker version is usable and runnabale, if the following modifications are done:

  • Remove the port from spring datasource resource string (it becomes spring.datasource.url=jdbc:postgresql://siga-db/siga_db)
  • Have the external app connect to https://localhost:8443/ (instead of https://localhost:8443/siga). I think the nginx configuration needs to be altered to have /sigaas main entrypoint, but i didn't test it.

I did not test the demo application so i do not know if this works as described or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants