vacuumlabs / adalite-backend-service

Icarus, a reference implementation for a lightweight wallet developed by the IOHK Engineering Team.
Apache License 2.0
2 stars 7 forks source link

The instance is unhealthy #77

Closed atomlab closed 4 years ago

atomlab commented 4 years ago

Hi. Can you help to understand how to fix it?

adalite best block

curl http://localhost:8080/api/v2/bestBlock

output

{"Right":{"bestBlock":3799517}}

request to adalite

curl http://localhost:8080/api/addresses/summary/DdzFFzCqrhsg9praJaDBEdUdm9i7fbKrHkH1oTkSbcgnRELWUKrJhABcdsi69fQRUT7AiCSH6JLsRibymq2WMG8TMW4HPGFpA2EB7ZDq

output

{"code":"Internal","message":"The instance is unhealthy"}

adalite logs

[2020-02-20T22:13:16.108Z] ERROR: [object Object]/29 on adalite-backend-01: The instance is unhealthy (req.route=/api/addresses/summary/:address, res.status=500, res.time=1, res.restCode=Internal) GET /api/addresses/summary/DdzFFzCqrhskHPfLmKdxAkfQS4Js1fedSHP8JEixboyJqVRUtRznnZwfAR3BHhX7hvXoY626nvk1F95emnNuDrpU4x6kaT9CPss4hxzZ HTTP/1.1 [2020-02-20T22:13:16.963Z] ERROR: [object Object]/29 on adalite-backend-01: The instance is unhealthy (req.route=/api/v2/txs/history, res.status=500, res.time=1, res.restCode=Internal) POST /api/v2/txs/history HTTP/1.1 [2020-02-20T22:13:17.033Z] ERROR: [object Object]/29 on adalite-backend-01: The instance is unhealthy (req.route=/api/addresses/summary/:address, res.status=500, res.time=0, res.restCode=Internal) GET /api/addresses/summary/DdzFFzCqrhsmhxTboCLvsPJPrdWsGQbNjX3FoNG49DUJVfyn3QcXtoLVRucFbLpXDtaWbyumEs4HjLhP19Q5Hy5fs5VRbaGygTNVoJ9F HTTP/1.1 [2020-02-20T22:13:17.107Z] ERROR: [object Object]/29 on adalite-backend-01: The instance is unhealthy (req.route=/api/addresses/summary/:address, res.status=500, res.time=1, res.restCode=Internal) GET /api/addresses/summary/DdzFFzCqrhsrWkTYC6jH6bBE7XMup6Kz2cS4dQgjD9ec1FXRBsAX48pGnAFtTrqvqexcndf6P1EXZUb7EsvzvHwtLMgqFezFbzN7W75V HTTP/1.1 [2020-02-20T22:13:17.186Z] ERROR: [object Object]/29 on adalite-backend-01: The instance is unhealthy (req.route=/api/v2/txs/history, res.status=500, res.time=1, res.restCode=Internal)

request to importer

curl -v  http://127.0.0.1:8200/api/addresses/summary/DdzFFzCqrhsmhxTboCLvsPJPrdWsGQbNjX3FoNG49DUJVfyn3QcXtoLVRucFbLpXDtaWbyumEs4HjLhP19Q5Hy5fs5VRbaGygTNVoJ9F

output

*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8200 (#0)
> GET /api/addresses/summary/DdzFFzCqrhsmhxTboCLvsPJPrdWsGQbNjX3FoNG49DUJVfyn3QcXtoLVRucFbLpXDtaWbyumEs4HjLhP19Q5Hy5fs5VRbaGygTNVoJ9F HTTP/1.1
> Host: 127.0.0.1:8200
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Transfer-Encoding: chunked
< Date: Fri, 21 Feb 2020 09:22:58 GMT
< Server: Warp/3.2.13
<
* Connection #0 to host 127.0.0.1 left intact

I'm trying to use this api for importer.

jmuravsky commented 4 years ago

Hi, what branch are you using? because since yesterday, the network infrastructure of cardano changed and only the new-importer branch supports the new infrastructure.

atomlab commented 4 years ago

Hi, what branch are you using? because since yesterday, the network infrastructure of cardano changed and only the new-importer branch supports the new infrastructure.

Thanks for response!

I have build from this commit https://github.com/vacuumlabs/adalite-backend-service/commit/f7583a5a4eeef818b929253b3763f80ad5fe58be. It haven't solved the problem.

bestBlock

curl http://localhost:8080/api/v2/bestBlock
{"Right":{"bestBlock":3799517}}

logs

[2020-02-21T11:10:12.707Z] ERROR: [object Object]/29 on adalite-backend-01: The instance is unhealthy (req.route=/api/addresses/summary/:address, res.status=500, res.time=0) GET /api/addresses/summary/DdzFFzCqrhtBFfArgfz676FNPqq8JtufgJP58sQpk1rji34Zk7XK9BhTHbU8Z6BT7LoGDZ5vuMWck4cuCwhEbjrTXG1fSp1dAaNDgvu4 HTTP/1.1

atomlab commented 4 years ago

I have deleted all data and resync blockchain again.

adalite-backand built from new-importer branch.

importer built from default branch.

Last block have reached 3799517 and stop.

atomlab commented 4 years ago

I have updated adalite-backend from develop branch today and it work without errors in log. But last block 3799517.

curl http://localhost:8080/api/v2/bestBlock
{"Right":{"bestBlock":3799517}}

postresql

root@adalite-backend-02:~# docker exec -it postgres psql -U adalite
adalite=# select * from bestblock;
 best_block_num
----------------
        3799517
(1 row)

I think project-icarus-importer isn't support Ouroboros BFT hard fork. This is my guess.

jmuravsky commented 4 years ago

sorry for not replying sooner, yes icarus importer doesnt support the fork, heres a link to repository for tangata manu, that does support the fork and that we use on our own backend currently https://github.com/Emurgo/tangata-manu

atomlab commented 4 years ago

Thanks for response! Understand now.

atomlab commented 4 years ago

@jurajpelikan

sorry for not replying sooner, yes icarus importer doesnt support the fork, heres a link to repository for tangata manu, that does support the fork and that we use on our own backend currently https://github.com/Emurgo/tangata-manu

Sorry for reopen issue, but I have a one question. adalite-backend works with tangata-manu instead project-icarus-importer?

jmuravsky commented 4 years ago

yes, tangata-manu is a new version of the official importer, project-icarus was discontinued with the BFT fork

atomlab commented 4 years ago

yes, tangata-manu is a new version of the official importer, project-icarus was discontinued with the BFT fork

Thank you for response. As I understand adalite needs to use own postgres db? Right?

Adalite backend stack:

  1. adalite backend service
  2. postgres db
  3. IMPORTER_ENDPOINT: http://<TANGATA_HOST>:<TANGATA_PORT>/api/txs/signed

    Before project-icarus-importer was importing blocks to porstgres database. Adalte was reading data from postgres. But how it works now?

Tangata-manu stack:

  1. crdano-http-bridge(emurgo fork)
  2. postgres db
  3. tangata-manu serivce
jmuravsky commented 4 years ago

no, as far as i know those 2 stacks interact via the postgres db as well as the importer endpoint. we have only one db set up on our backend. it makes searching through addresses and utxos much faster since it uses the indexed tables.

atomlab commented 4 years ago

Thank you. I have run all stack.