openfab-lab / app-membres

Une application pour la gestion de nos membres / An app to manage our fablab's communty
1 stars 2 forks source link

[noob welcome] docker 101 #20

Closed nicolasdb closed 4 years ago

nicolasdb commented 4 years ago

Je suis occupé de rattraper les bases pour pouvoir visualiser et de pouvoir faire le relai ici pour la création du contenu. Je vais mettre ici mes remarques et screenshot pour ensuite alimenter une page wiki pour les noobs. Toutes les astuces sont bienvenues.

SETUP.mine

OS: linux Manjaro Git client: Gitkraken Edition Software: Atom (+ platform.io but not needed) Install docker and docker-compose packages via AUR

step 1. test install

Taper docker-compose dans un terminal et zoup, ça marche, il est donc bien installé. image

step 2. locate the file

pécho le repo en local via gitkraken. J'assume que cette partie est connue. Je retrouve le dossier là où je lui ai dit de le mettre .../nicolas/github/app-membres/

J'ouvre le dossier comme projet dans Atom (et c'est là que platform.io m'ennuie en me disant que c'est pas un projet platform.io). Ne pas utiliser platform.io ici et donc utiliser la fonction ouvrir d'Atom uniquement. image

image

Je continue avec le tuto https://www.youtube.com/watch?v=4EqysCR3mjo

nicolasdb commented 4 years ago

Step 3. poking the whale

Donc, tjs via le terminal, je vais à la racine de /app-membres/ et je teste docker-compose up

image :-1: fart

Mais ça semble être la bonne direction et c'était attendu puisque je n'ai pas encore suivit les consignes. :lollipop: https://github.com/openfab-lab/app-membres/wiki/Development-environment#configuration

nicolasdb commented 4 years ago

Create a .env file image

ok, il ne faut pas un nom? Intéressant. Il n'y a plus d'erreurs. image

Next: Create sequelize-cli config

image

Et Modify docker-compose.yml image

Et finalement image

tadaaa

image :-1: fart, ça marche pas, même erreur.

nicolasdb commented 4 years ago

QUIZ!!!

@121593 @satblip Bon, ok tout ça c'est cool mais vu que je sauve en local ces modifs, je dois bien faire attention car je n'ai pas fait de branche GIT. C'est mieux de faire une branche pour tester ce que je veux tester. Idem pour la création de contenu. C'est certainement évident pour les habitués mais je pense que c'est bon de le rappeler en début de configuration

nicolasdb commented 4 years ago

Run the daemon

Ben ouais, ça marche mieux quand le soft est lancé. https://docs.docker.com/config/daemon/

nicolasdb commented 4 years ago

tjs pas. Suivons ça. https://medium.com/developer-space/if-you-faced-an-issue-like-couldnt-connect-to-docker-daemon-at-http-docker-localunixsocket-is-27b35f17d09d

satblip commented 4 years ago

oui, le test pour voir si docker est ok, c'est docker info pas docker-compse ;)

nicolasdb commented 4 years ago

dockerd is running image

sudo docker info [sudo] password for nicolas:

Client:
 Debug Mode: false

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 19.03.6-ce
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: d76c121f76a5fc8a462dc64594aea72fe18e1178.m
 runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.4.22-1-MANJARO
 Operating System: Manjaro Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 11.53GiB
 Name: nico430
 ID: YWTB:ALJB:2TW3:NZI6:FWCG:SIAE:4DIC:UHZ4:YTDA:45OP:6MAC:G4RB
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
nicolasdb commented 4 years ago

Haaaaa mais quel boulet je suis. image

nicolasdb commented 4 years ago

sudo docker-compose up

image

Donc, si je comprend bien, si j'ouvre une page en localhost, je devrai avoir le site. :-1: fart ça marche pas.

nicolasdb commented 4 years ago

@121593 Elle sert à quoi cette fonction utile? https://github.com/openfab-lab/app-membres/wiki/Getting-started#useful-commands

satblip commented 4 years ago

elle sert a faire du bash dans le container de l'app, tu devrais pas en voir besoin ;)

Pour l'app tu peux la relancer (docker-compose down et puis de nouveau up la db doit se peupler au démarrage la première fois

