ACDI-Argentina / avaldao

Avaldao
0 stars 0 forks source link

Error al completar aval por problemas de autenticación #45

Closed cmauriciocoronel closed 2 years ago

cmauriciocoronel commented 2 years ago

Al completar el aval, la aplicación no funciona, arrojando los siguientes errores:

Backend

avaldao-feathers       | 2022-01-25 23:38: info: users - No record found for id '0x0bfA3B6b0E799F2eD34444582187B2cDf2fB11a7'
avaldao-feathers       | 2022-01-25 23:38: info: error: authentication - Method: create - No record found for id '0x0bfA3B6b0E799F2eD34444582187B2cDf2fB11a7'
avaldao-feathers       | 2022-01-25 23:38: info: users - No record found for id '0x0bfA3B6b0E799F2eD34444582187B2cDf2fB11a7'
avaldao-feathers       | 2022-01-25 23:38: info: error: authentication - Method: create - No record found for id '0x0bfA3B6b0E799F2eD34444582187B2cDf2fB11a7'
avaldao-mongodb        | {"t":{"$date":"2022-01-25T23:38:33.659+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"Checkpointer","msg":"WiredTiger message","attr":{"message":"[1643153913:659788][1:0x7f7ae0aef700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 254, snapshot max: 254 snapshot count: 0, oldest timestamp: 
(0, 0) , meta checkpoint timestamp: (0, 0)"}}
avaldao-feathers       | 2022-01-25 23:38: { comercianteAddress: '0x36d1d3c43422EF3B1d7d23F20a25977c29BC3f0e',
avaldao-feathers       | 2022-01-25 23:38:   avaladoAddress: '0x9063541acBD959baeB6Bf64158944b7e5844534a' }
avaldao-feathers       | 2022-01-25 23:38: info: error: avales - Method: patch - Cannot read property 'userId' of undefined
avaldao-feathers       | 2022-01-25 23:38: error: undefined
avaldao-mongodb        | {"t":{"$date":"2022-01-25T23:39:33.700+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"Checkpointer","msg":"WiredTiger message","attr":{"message":"[1643153973:700613][1:0x7f7ae0aef700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 255, snapshot max: 255 snapshot count: 0, oldest timestamp: 
(0, 0) , meta checkpoint timestamp: (0, 0)"}}

Frontend

[AvalService] Error completando aval off chain. TypeError: Cannot read property 'userId' of undefined
    at Object.context (:3010/usr/src/app/src/services/avales/avales.hooks.js:5:41)
    at promise.then.hookObject (:3010/usr/src/app/node_modules/@feathersjs/commons/lib/hooks.js:164:73)
    at process._tickCallback (:3010/internal/process/next_tick.js:68:7)
console.<computed> @ index.js:1
hostReportError.ts:8 Uncaught TypeError: Cannot read property 'userId' of undefined
    at Object.context (:3010/usr/src/app/src/services/avales/avales.hooks.js:5:41)
    at promise.then.hookObject (:3010/usr/src/app/node_modules/@feathersjs/commons/lib/hooks.js:164:73)
    at process._tickCallback (:3010/internal/process/next_tick.js:68:7)

HIPÓTESIS: La autenticación no se completa porque el usuario no es encontrado, a pesar de que el usuario está en la base de datos:

image

Parece que hay algo en la autenticación que no funciona adecuadamente. Se requiere verificar el funcionamiento de la autenticación y corregir el bug. La excepción debería ser manejada y mostrarse un error, ya que hoy por hoy falla sin advertir al usuario.

jonduttweiler commented 2 years ago

Se corrigió la configuracion de avaldao-docker, ya que faltaba actualizar el default.json de avaldao para que utilice los tokens generados por efem-users-service. Se mejoraron mensajes de error