naturalsolutions / ecoSecrets

ecoSecrets is a web application which enables users to manage their camera traps data
https://demo.ecosecrets.natural-solutions.eu/
GNU General Public License v3.0
15 stars 6 forks source link

Problème installation v0.1.0 #50

Open geobrun opened 7 months ago

geobrun commented 7 months ago

Bonjour,

Je rencontre un problème d'installation avec la nouvelle version de GeoCam. Voici le message d'erreur que je reçois lors de l'exécution de la commande ./scripts/docker.sh up -d :

 ✔ Container geonature-annotation-doc-1       Running                                                                               0.0s 
 ✔ Container geonature-annotation-taxapi-1    Started                                                                              23.4s 
 ✘ Container geonature-annotation-minio-1     Error                                                                                11.5s 
 ✔ Container geonature-annotation-db-1        Healthy                                                                              13.6s 
 ✘ Container geonature-annotation-keycloak-1  Error                                                                                 4.9s 
 ✔ Container geonature-annotation-api-1       Recreated                                                                             7.2s 
 ✔ Container geonature-annotation-frontend-1  Recreated                                                                             3.9s 
 ✔ Container geonature-annotation-traefik-1   Recreated                                                                             2.9s 

Je n'ai rien trouvé de particulier dans dans la partie "minio". Par contre, quand je lance la commande ./scripts/docker.sh logs keycloak, j'ai ce message d'erreur qui s'affiche :

keycloak-1  | 2023-11-28 10:27:18,183 INFO  [org.infinispan.SERVER] (keycloak-cache-init) ISPN005054: Native IOUring transport not available, using NIO instead: io.netty.incubator.channel.uring.IOUring
keycloak-1  | 2023-11-28 10:27:18,290 WARN  [io.quarkus.vertx.http.runtime.VertxHttpRecorder] (main) The X-Forwarded-* and Forwarded headers will be considered when determining the proxy address. This configuration can cause a security issue as clients can forge requests and send a forwarded header that is not overwritten by the proxy. Please consider use one of these headers just to forward the proxy address in requests.
keycloak-1  | 2023-11-28 10:27:18,299 WARN  [io.agroal.pool] (agroal-11) Datasource '<default>': Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
keycloak-1  | 2023-11-28 10:27:18,349 WARN  [org.infinispan.PERSISTENCE] (keycloak-cache-init) ISPN000554: jboss-marshalling is deprecated and planned for removal
keycloak-1  | 2023-11-28 10:27:18,370 WARN  [org.infinispan.CONFIG] (keycloak-cache-init) ISPN000569: Unable to persist Infinispan internal caches as no global state enabled
keycloak-1  | 2023-11-28 10:27:18,387 INFO  [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000556: Starting user marshaller 'org.infinispan.jboss.marshalling.core.JBossUserMarshaller'
keycloak-1  | 2023-11-28 10:27:19,306 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to start server in (development) mode
keycloak-1  | 2023-11-28 10:27:19,306 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to obtain JDBC connection
keycloak-1  | 2023-11-28 10:27:19,307 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
keycloak-1  | 2023-11-28 10:27:19,307 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Connection refused
keycloak-1  | 2023-11-28 10:27:19,307 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) For more details run the same command passing the '--verbose' option. Also you can use '--help' to see the details about the usage of the particular command.

En général, je règle ce genre de souci via le fichier pg_hba.conf, mais là, je n'ai pas de dossier /etc/postgres dans ma VM. La BDD doit sûrement s'installer ailleurs (via Alembic peut-être ?). A moins que mon souci ne provienne d'un simple paramètre mal renseigné dans le fichier .env ? J'ai indiqué une adresse du type "192.168.x.x" pour ${DOMAIN} et "localhost" pour ${DB_ADDR}. Le port de la BDD n'est pas demandé et celui que j'ai indiqué pour ${HTTP_HTTPS_PORT} est le "8889".

Une idée pour résoudre ce problème ?

mvergez commented 7 months ago

Salut @geobrun,