nicolasdb commented 4 years ago

ok, je dois bien faire attention de démarrer le daemon sudo dockerd puis sudo docker-compose up fonctionne Et le terminal s'arrête ici: image

Mais ensuite?

satblip commented 4 years ago

ce qui est intéressant est tout ce qui concerne node1 donc plus haut ;)

nicolasdb commented 4 years ago

ha, ok. Voici ce qu'il me dit, la version complète:

Creating app-membres_postgresql_1 ... done
Creating app-membres_node_1       ... done
Attaching to app-membres_postgresql_1, app-membres_node_1
postgresql_1  | The files belonging to this database system will be owned by user "postgres".
postgresql_1  | This user must also own the server process.
postgresql_1  | 
postgresql_1  | The database cluster will be initialized with locale "en_US.utf8".
postgresql_1  | The default database encoding has accordingly been set to "UTF8".
postgresql_1  | The default text search configuration will be set to "english".
postgresql_1  | 
postgresql_1  | Data page checksums are disabled.
postgresql_1  | 
postgresql_1  | fixing permissions on existing directory /var/lib/postgresql/data ... ok
postgresql_1  | creating subdirectories ... ok
postgresql_1  | selecting default max_connections ... 100
postgresql_1  | selecting default shared_buffers ... 128MB
postgresql_1  | selecting default timezone ... Etc/UTC
postgresql_1  | selecting dynamic shared memory implementation ... posix
postgresql_1  | creating configuration files ... ok
postgresql_1  | creating template1 database in /var/lib/postgresql/data/base/1 ... ok
postgresql_1  | initializing pg_authid ... ok
postgresql_1  | setting password ... ok
postgresql_1  | initializing dependencies ... ok
postgresql_1  | creating system views ... ok
node_1        | 
node_1        | > openfab-membres@1.0.0 watch /var/www
node_1        | > nodemon --exec npm run start
node_1        | 
postgresql_1  | loading system objects' descriptions ... ok
postgresql_1  | creating collations ... ok
postgresql_1  | creating conversions ... ok
postgresql_1  | creating dictionaries ... ok
postgresql_1  | setting privileges on built-in objects ... ok
postgresql_1  | creating information schema ... ok
postgresql_1  | loading PL/pgSQL server-side language ... ok
node_1        | [nodemon] 1.12.1
node_1        | [nodemon] to restart at any time, enter `rs`
node_1        | [nodemon] watching: *.*
node_1        | [nodemon] starting `npm run start`
postgresql_1  | vacuuming database template1 ... ok
postgresql_1  | copying template1 to template0 ... ok
postgresql_1  | copying template1 to postgres ... ok
node_1        | 
node_1        | > openfab-membres@1.0.0 start /var/www
node_1        | > node src/index.js
node_1        | 
postgresql_1  | syncing data to disk ... 
postgresql_1  | WARNING: enabling "trust" authentication for local connections
postgresql_1  | You can change this by editing pg_hba.conf or using the option -A, or
postgresql_1  | --auth-local and --auth-host, the next time you run initdb.
postgresql_1  | ok
postgresql_1  | 
postgresql_1  | Success. You can now start the database server using:
postgresql_1  | 
postgresql_1  |     pg_ctl -D /var/lib/postgresql/data -l logfile start
postgresql_1  | 
postgresql_1  | waiting for server to start....LOG:  database system was shut down at 2020-03-06 10:57:43 UTC
postgresql_1  | LOG:  MultiXact member wraparound protections are now enabled
postgresql_1  | LOG:  autovacuum launcher started
postgresql_1  | LOG:  database system is ready to accept connections
node_1        | Fri, 06 Mar 2020 10:57:43 GMT sequelize deprecated String based operators are now deprecated. Please use Symbol based operators for better security, read more at http://docs.sequelizejs.com/manual/tutorial/querying.html#operators at node_modules/sequelize/lib/sequelize.js:237:13
postgresql_1  |  done
postgresql_1  | server started
postgresql_1  | 
postgresql_1  | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
postgresql_1  | 
postgresql_1  | LOG:  received fast shutdown request
postgresql_1  | waiting for server to shut down...LOG:  aborting any active transactions
postgresql_1  | .LOG:  autovacuum launcher shutting down
postgresql_1  | LOG:  shutting down
postgresql_1  | LOG:  database system is shut down
node_1        | (node:37) UnhandledPromiseRejectionWarning: SequelizeConnectionRefusedError: connect ECONNREFUSED 172.17.0.2:5432
node_1        |     at connection.connect.err (/var/www/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:96:24)
node_1        |     at Connection.connectingErrorHandler (/var/www/node_modules/pg/lib/client.js:123:14)
node_1        |     at emitOne (events.js:116:13)
node_1        |     at Connection.emit (events.js:211:7)
node_1        |     at Socket.reportStreamError (/var/www/node_modules/pg/lib/connection.js:71:10)
node_1        |     at emitOne (events.js:116:13)
node_1        |     at Socket.emit (events.js:211:7)
node_1        |     at emitErrorNT (internal/streams/destroy.js:73:8)
node_1        |     at _combinedTickCallback (internal/process/next_tick.js:139:11)
node_1        |     at process._tickCallback (internal/process/next_tick.js:181:9)
node_1        | From previous event:
node_1        |     at ConnectionManager.connect (/var/www/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:87:12)
node_1        |     at sequelize.runHooks.then (/var/www/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:320:50)
node_1        | From previous event:
node_1        |     at ConnectionManager._connect (/var/www/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:320:8)
node_1        |     at ConnectionManager.getConnection (/var/www/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:250:46)
node_1        |     at Promise.try (/var/www/node_modules/sequelize/lib/sequelize.js:539:92)
node_1        | From previous event:
node_1        |     at Sequelize.query (/var/www/node_modules/sequelize/lib/sequelize.js:446:23)
node_1        |     at Promise.all.tap.then (/var/www/node_modules/sequelize/lib/query-interface.js:262:35)
node_1        | From previous event:
node_1        |     at Promise.all.then.results (/var/www/node_modules/sequelize/lib/query-interface.js:261:12)
node_1        | From previous event:
node_1        |     at QueryInterface.createTable (/var/www/node_modules/sequelize/lib/query-interface.js:195:36)
node_1        |     at Promise.try.then.then (/var/www/node_modules/sequelize/lib/model.js:1122:39)
node_1        | From previous event:
node_1        |     at Function.sync (/var/www/node_modules/sequelize/lib/model.js:1122:8)
node_1        |     at Promise.each.model (/var/www/node_modules/sequelize/lib/sequelize.js:705:50)
node_1        | From previous event:
node_1        |     at Promise.try.then.then (/var/www/node_modules/sequelize/lib/sequelize.js:705:22)
node_1        |     at runCallback (timers.js:810:20)
node_1        |     at tryOnImmediate (timers.js:768:5)
node_1        |     at processImmediate [as _immediateCallback] (timers.js:745:5)
node_1        | From previous event:
node_1        |     at Sequelize.sync (/var/www/node_modules/sequelize/lib/sequelize.js:692:8)
node_1        |     at start (/var/www/src/index.js:14:19)
node_1        |     at Object.<anonymous> (/var/www/src/index.js:24:1)
node_1        |     at Module._compile (module.js:653:30)
node_1        |     at Object.Module._extensions..js (module.js:664:10)
node_1        |     at Module.load (module.js:566:32)
node_1        |     at tryModuleLoad (module.js:506:12)
node_1        |     at Function.Module._load (module.js:498:3)
node_1        |     at Function.Module.runMain (module.js:694:10)
node_1        |     at startup (bootstrap_node.js:204:16)
node_1        |     at bootstrap_node.js:625:3
node_1        | (node:37) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
node_1        | (node:37) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
node_1        | [nodemon] clean exit - waiting for changes before restart
postgresql_1  |  done
postgresql_1  | server stopped
postgresql_1  | 
postgresql_1  | PostgreSQL init process complete; ready for start up.
postgresql_1  | 
postgresql_1  | LOG:  database system was shut down at 2020-03-06 10:57:44 UTC
postgresql_1  | LOG:  MultiXact member wraparound protections are now enabled
postgresql_1  | LOG:  autovacuum launcher started
postgresql_1  | LOG:  database system is ready to accept connections
121593 commented 4 years ago

