POA Forum

API call to get a diagnostic of a deployment

Hello,

I’ve set up a deployment of blockscout on a small testnet called firenze accessible at https://firenze-explorer.primusmoney.com.

The interface is stuck at '0% Blocks Indexed - We’re indexing this chain right now. Some of the counts may be inaccurate.".

The deployment is within a docker container using the puppeth/blockscout image. The geth node is running in another docker in the same subnet. The Postgres database is runing within the bockscout container. All these elements (db and geth node) are correctly accessible via a bash command line running within the blockscout container. The different postgres tables are apparently ok, but the blocks table for example remains empty.

Is there an api call (e.g. /api?module=admin&action=status) that could help diagnose the issues on this deployment?

Thx

Hi. Apparently, Blockscout doesn’t see the node. There is no API endpoint to diagnose deployment. Do you see any errors in the logs in Blockscout container? Which values are set for ETHEREUM_JSONRPC_ env variables family?

Hi,

What log file should I look at?

A bash file within the container is spawning mix phx.server at container’s boot time and overload only these 2 env variables.

export COIN=DAI
export ETHEREUM_JSONRPC_VARIANT=geth
export ETHEREUM_JSONRPC_HTTP_URL=http://192.168.xxx.xxx:8545

the rest of the environment variables are set by the container image.

Is there a script I could run within the docker container that could provide a status?

Thx

PS: ws access to the node is not possible. Is it necessary to disable it through some env variable?

There is a minimal set of env variables you should set

DATABASE_URL=...
ETHEREUM_JSONRPC_VARIANT=geth
ETHEREUM_JSONRPC_HTTP_URL=...
ETHEREUM_JSONRPC_TRACE_URL=...

ETHEREUM_JSONRPC_TRACE_URL should be the same as ETHEREUM_JSONRPC_HTTP_URL if you have one RPC node.

ws access to the node is not possible. Is it necessary to disable it through some env variable?

That is fine. It is disabled by default if ETHEREUM_JSONRPC_WS_URL is not provided.

Is there a script I could run within the docker container that could provide a status

No such script. You can check the occupancy of blocks table.

Logs are located in ./logs/prod/error or ./logs/dev/error folder of the application depending of what MIX_ENV value is set.

Are RPC requests passed with http://192.168.xxx.xxx:8545 endpoint?

Logs are located in ./logs/…
At the end of the message a tail of /opt/app/apps//block_scout_web/logs/prod/error.log

ETHEREUM_JSONRPC_TRACE_URL should be the same as ETHEREUM_JSONRPC_HTTP_URL

tried to set ETHEREUM_JSONRPC_TRACE_URL in the startup bash script, but it did not change the result

DATABASE_URL=…

this is set by container’s image and is:
DATABASE_URL=postgresql://postgres:@localhost:5432/explorer?ssl=false

Are RPC requests are passed with http://192.168.xxx.xxx:8545 endpoint?

executing within the container from bash command line:
$ curl -H “Content-Type: application/json” --data “{“jsonrpc”:“2.0”,“method”:“net_version”,“params”:[],“id”:67}” http://192.168.xxx.xxx:8545

is working as expected.

As a more generic question, is there a documented procedure to make a container operational after running:

$ docker run -it puppeth/blockscout /bin/bash

Thx


2020-04-22T08:49:34.455 [error] Task #PID<0.1364.1> started from Explorer.ExchangeRates terminating
** (FunctionClauseError) no function clause matching in Access.get/3
(elixir) lib/access.ex:320: Access.get(“error code: 1015”, “error”, nil)
(explorer) lib/explorer/exchange_rates/source.ex:32: Explorer.ExchangeRates.Source.fetch_exchange_rates_from_paginable_source/2
(elixir) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
(elixir) lib/task/supervised.ex:35: Task.Supervised.reply/5
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Function: #Function<0.14719208/0 in Explorer.ExchangeRates.fetch_rates/0>
Args: []
2020-04-22T08:54:34.486 [error] Task #PID<0.1370.1> started from Explorer.ExchangeRates terminating
** (FunctionClauseError) no function clause matching in Access.get/3
(elixir) lib/access.ex:320: Access.get(“error code: 1015”, “error”, nil)
(explorer) lib/explorer/exchange_rates/source.ex:32: Explorer.ExchangeRates.Source.fetch_exchange_rates_from_paginable_source/2
(elixir) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
(elixir) lib/task/supervised.ex:35: Task.Supervised.reply/5
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Function: #Function<0.14719208/0 in Explorer.ExchangeRates.fetch_rates/0>
Args: []
2020-04-22T09:06:41.532 application=phoenix [error] Could not find static manifest at “/opt/app/_build/prod/lib/block_scout_web/priv/static/cache_manifest.json”. Run “mix phx.digest” after building your static files or remove the configuration from “config/prod.exs”.

We have no control over Blockscout image created in puppeth/blockscout repo. And I am not sure it uses the latest stable release of Blockscout https://github.com/poanetwork/blockscout/releases. Docker integration instruction, which Blockscout team provides, is here https://docs.blockscout.com/for-developers/information-and-settings/docker-integration-local-use-only. Make sure also, that your Geth node is synced and works in archive mode https://docs.blockscout.com/for-developers/information-and-settings/client-settings-parity-geth-ganache#geth-client.