Je pense avoir compris ton souci, je vais essayer d'expliquer le plus clairement possible.

En fait, quand tu lances ./scripts/docker.sh up -d (qui lance docker-compose finalement), tu crées plusieurs containers dont un pour la base de données (un container contenant un cluster postgresql). Or, en général tu ne peux pas te connecter à un container depuis ta machine via un port sauf si tu l'ouvres. Mais, même si le port est ouvert, il n'est pas conseillé d'y accéder depuis d'autres containers.

Aussi, lors de cette même commande, un réseau interne entre les containers est créé. Il permet aux containers d'accéder aux autres containers via leur adresse IP directement. Comme cette adresse change, docker-compose te facilite la tâche en te permettant de spécifier le nom du container (en réalité du service mais je simplifie) au lieu de l'adresse IP. Dans le cadre de postgresql le nom du container (du service) est "db" donc pour accéder à la base de données postgres depuis un autre container il faut lui donner l'adresse "db" ce qui donnerait pour l'adresse de postgres : postgresql://mon_user:mon_mdp@db/ma_db. et non pas postgresql://mon_user:mon_mdp@localhost/ma_db.

C'est pour cela que dans ton container keycloak tu as l'erreur suivante : Connection to localhost:5432 refused.

Il faut donc changer dans ton fichier .env: DB_ADDR=db

N'hésite pas à revenir vers moi si tout cela n'est pas clair. Il faudra qu'on mette à jour la documentation pour ça.

J'espère que cela va fonctionner, tiens moi au courant.


PS1 : Si jamais tu veux que GeoCam accède à un cluster postgres externe tu peux néanmoins modifier toutes les variables d'environnement pour qu'il s'y connecte. Dans ce cas, il y aura quand même création d'un container postgres mais il ne sera pas utilisé. Il est possible de modifier les fichiers docker-compose.yml pour l'en empêcher.


PS2 : C'est donc normal que tu n'aies pas de pg_hba.conf sur ta VM car ce dernier est dans le container postgres.

geobrun commented 7 months ago

Merci pour tes explications @mvergez : je pense du coup avoir compris le concept des containers, même si je n'en maîtrise pas encore toutes les facettes !

Du coup, j'ai fait la modification dont tu parlais pour la variable DB_ADDR. J'ai maintenant une autre erreur : j'ai remis tous les paramètres de connexion à la BDD comme dans le fichier d'exemple, mais cette erreur apparaît toujours. La voici, je t'ai juste mis les dernières lignes :

keycloak-1  | 2023-12-04 10:36:15,595 INFO  [org.infinispan.SERVER] (keycloak-cache-init) ISPN005054: Native IOUring transport not available, using NIO instead: io.netty.incubator.channel.uring.IOUring
keycloak-1  | 2023-12-04 10:36:15,635 WARN  [org.infinispan.PERSISTENCE] (keycloak-cache-init) ISPN000554: jboss-marshalling is deprecated and planned for removal
keycloak-1  | 2023-12-04 10:36:15,781 WARN  [io.quarkus.vertx.http.runtime.VertxHttpRecorder] (main) The X-Forwarded-* and Forwarded headers will be considered when determining the proxy address. This configuration can cause a security issue as clients can forge requests and send a forwarded header that is not overwritten by the proxy. Please consider use one of these headers just to forward the proxy address in requests.
keycloak-1  | 2023-12-04 10:36:15,796 WARN  [org.infinispan.CONFIG] (keycloak-cache-init) ISPN000569: Unable to persist Infinispan internal caches as no global state enabled
keycloak-1  | 2023-12-04 10:36:15,864 INFO  [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000556: Starting user marshaller 'org.infinispan.jboss.marshalling.core.JBossUserMarshaller'
keycloak-1  | 2023-12-04 10:36:16,829 INFO  [org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory] (main) Node name: node_800475, Site name: null
keycloak-1  | 2023-12-04 10:36:16,862 WARN  [io.agroal.pool] (agroal-11) Datasource '<default>': FATAL: password authentication failed for user "dbuser"
keycloak-1  | 2023-12-04 10:36:17,026 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to start server in (development) mode
keycloak-1  | 2023-12-04 10:36:17,026 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to obtain JDBC connection
keycloak-1  | 2023-12-04 10:36:17,027 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: FATAL: password authentication failed for user "dbuser"
keycloak-1  | 2023-12-04 10:36:17,027 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) For more details run the same command passing the '--verbose' option. Also you can use '--help' to see the details about the usage of the particular command.