Ok j'avais eu ce problème aussi, c'est node qui essaye d'accéder à la db avant qu'elle ne soit initialisée. Je vais faire un fix Pour mémoire, ajouter https://github.com/ufoscout/docker-compose-wait/

nicolasdb commented 4 years ago

ok, cool. J'ai fait un pull du master. J'ai vérifié que les modif de configuration étaient toujours là. Oui.

Est-ce que c'est ça qu'on doit obtenir? On dirai que je n'ai pas "wait", c'est pas un plugin à installer par hazard? Aussi, est-ce bien à localhost qu'il faut se connecter une fois que tout fonctionne?

[nicolas@nico430 app-membres]$ sudo docker-compose up
Starting app-membres_postgresql_1 ... done
Starting app-membres_node_1       ... done
Attaching to app-membres_postgresql_1, app-membres_node_1
postgresql_1  | 
postgresql_1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
postgresql_1  | 
postgresql_1  | LOG:  database system was shut down at 2020-03-08 16:18:05 UTC
postgresql_1  | LOG:  MultiXact member wraparound protections are now enabled
postgresql_1  | LOG:  database system is ready to accept connections
postgresql_1  | LOG:  autovacuum launcher started
node_1        | module.js:550
node_1        |     throw err;
node_1        |     ^
node_1        | 
node_1        | Error: Cannot find module '/wait'
node_1        |     at Function.Module._resolveFilename (module.js:548:15)
node_1        |     at Function.Module._load (module.js:475:25)
node_1        |     at Function.Module.runMain (module.js:694:10)
node_1        |     at startup (bootstrap_node.js:204:16)
node_1        |     at bootstrap_node.js:625:3
app-membres_node_1 exited with code 1
121593 commented 4 years ago

