xDai Stable Chain xDai Stable Chain BlockScout BlockScout TokenBridge TokenBridge

No function clause matching in EthereumJSONRPC.Transaction.entry_to_elixir

Hi all,

BlockScout is failing with following error:

2019-07-19T06:48:36.516 application=indexer fetcher=block_catchup first_block_number=1684224 last_block_number=1684215 [error] ** (FunctionClauseError) no function clause matching in EthereumJSONRPC.Transaction.entry_to_elixir/1
(ethereum_jsonrpc) lib/ethereum_jsonrpc/transaction.ex:321: EthereumJSONRPC.Transaction.entry_to_elixir({“replayProtected”, false})
(elixir) lib/map.ex:216: Map.new_transform/3
(elixir) lib/enum.ex:1336: Enum."-map/2-lists^map/1-0-"/2
(ethereum_jsonrpc) lib/ethereum_jsonrpc/transactions.ex:156: EthereumJSONRPC.Transactions.to_elixir/1
(ethereum_jsonrpc) lib/ethereum_jsonrpc/block.ex:462: EthereumJSONRPC.Block.entry_to_elixir/1
(elixir) lib/map.ex:216: Map.new_transform/3
(elixir) lib/enum.ex:1336: Enum."-map/2-lists^map/1-0-"/2
(ethereum_jsonrpc) lib/ethereum_jsonrpc/blocks.ex:44: EthereumJSONRPC.Blocks.from_responses/2
(ethereum_jsonrpc) lib/ethereum_jsonrpc.ex:454: EthereumJSONRPC.fetch_blocks_by_params/3
(indexer) lib/indexer/block/fetcher.ex:129: Indexer.Block.Fetcher.fetch_and_import_range/2
(indexer) lib/indexer/block/catchup/fetcher.ex:187: Indexer.Block.Catchup.Fetcher.fetch_and_import_range_from_sequence/3
(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

I see that this issue was resolved before, but I’m stuck with this.

BlockScout - latest from GitHub
Ubuntu 18.04 LTS
Elixir 1.9
Erlang 21.0.5 OTP
Using Geth-Classic 6.0.6 Beta

Don’t know was this reported before.
Any suggestions to resolve this issue?

Hi, we have a fix for you https://github.com/poanetwork/blockscout/pull/2387. Please try it from ab-skip-transaction-keys branch and let us know if it helps to eliminate this error.

Thanks for the fix @viktorbaranov!

I checked out this branch and installed following manual deployment again, but when try to start BlockScout now it fails with:

** (Mix) Could not start application explorer: Explorer.Application.start(:normal, ) returned an error: shutdown: failed to start child: Explorer.Counters.AverageBlockTime
** (EXIT) an exception was raised:
** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2721ms. You can configure how long requests wait in the queue using :queue_target and :queue_interval. See DBConnection.start_link/2 for more information
(ecto_sql) lib/ecto/adapters/sql.ex:620: Ecto.Adapters.SQL.raise_sql_call_error/1
(ecto_sql) lib/ecto/adapters/sql.ex:553: Ecto.Adapters.SQL.execute/5
(ecto) lib/ecto/repo/queryable.ex:147: Ecto.Repo.Queryable.execute/4
(ecto) lib/ecto/repo/queryable.ex:18: Ecto.Repo.Queryable.all/3
(explorer) lib/explorer/counters/average_block_time.ex:84: Explorer.Counters.AverageBlockTime.refresh_timestamps/0
(explorer) lib/explorer/counters/average_block_time.ex:46: Explorer.Counters.AverageBlockTime.init/1
(stdlib) gen_server.erl:374: :gen_server.init_it/2
(stdlib) gen_server.erl:342: :gen_server.init_it/6
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

Checked postgresql, everything is there:

postgres=# \list
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
--------------±---------±---------±--------±--------±----------------------
explorer_dev | postgres | UTF8 | C.UTF-8 | C.UTF-8 |
postgres | postgres | UTF8 | C.UTF-8 | C.UTF-8 |
template0 | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
ubuntu | postgres | UTF8 | C.UTF-8 | C.UTF-8 |
(5 rows)

postgres=# \c explorer_dev
You are now connected to database “explorer_dev” as user “postgres”.
explorer_dev=# \dt
List of relations
Schema | Name | Type | Owner
--------±-------------------------------±------±---------
public | address_coin_balances | table | postgres
public | address_current_token_balances | table | postgres
public | address_names | table | postgres
public | address_token_balances | table | postgres
public | addresses | table | postgres
public | administrators | table | postgres
public | block_rewards | table | postgres
public | block_second_degree_relations | table | postgres
public | blocks | table | postgres
public | contract_methods | table | postgres
public | decompiled_smart_contracts | table | postgres
public | emission_rewards | table | postgres
public | internal_transactions | table | postgres
public | logs | table | postgres
public | market_history | table | postgres
public | schema_migrations | table | postgres
public | smart_contracts | table | postgres
public | staking_pools | table | postgres
public | staking_pools_delegators | table | postgres
public | token_transfers | table | postgres
public | tokens | table | postgres
public | transaction_forks | table | postgres
public | transactions | table | postgres
public | user_contacts | table | postgres
public | users | table | postgres
(25 rows)

I rebooted server and now there are lots of errors.
Looks like I’m doing something wrong.

Try to repeat clean install from scratch following the manual deployment guide using branch I posted before.

1 Like