J'ai mis un mot de passe ne contenant que des lettres et des chiffres car j'ai déjà eu un souci avec des caractères spéciaux avec GeoNature.

mvergez commented 7 months ago

Salut @geobrun !

Hum, est-ce que tu avais déjà une base de données de créée avant ? Ou tu repars de zéro ?

  1. Si tu en avais une avant, il faut mettre le mot de passe que tu avais avant. J'espère que tu l'avais quelque part. Sinon, je vais essayer de regarder aujourd'hui comment le récupérer, ça doit pas être sorcier.
  2. Si tu repars de zéro il faut détruire la base de donnée de geocam.
    • Docker a un système de "volume" qui permet de persister la donnée d'un container (qui est par définition non persistante).
    • Quand tu mets à jour geocam, tu conserves ces volumes, c'est le but. Nous avons créé ces volumes pour persister les données de minio (stockage s3 pour les images et vidéos) et les données de la base de donnée (postgresql).
    • Pour la détruire tu dois faire : ./scripts/docker.sh down -v, cela permettra de détruire tous les volumes. Attention, cela détruira aussi le volume où sont stockées tes images. Donc à voir si les données que tu avais dans ton geocam étaient des données de tests ou pas !
    • Tu auras juste à faire un ./scripts/docker.sh up -d, cela remontera tous les containers et les volumes, donc le container postgres se chargera de recréer

J'espère que cela t'aidera et que j'ai été clair, n'hésite pas si tu as besoin de plus de précisions :) Tu vas devenir expert en containers après ;)

geobrun commented 7 months ago

Merci pour les explications, mais je ne suis pas sûr d'avoir tout compris !

Voilà ce que j'ai fait pour installer la nouvelle version de GeoCam : j'ai supprimé la VM où l'ancienne version de GeoCam était installée (il n'y avait pas de données dedans, juste des tests). J'ai réinstallé une nouvelle VM où j'ai tenté plusieurs fois l'installation de GeoCam. A chaque tentative, j'ai seulement supprimé le dossier racine "geocam" de mon utilisateur. J'aurais pensé que cela aurait été suffisant, mais de ce que je comprends de ton message, c'est que ce n'est peut-être pas le cas ?

Du coup, dans mon dernier test, j'ai :

Voilà les messages que je reçois maintenant :

[+] Running 12/12
 ✔ Network geonature-annotation_annotation_nw  Created                                                                                                  1.6s 
 ✔ Network geonature-annotation_default        Created                                                                                                  1.3s 
 ✔ Volume "geonature-annotation_db_data"       Created                                                                                                  0.3s 
 ✔ Volume "geonature-annotation_minio_data"    Created                                                                                                  0.3s 
 ✔ Container geonature-annotation-doc-1        Started                                                                                                  5.6s 
 ✔ Container geonature-annotation-taxapi-1     Started                                                                                                  5.2s 
 ✔ Container geonature-annotation-minio-1      Started                                                                                                  5.6s 
 ✘ Container geonature-annotation-db-1         Error                                                                                                    5.6s 
 ✔ Container geonature-annotation-keycloak-1   Created                                                                                                  2.2s 
 ✔ Container geonature-annotation-api-1        Created                                                                                                  2.3s 
 ✔ Container geonature-annotation-frontend-1   Created                                                                                                 57.6s 
 ✔ Container geonature-annotation-traefik-1    Created   