Alors en fait il faut que tu recrée ton image docker car en effet une nouvelle dépendance a été ajoutée. Pour ce faire : docker-compose down && docker-compose up --build L'adresse du site sera ensuite http://localhost:19461/

J'ai aussi publié un petit fix pour un pb sur l'environment de dev, si quelqun peut approuver les changements #21

121593 commented 4 years ago

21 merged

nicolasdb commented 4 years ago

sorry, marche pas.

sudo docker-compose down && docker-compose up --build
Removing app-membres_node_1       ... done
Removing app-membres_postgresql_1 ... done
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

Par contre,

[nicolas@nico430 app-membres]$ sudo docker-compose build
postgresql uses an image, skipping
Building node
Step 1/10 : FROM node:8-alpine
 ---> 2b8fcdc6230a
Step 2/10 : ENV APP_NAME openfab-membres
 ---> Using cache
 ---> db98f708d001
Step 3/10 : ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.7.3/wait /wait

 ---> Using cache
 ---> 5ae9bcfc64e9
Step 4/10 : RUN chmod +x /wait
 ---> Using cache
 ---> f8b4456ea25d
Step 5/10 : WORKDIR /var/www
 ---> Using cache
 ---> 513c179f21ff
Step 6/10 : COPY ./config /var/www/config
 ---> Using cache
 ---> c0660f5adf14
Step 7/10 : COPY ./src /var/www/src
 ---> Using cache
 ---> dfa88c33e5d2
Step 8/10 : COPY ./package.json /var/www/package.json
 ---> Using cache
 ---> f1f1ea2bab6a
Step 9/10 : RUN npm install
 ---> Using cache
 ---> 3c1b542036a6
Step 10/10 : CMD npm run wait-start
 ---> Using cache
 ---> 9346157c8eff
Successfully built 9346157c8eff
Successfully tagged app-membres_node:latest

Mais

