hemerajs / aither

An example microservice system in Node.js using Hemera and best of today.
GNU General Public License v3.0
119 stars 26 forks source link

Errors when starting Aither #1

Closed AraanBranco closed 7 years ago

AraanBranco commented 7 years ago

I followed all the steps that were passed, but when I boot with docker-compose up in the console it already shows some errors, for example:

math-service_1         | TypeError: Cannot read property 'joi' of undefined
math-service_1         |     at Hemera.hemera.ready (/usr/src/app/index.js:26:44)
math-service_1         |     at Client.<anonymous> (/usr/src/app/node_modules/nats-hemera/build/index.js:411:14)
math-service_1         |     at emitOne (events.js:96:13)
math-service_1         |     at Client.emit (events.js:188:7)
math-service_1         |     at Client.connectCB (/usr/src/app/node_modules/nats/lib/nats.js:393:8)
math-service_1         |     at /usr/src/app/node_modules/nats/lib/nats.js:821:45
math-service_1         |     at Client.processInbound (/usr/src/app/node_modules/nats/lib/nats.js:791:19)
math-service_1         |     at Socket.<anonymous> (/usr/src/app/node_modules/nats/lib/nats.js:468:12)
math-service_1         |     at emitOne (events.js:96:13)
math-service_1         |     at Socket.emit (events.js:188:7)
math-service_1         | /usr/src/app/index.js:26
math-service_1         |   let Joi = hemera.exposition['hemera-joi'].joi

Until then it starts the other services normally, but when I do the request: http://localhost:8182/api/add?a=1&b=10 it returns the following error:

api_1                  |     { TimeoutError
api_1                  |     at timeoutHandler (/usr/src/app/node_modules/nats-hemera/build/index.js:981:21)
api_1                  |     at Timeout._onTimeout (/usr/src/app/node_modules/nats/lib/nats.js:1175:41)
api_1                  |     at ontimeout (timers.js:365:14)
api_1                  |     at tryOnTimeout (timers.js:237:5)
api_1                  |     at Timer.listOnTimeout (timers.js:207:5)
api_1                  |   message: 'Timeout',
api_1                  |   pattern: { topic: 'math', cmd: 'add', a: '1', b: '10', refresh: false } }
traefik_1              | time="2017-03-05T03:13:34Z" level=warning msg="Error forwarding to http://172.19.0.9:8789, err: EOF" 
traefik_1              | time="2017-03-05T03:13:34Z" level=debug msg="Docker event received {Status:die ID:1864792805f62854cb7429ff966faf51a99b8524c8a48e17b69c60df8e641632 From:aither_api Type:container Action:die Actor:{ID:1864792805f62854cb7429ff966faf51a99b8524c8a48e17b69c60df8e641632 Attributes:map[com.docker.compose.oneoff:False com.docker.compose.version:1.8.1 image:aither_api traefik.backend:api traefik.frontend.rule:PathPrefix: /api com.docker.compose.config-hash:ca6358ba5b4efa6e09c0865e5b5e60847559d127c84bce2ed1e126a12b9faae3 com.docker.compose.container-number:1 exitCode:1 name:aither_api_1 traefik.frontend.entryPoints:http traefik.port:8789 com.docker.compose.project:aither com.docker.compose.service:api]} Time:1488683614 TimeNano:1488683614237169189}" 

I got to test in 3 different environments and the same problem appeared

StarpTech commented 7 years ago

Hi @AraanBranco issue was fixed. Please try again and thanks for reporting.

docker-compose build --no-cache
docker-compose up
AraanBranco commented 7 years ago

Thanks @StarpTech and Resolved!