dependency failed to start: container geonature-annotation-db-1 is unhealthy
db-1  | The files belonging to this database system will be owned by user "postgres".
db-1  | This user must also own the server process.
db-1  | 
db-1  | The database cluster will be initialized with locale "en_US.utf8".
db-1  | The default database encoding has accordingly been set to "UTF8".
db-1  | The default text search configuration will be set to "english".
db-1  | 
db-1  | Data page checksums are disabled.
db-1  | 
db-1  | fixing permissions on existing directory /var/lib/postgresql/data ... ok
db-1  | creating subdirectories ... ok
db-1  | selecting dynamic shared memory implementation ... posix
db-1  | selecting default max_connections ... 100
db-1  | selecting default shared_buffers ... 128MB
db-1  | selecting default time zone ... UTC
db-1  | creating configuration files ... ok
db-1  | running bootstrap script ... ok
db-1  | sh: locale: not found
db-1  | 2023-12-06 10:58:24.728 UTC [30] WARNING:  no usable system locales were found
db-1  | performing post-bootstrap initialization ... ok
db-1  | initdb: warning: enabling "trust" authentication for local connections
db-1  | You can change this by editing pg_hba.conf or using the option -A, or
db-1  | --auth-local and --auth-host, the next time you run initdb.
db-1  | syncing data to disk ... ok
db-1  | 
db-1  | 
db-1  | Success. You can now start the database server using:
db-1  | 
db-1  |     pg_ctl -D /var/lib/postgresql/data -l logfile start
db-1  | 
db-1  | waiting for server to start....2023-12-06 11:00:25.868 UTC [112] LOG:  starting PostgreSQL 14.10 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924, 64-bit
db-1  | 2023-12-06 11:00:26.016 UTC [112] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db-1  | 2023-12-06 11:00:26.442 UTC [113] LOG:  database system was shut down at 2023-12-06 10:58:25 UTC
db-1  | .2023-12-06 11:00:26.611 UTC [112] LOG:  database system is ready to accept connections
db-1  |  done
db-1  | server started

On dirait qu'il n'y a plus d'erreur côté BDD, c'est curieux ? Du coup, par curiosité, j'ai relancé une seconde fois l'installation sans faire d'autres modifications et voilà ce que j'obtiens cette fois :

 ✔ Container geonature-annotation-doc-1       Running                                                                                                   0.0s 
 ✘ Container geonature-annotation-minio-1     Error                                                                                                     0.0s 
 ✔ Container geonature-annotation-taxapi-1    Running                                                                                                   0.0s 
 ✔ Container geonature-annotation-db-1        Healthy                                                                                                   0.0s 
 ✘ Container geonature-annotation-keycloak-1  Error  