[nicolas@nico430 app-membres]$ sudo docker-compose up
Creating app-membres_postgresql_1 ... done
Creating app-membres_node_1       ... done
Attaching to app-membres_postgresql_1, app-membres_node_1
postgresql_1  | The files belonging to this database system will be owned by user "postgres".
postgresql_1  | This user must also own the server process.
postgresql_1  | 
postgresql_1  | The database cluster will be initialized with locale "en_US.utf8".
postgresql_1  | The default database encoding has accordingly been set to "UTF8".
postgresql_1  | The default text search configuration will be set to "english".
postgresql_1  | 
postgresql_1  | Data page checksums are disabled.
postgresql_1  | 
postgresql_1  | fixing permissions on existing directory /var/lib/postgresql/data ... ok
postgresql_1  | creating subdirectories ... ok
postgresql_1  | selecting default max_connections ... 100
postgresql_1  | selecting default shared_buffers ... 128MB
postgresql_1  | selecting default timezone ... Etc/UTC
postgresql_1  | selecting dynamic shared memory implementation ... posix
postgresql_1  | creating configuration files ... ok
postgresql_1  | creating template1 database in /var/lib/postgresql/data/base/1 ... ok
postgresql_1  | initializing pg_authid ... ok
postgresql_1  | setting password ... ok
postgresql_1  | initializing dependencies ... ok
node_1        | 
node_1        | > openfab-membres@1.0.0 wait-watch /var/www
node_1        | > /wait && npm run watch
node_1        | 
node_1        | --------------------------------------------------------
node_1        |  docker-compose-wait 2.7.3
node_1        | ---------------------------
node_1        | Starting with configuration:
node_1        |  - Hosts to be waiting for: [postgresql:5432]
node_1        |  - Timeout before failure: 30 seconds 
node_1        |  - TCP connection timeout before retry: 5 seconds 
node_1        |  - Sleeping time before checking for hosts availability: 0 seconds
node_1        |  - Sleeping time once all hosts are available: 0 seconds
node_1        |  - Sleeping time between retries: 1 seconds
node_1        | --------------------------------------------------------
node_1        | Checking availability of postgresql:5432
node_1        | Host postgresql:5432 not yet available...
postgresql_1  | creating system views ... ok
postgresql_1  | loading system objects' descriptions ... ok
postgresql_1  | creating collations ... ok
postgresql_1  | creating conversions ... ok
postgresql_1  | creating dictionaries ... ok
postgresql_1  | setting privileges on built-in objects ... ok
postgresql_1  | creating information schema ... ok
postgresql_1  | loading PL/pgSQL server-side language ... ok
postgresql_1  | vacuuming database template1 ... ok
postgresql_1  | copying template1 to template0 ... ok
postgresql_1  | copying template1 to postgres ... ok
postgresql_1  | syncing data to disk ... ok
postgresql_1  | 
postgresql_1  | Success. You can now start the database server using:
postgresql_1  | 
postgresql_1  |     pg_ctl -D /var/lib/postgresql/data -l logfile start
postgresql_1  | 
postgresql_1  | 
postgresql_1  | WARNING: enabling "trust" authentication for local connections
postgresql_1  | You can change this by editing pg_hba.conf or using the option -A, or
postgresql_1  | --auth-local and --auth-host, the next time you run initdb.
postgresql_1  | waiting for server to start....LOG:  database system was shut down at 2020-03-09 15:18:14 UTC
postgresql_1  | LOG:  MultiXact member wraparound protections are now enabled
postgresql_1  | LOG:  database system is ready to accept connections
postgresql_1  | LOG:  autovacuum launcher started
node_1        | Host postgresql:5432 not yet available...
postgresql_1  |  done
postgresql_1  | server started
postgresql_1  | 
postgresql_1  | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
postgresql_1  | 
postgresql_1  | LOG:  received fast shutdown request
postgresql_1  | waiting for server to shut down....LOG:  aborting any active transactions
postgresql_1  | LOG:  autovacuum launcher shutting down
postgresql_1  | LOG:  shutting down
postgresql_1  | LOG:  database system is shut down
node_1        | Host postgresql:5432 not yet available...
postgresql_1  |  done
postgresql_1  | server stopped
postgresql_1  | 
postgresql_1  | PostgreSQL init process complete; ready for start up.
postgresql_1  | 
node_1        | Host postgresql:5432 is now available!
node_1        | --------------------------------------------------------
node_1        | docker-compose-wait - Everything's fine, the application can now start!
node_1        | --------------------------------------------------------
postgresql_1  | LOG:  incomplete startup packet
postgresql_1  | LOG:  database system was shut down at 2020-03-09 15:18:15 UTC
postgresql_1  | LOG:  MultiXact member wraparound protections are now enabled
postgresql_1  | LOG:  database system is ready to accept connections
postgresql_1  | LOG:  autovacuum launcher started
node_1        | 
node_1        | > openfab-membres@1.0.0 watch /var/www
node_1        | > nodemon --exec npm run start
node_1        | 
node_1        | [nodemon] 1.12.1
node_1        | [nodemon] to restart at any time, enter `rs`
node_1        | [nodemon] watching: *.*
node_1        | [nodemon] starting `npm run start`
node_1        | 
node_1        | > openfab-membres@1.0.0 start /var/www
node_1        | > node src/index.js
node_1        | 
node_1        | Mon, 09 Mar 2020 15:18:18 GMT sequelize deprecated String based operators are now deprecated. Please use Symbol based operators for better security, read more at http://docs.sequelizejs.com/manual/tutorial/querying.html#operators at node_modules/sequelize/lib/sequelize.js:237:13
node_1        | Executing (default): CREATE TABLE IF NOT EXISTS "users" ("id"   SERIAL , "shortId" TEXT, "passportId" TEXT, "email" TEXT NOT NULL, "password" TEXT NOT NULL, "first_name" TEXT NOT NULL, "last_name" TEXT NOT NULL, "phone_number" TEXT NOT NULL, "language" TEXT NOT NULL, "github" TEXT, "stripeAccount" TEXT, "bio" TEXT, "permissions_level" INTEGER NOT NULL, "majority" BOOLEAN, "insurance" BOOLEAN, "house_rules" BOOLEAN, "register_validate" BOOLEAN, "register_valid_until" TIMESTAMP WITH TIME ZONE, "created_at" TIMESTAMP WITH TIME ZONE, "updated_at" TIMESTAMP WITH TIME ZONE, "deleted_at" TIMESTAMP WITH TIME ZONE, PRIMARY KEY ("id"));
node_1        | Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'users' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
node_1        | Executing (default): CREATE INDEX "user_register_valid_until" ON "users" ("register_valid_until")
node_1        | Executing (default): CREATE UNIQUE INDEX "user_email" ON "users" ("email") WHERE "deleted_at" IS NULL
node_1        | Executing (default): CREATE UNIQUE INDEX "user_email_deletedAt" ON "users" ("email", "deleted_at") WHERE "deleted_at" IS NOT NULL
node_1        | Executing (default): CREATE TABLE IF NOT EXISTS "billingdetails" ("id"   SERIAL , "shortId" TEXT, "company" TEXT, "in_the_name_of" TEXT, "vat" TEXT, "address1" TEXT, "address2" TEXT, "postcode" TEXT, "city" TEXT, "country" TEXT, "created_at" TIMESTAMP WITH TIME ZONE, "updated_at" TIMESTAMP WITH TIME ZONE, "deleted_at" TIMESTAMP WITH TIME ZONE, "userId" INTEGER REFERENCES "users" ("id") ON DELETE SET NULL ON UPDATE CASCADE, UNIQUE ("shortId"), PRIMARY KEY ("id"));
node_1        | Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'billingdetails' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
node_1        | Executing (default): CREATE TABLE IF NOT EXISTS "bills" ("id"   SERIAL , "shortid" TEXT NOT NULL, "last_balance" TEXT NOT NULL, "date" TIMESTAMP WITH TIME ZONE, "url" TEXT, "created_at" TIMESTAMP WITH TIME ZONE, "updated_at" TIMESTAMP WITH TIME ZONE, "deleted_at" TIMESTAMP WITH TIME ZONE, "userId" INTEGER REFERENCES "users" ("id") ON DELETE SET NULL ON UPDATE CASCADE, UNIQUE ("shortid"), PRIMARY KEY ("id"));
node_1        | Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'bills' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
node_1        | Executing (default): CREATE TABLE IF NOT EXISTS "projects" ("id"   SERIAL , "shortid" TEXT NOT NULL, "title" TEXT NOT NULL, "description" TEXT NOT NULL, "link" TEXT NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE, "updated_at" TIMESTAMP WITH TIME ZONE, "deleted_at" TIMESTAMP WITH TIME ZONE, "userId" INTEGER REFERENCES "users" ("id") ON DELETE SET NULL ON UPDATE CASCADE, UNIQUE ("shortid"), PRIMARY KEY ("id"));
node_1        | Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'projects' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
node_1        | Executing (default): CREATE TABLE IF NOT EXISTS "subscribtions" ("id"   SERIAL , "shortid" TEXT NOT NULL, "last_balance" TEXT NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE, "updated_at" TIMESTAMP WITH TIME ZONE, "deleted_at" TIMESTAMP WITH TIME ZONE, "userId" INTEGER REFERENCES "users" ("id") ON DELETE SET NULL ON UPDATE CASCADE, UNIQUE ("shortid"), PRIMARY KEY ("id"));
node_1        | Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'subscribtions' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
node_1        | Executing (default): CREATE TABLE IF NOT EXISTS "wallets" ("id"   SERIAL , "shortid" TEXT NOT NULL, "last_balance" INTEGER NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE, "updated_at" TIMESTAMP WITH TIME ZONE, "deleted_at" TIMESTAMP WITH TIME ZONE, "userId" INTEGER REFERENCES "users" ("id") ON DELETE SET NULL ON UPDATE CASCADE, UNIQUE ("shortid"), PRIMARY KEY ("id"));
node_1        | Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'wallets' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
node_1        | Executing (default): CREATE TABLE IF NOT EXISTS "transactions" ("id"   SERIAL , "shortid" TEXT NOT NULL, "last_balance" INTEGER NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE, "updated_at" TIMESTAMP WITH TIME ZONE, "deleted_at" TIMESTAMP WITH TIME ZONE, "walletId" INTEGER REFERENCES "wallets" ("id") ON DELETE SET NULL ON UPDATE CASCADE, UNIQUE ("shortid"), PRIMARY KEY ("id"));
node_1        | Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'transactions' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;
node_1        | {"name":"openfab-membres","version":"1.0.0","hostname":"122e6f6c7dc0","pid":48,"module":"/var/www/src/server.js","level":20,"event":"ROUTER_LOADING","data":null,"meta":null,"msg":"","time":"2020-03-09T15:18:19.302Z","v":0}
node_1        | (node:48) UnhandledPromiseRejectionWarning: /var/www/src/controllers/inscription/etape4.js:44
node_1        |         };
node_1        |         ^
node_1        | 
node_1        | SyntaxError: missing ) after argument list
node_1        |     at createScript (vm.js:80:10)
node_1        |     at Object.runInThisContext (vm.js:139:10)
node_1        |     at Module._compile (module.js:617:28)
node_1        |     at Object.Module._extensions..js (module.js:664:10)
node_1        |     at Module.load (module.js:566:32)
node_1        |     at tryModuleLoad (module.js:506:12)
node_1        |     at Function.Module._load (module.js:498:3)
node_1        |     at Module.require (module.js:597:17)
node_1        |     at require (internal/module.js:11:18)
node_1        |     at controllerPaths.map.sort.forEach.controllerInfo (/var/www/src/libs/autoroute.js:118:26)
node_1        |     at Array.forEach (<anonymous>)
node_1        |     at module.exports (/var/www/src/libs/autoroute.js:117:6)
node_1        |     at module.exports (/var/www/src/server.js:21:18)
node_1        |     at start (/var/www/src/index.js:15:3)
node_1        |     at <anonymous>
node_1        | (node:48) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
node_1        | (node:48) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Et rien sur http://localhost:19461/

nicolasdb commented 4 years ago

c'est con, ça parrait simple pourtant.

121593 commented 4 years ago

c'est le code que tu as commenté dans 'etape4.js' qui a créé une faute de syntaxe visiblement. Quoi qu'il en soit, ce n'est desormais plus necessaire de le commenter

nicolasdb commented 4 years ago

ha! yeah, merci. ça marche :dancer:

nicolasdb commented 4 years ago

Mise à jour du wiki for noobs like me. https://github.com/openfab-lab/app-membres/wiki/Development-environment