minio-1  | Formatting 1st pool, 1 set(s), 1 drives per set.
minio-1  | WARNING: Host local has more than 0 drives of set. A host failure will result in data becoming unavailable.
minio-1  | MinIO Object Storage Server
minio-1  | Copyright: 2015-2023 MinIO, Inc.
minio-1  | License: GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>
minio-1  | Version: RELEASE.2023-11-20T22-40-07Z (go1.21.4 linux/amd64)
minio-1  | 
minio-1  | Status:         1 Online, 0 Offline. 
minio-1  | S3-API: http://172.22.0.4:9000  http://127.0.0.1:9000 
minio-1  | Console: http://172.22.0.4:9001 http://127.0.0.1:9001 
minio-1  | 
minio-1  | Documentation: https://min.io/docs/minio/linux/index.html
minio-1  | Warning: The standard parity is set to 0. This can lead to data loss.
keycloak-1  | Updating the configuration and installing your custom providers, if any. Please wait.
keycloak-1  | 2023-12-06 11:13:21,175 INFO  [org.keycloak.common.Profile] (main) Preview features enabled: scripts
keycloak-1  | 2023-12-06 11:18:15,864 INFO  [io.quarkus.deployment.QuarkusAugmentor] (main) Quarkus augmentation completed in 295991ms
keycloak-1  | 2023-12-06 11:18:17,296 INFO  [org.keycloak.common.Profile] (main) Preview features enabled: scripts
keycloak-1  | 2023-12-06 11:18:18,838 INFO  [org.keycloak.quarkus.runtime.hostname.DefaultHostnameProvider] (main) Hostname settings: Base URL: <unset>, Hostname: <request>, Strict HTTPS: false, Path: <request>, Strict BackChannel: false, Admin URL: <unset>, Admin: <request>, Port: -1, Proxied: true
keycloak-1  | 2023-12-06 11:18:21,497 WARN  [io.quarkus.agroal.runtime.DataSources] (main) Datasource <default> enables XA but transaction recovery is not enabled. Please enable transaction recovery by setting quarkus.transaction-manager.enable-recovery=true, otherwise data may be lost if the application is terminated abruptly
keycloak-1  | 2023-12-06 11:18:22,699 INFO  [org.infinispan.SERVER] (keycloak-cache-init) ISPN005054: Native IOUring transport not available, using NIO instead: io.netty.incubator.channel.uring.IOUring
keycloak-1  | 2023-12-06 11:18:22,739 WARN  [org.infinispan.PERSISTENCE] (keycloak-cache-init) ISPN000554: jboss-marshalling is deprecated and planned for removal
keycloak-1  | 2023-12-06 11:18:22,890 WARN  [org.infinispan.CONFIG] (keycloak-cache-init) ISPN000569: Unable to persist Infinispan internal caches as no global state enabled
keycloak-1  | 2023-12-06 11:18:22,995 INFO  [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000556: Starting user marshaller 'org.infinispan.jboss.marshalling.core.JBossUserMarshaller'
keycloak-1  | 2023-12-06 11:18:23,376 WARN  [io.quarkus.vertx.http.runtime.VertxHttpRecorder] (main) The X-Forwarded-* and Forwarded headers will be considered when determining the proxy address. This configuration can cause a security issue as clients can forge requests and send a forwarded header that is not overwritten by the proxy. Please consider use one of these headers just to forward the proxy address in requests.
keycloak-1  | 2023-12-06 11:18:24,468 INFO  [org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory] (main) Node name: node_79508, Site name: null
keycloak-1  | 2023-12-06 11:18:27,265 INFO  [org.keycloak.quarkus.runtime.storage.legacy.liquibase.QuarkusJpaUpdaterProvider] (main) Initializing database schema. Using changelog META-INF/jpa-changelog-master.xml
db-1  | The files belonging to this database system will be owned by user "postgres".
db-1  | This user must also own the server process.
db-1  | 
db-1  | The database cluster will be initialized with locale "en_US.utf8".
db-1  | The default database encoding has accordingly been set to "UTF8".
db-1  | The default text search configuration will be set to "english".
db-1  | 
db-1  | Data page checksums are disabled.
db-1  | 
db-1  | fixing permissions on existing directory /var/lib/postgresql/data ... ok
db-1  | creating subdirectories ... ok
db-1  | selecting dynamic shared memory implementation ... posix
db-1  | selecting default max_connections ... 100
db-1  | selecting default shared_buffers ... 128MB
db-1  | selecting default time zone ... UTC
db-1  | creating configuration files ... ok
db-1  | running bootstrap script ... ok
db-1  | sh: locale: not found
db-1  | 2023-12-06 10:58:24.728 UTC [30] WARNING:  no usable system locales were found
db-1  | performing post-bootstrap initialization ... ok
db-1  | initdb: warning: enabling "trust" authentication for local connections
db-1  | You can change this by editing pg_hba.conf or using the option -A, or
db-1  | --auth-local and --auth-host, the next time you run initdb.
db-1  | syncing data to disk ... ok
db-1  | 
db-1  | 
db-1  | Success. You can now start the database server using:
db-1  | 
db-1  |     pg_ctl -D /var/lib/postgresql/data -l logfile start
db-1  | 
db-1  | waiting for server to start....2023-12-06 11:00:25.868 UTC [112] LOG:  starting PostgreSQL 14.10 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924, 64-bit
db-1  | 2023-12-06 11:00:26.016 UTC [112] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db-1  | 2023-12-06 11:00:26.442 UTC [113] LOG:  database system was shut down at 2023-12-06 10:58:25 UTC
db-1  | .2023-12-06 11:00:26.611 UTC [112] LOG:  database system is ready to accept connections
db-1  |  done
db-1  | server started
db-1  | CREATE DATABASE
db-1  | 
db-1  | 
db-1  | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
db-1  | 
db-1  | waiting for server to shut down....2023-12-06 11:00:53.445 UTC [112] LOG:  received fast shutdown request
db-1  | 2023-12-06 11:00:53.622 UTC [112] LOG:  aborting any active transactions
db-1  | 2023-12-06 11:00:53.630 UTC [112] LOG:  background worker "logical replication launcher" (PID 119) exited with exit code 1
db-1  | 2023-12-06 11:00:53.631 UTC [114] LOG:  shutting down
db-1  | .2023-12-06 11:00:55.057 UTC [112] LOG:  database system is shut down
db-1  |  done
db-1  | server stopped
db-1  | 
db-1  | PostgreSQL init process complete; ready for start up.
db-1  | 
db-1  | 2023-12-06 11:00:55.798 UTC [1] LOG:  starting PostgreSQL 14.10 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924, 64-bit
db-1  | 2023-12-06 11:00:55.798 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db-1  | 2023-12-06 11:00:55.798 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db-1  | 2023-12-06 11:00:56.188 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db-1  | 2023-12-06 11:00:56.456 UTC [143] LOG:  database system was shut down at 2023-12-06 11:00:54 UTC
db-1  | 2023-12-06 11:00:56.663 UTC [1] LOG:  database system is ready to accept connections
db-1  | 2023-12-06 11:18:24.497 UTC [968] ERROR:  relation "migration_model" does not exist at character 25
db-1  | 2023-12-06 11:18:24.497 UTC [968] STATEMENT:  SELECT ID, VERSION FROM MIGRATION_MODEL ORDER BY UPDATE_TIME DESC
db-1  | 2023-12-06 11:18:25.845 UTC [968] ERROR:  relation "public.databasechangelog" does not exist at character 22
db-1  | 2023-12-06 11:18:25.845 UTC [968] STATEMENT:  SELECT COUNT(*) FROM public.databasechangelog
db-1  | 2023-12-06 11:18:26.852 UTC [976] ERROR:  relation "public.databasechangeloglock" does not exist at character 22
db-1  | 2023-12-06 11:18:26.852 UTC [976] STATEMENT:  SELECT COUNT(*) FROM public.databasechangeloglock
db-1  | 2023-12-06 11:18:27.260 UTC [968] ERROR:  relation "public.databasechangelog" does not exist at character 22
db-1  | 2023-12-06 11:18:27.260 UTC [968] STATEMENT:  SELECT COUNT(*) FROM public.databasechangelog

On dirait que la BDD n'est pas installée finalement... Le plus simple, c'est peut-être que je recrée une nouvelle VM vierge et que je reparte avec le bon fichier .env directement ?

mvergez commented 7 months ago

Etrange tout ça... Pour minio on a identifié le problème : nous n'avions pas fixé la version et ils ont fait quelques changements récemment qui nous impactent sur la detection du healthy.

Pour la db c'est très étrange, je vais faire des tests chez moi et je reviens vers toi au plus vite.

Pas besoin de supprimer geocam à chaque test, en fonction des changements seuls ./scripts/docker.sh down puis ./scripts/docker.sh up -d et parfois juste ./scripts/docker.sh up -d suffisent. Le down -v est violent mais quand on fait des tests, aucun souci.

Désolé pour tous ces problèmes en tout cas...

geobrun commented 7 months ago

Bonjour @mvergez,

J'ai fait des tests de mon côté :

Et j'obtiens visiblement la même erreur que lors de mon dernier post, il doit y avoir quelque chose qui ne se passe comme il faut ! Ou bien il y a une différence de configuration avec votre machine de test ?

✔ Network geonature-annotation_annotation_nw  Created                                                                                  1.0s 
 ✔ Network geonature-annotation_default        Created                                                                                  1.7s 
 ✔ Volume "geonature-annotation_db_data"       Created                                                                                  0.3s 
 ✔ Volume "geonature-annotation_minio_data"    Created                                                                                  0.3s 
 ✔ Container geonature-annotation-minio-1      Started                                                                                  6.2s 
 ✔ Container geonature-annotation-taxapi-1     Started                                                                                  6.2s 
 ✘ Container geonature-annotation-db-1         Error                                                                                    5.7s 
 ✔ Container geonature-annotation-doc-1        Started                                                                                  6.2s 
 ✔ Container geonature-annotation-keycloak-1   Created                                                                                  3.1s 
 ✔ Container geonature-annotation-api-1        Created                                                                                  3.5s 
 ✔ Container geonature-annotation-frontend-1   Created                                                                                 22.1s 
 ✔ Container geonature-annotation-traefik-1    Created                                                                                  2.9s 
geonature-annotation-db-1  | The files belonging to this database system will be owned by user "postgres".
geonature-annotation-db-1  | This user must also own the server process.
geonature-annotation-db-1  | 
geonature-annotation-db-1  | The database cluster will be initialized with locale "en_US.utf8".
geonature-annotation-db-1  | The default database encoding has accordingly been set to "UTF8".
geonature-annotation-db-1  | The default text search configuration will be set to "english".
geonature-annotation-db-1  | 
geonature-annotation-db-1  | Data page checksums are disabled.
geonature-annotation-db-1  | 
geonature-annotation-db-1  | fixing permissions on existing directory /var/lib/postgresql/data ... ok
geonature-annotation-db-1  | creating subdirectories ... ok
geonature-annotation-db-1  | selecting dynamic shared memory implementation ... posix
geonature-annotation-db-1  | selecting default max_connections ... 100
geonature-annotation-db-1  | selecting default shared_buffers ... 128MB
geonature-annotation-db-1  | selecting default time zone ... UTC
geonature-annotation-db-1  | creating configuration files ... ok
geonature-annotation-db-1  | running bootstrap script ... ok
geonature-annotation-db-1  | sh: locale: not found
geonature-annotation-db-1  | 2023-12-11 15:31:11.331 UTC [31] WARNING:  no usable system locales were found
geonature-annotation-db-1  | performing post-bootstrap initialization ... ok
geonature-annotation-db-1  | initdb: warning: enabling "trust" authentication for local connections
geonature-annotation-db-1  | You can change this by editing pg_hba.conf or using the option -A, or
geonature-annotation-db-1  | --auth-local and --auth-host, the next time you run initdb.
geonature-annotation-db-1  | syncing data to disk ... ok
geonature-annotation-db-1  | 
geonature-annotation-db-1  | 
geonature-annotation-db-1  | Success. You can now start the database server using:
geonature-annotation-db-1  | 
geonature-annotation-db-1  |     pg_ctl -D /var/lib/postgresql/data -l logfile start
geonature-annotation-db-1  | 
geonature-annotation-db-1  | waiting for server to start....2023-12-11 15:32:50.084 UTC [91] LOG:  starting PostgreSQL 14.10 on x86_64-pc-linux-musl, compiled by gcc (Alpine 13.2.1_git20231014) 13.2.1 20231014, 64-bit
geonature-annotation-db-1  | 2023-12-11 15:32:50.304 UTC [91] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
geonature-annotation-db-1  | 2023-12-11 15:32:50.749 UTC [92] LOG:  database system was shut down at 2023-12-11 15:31:12 UTC
geonature-annotation-db-1  | .2023-12-11 15:32:50.955 UTC [91] LOG:  database system is ready to accept connections
geonature-annotation-db-1  |  done
geonature-annotation-db-1  | server started
geonature-annotation-db-1  | CREATE DATABASE
geonature-annotation-db-1  | 
geonature-annotation-db-1  | 
geonature-annotation-db-1  | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
geonature-annotation-db-1  | 
geonature-annotation-db-1  | waiting for server to shut down...2023-12-11 15:33:17.970 UTC [91] LOG:  received fast shutdown request
geonature-annotation-db-1  | .2023-12-11 15:33:18.296 UTC [91] LOG:  aborting any active transactions
geonature-annotation-db-1  | 2023-12-11 15:33:18.303 UTC [91] LOG:  background worker "logical replication launcher" (PID 98) exited with exit code 1
geonature-annotation-db-1  | 2023-12-11 15:33:18.308 UTC [93] LOG:  shutting down
geonature-annotation-db-1  | .2023-12-11 15:33:19.699 UTC [91] LOG:  database system is shut down
geonature-annotation-db-1  |  done
geonature-annotation-db-1  | server stopped
geonature-annotation-db-1  | 
geonature-annotation-db-1  | PostgreSQL init process complete; ready for start up.
geonature-annotation-db-1  | 
geonature-annotation-db-1  | 2023-12-11 15:33:20.209 UTC [1] LOG:  starting PostgreSQL 14.10 on x86_64-pc-linux-musl, compiled by gcc (Alpine 13.2.1_git20231014) 13.2.1 20231014, 64-bit
geonature-annotation-db-1  | 2023-12-11 15:33:20.209 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
geonature-annotation-db-1  | 2023-12-11 15:33:20.209 UTC [1] LOG:  listening on IPv6 address "::", port 5432
geonature-annotation-db-1  | 2023-12-11 15:33:20.479 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
geonature-annotation-db-1  | 2023-12-11 15:33:20.730 UTC [130] LOG:  database system was shut down at 2023-12-11 15:33:19 UTC
geonature-annotation-db-1  | 2023-12-11 15:33:20.886 UTC [1] LOG:  database system is ready to accept connections

Je suppose que l'erreur se situe au niveau de cette mention : background worker "logical replication launcher" (PID 98) exited with exit code 1 ?

geobrun commented 6 months ago

Salut Maxime,

J'ai finalisé l'installation de la nouvelle version de GeoCam sur notre serveur. Je vais mettre à jour la documentation pour que cela soit plus clair au cas où quelqu'un souhaiterait installer et tester cette nouvelle version.

Comme on l'a vu tous les deux en début de semaine, il y a encore quelques petites corrections à réaliser pour que l'installation devienne "un long fleuve tranquille". Je les mets ici pour rappel, mais aussi au cas où quelqu'un souhaiterait tester l'outil de son côté :

Et il y a un dernier souci que j'ai rencontré lors de la réinstallation de l'application avec des identifiants et mots de passe personnalisés. La modification des paramètres APP_USER et APP_PASSWORD dans le fichier docker/.env rend impossible de mon côté le login dans l'installation. J'ai du installer l'application avec l'utilisateur et le mot de passe par défaut. Pour le mot de passe, ce n'était pas un gros souci : j'ai pu le modifier après coup via l'interface de Keycloak. Par contre, le login admin ne peut pas être modifié a posteriori. Même si c'est un moindre mal, ce n'est quand même pas terrible ! Peut-être qu'il y a une coquille quelque part dans le code où le couple "utilisateur/mdp" par défaut est écrit en dur ?

Encore merci pour ton aide ! :)

mvergez commented 6 months ago

Salut @geobrun !

Merci beaucoup pour ton retour !

On va prendre en compte ces points là pour rendre l'installation plus fluide :

Pour le dernier souci, j'ai fait un test :

Je vais tester avec un autre mot de passe également et reviens vers toi au plus vite ! Et effectivement, à confirmer, mais je ne pense pas que Keycloak autorise le changement du nom d'utilisateur a posteriori. A part en base de données peut-être. J'essaie de faire un test là dessus aussi

geobrun commented 6 months ago

Hum, c'est curieux cette histoire de nom d'utilisateur/mot de passe. Je l'ai testé plusieurs fois de mon côté pourtant ! Je referai un test avec la prochaine version.