pay2exchange/pay2exchange-core

not-existent JSON --genesis-json = throw: open_chain_database(), json lib, readsome()

Open

#15 opened on Jul 30, 2025

View on GitHub
 (0 comments) (0 reactions) (0 assignees)C++ (0 forks)auto 404
enhancementgood first issueupstream

Repository metrics

Stars
 (0 stars)
PR merge metrics
 (PR metrics pending)

Description

If the --genesis-json file does not exist, then we should tell user in nicer way, the exception and last logs make it look more like the state database, and not reading the genesis file provided.

In commit 6129305f544819949399aefe5359bd4925cff138 (HEAD -> dbg_slots_fork, origin/dbg_slots_fork) based on upstream 597e70efb868ff6d44a0734627c4b9d0eb07aeea

  • This should be an error that is more user friendly.

1922584ms th_a application.cpp:1357 initialize ] Initializing application 1922584ms th_a application.cpp:1121 initialize_plugins ] Initializing plugin account_history 1922584ms th_a application.cpp:1123 initialize_plugins ] Initialized plugin account_history 1922584ms th_a application.cpp:1121 initialize_plugins ] Initializing plugin api_helper_indexes 1922584ms th_a application.cpp:1123 initialize_plugins ] Initialized plugin api_helper_indexes 1922584ms th_a application.cpp:1121 initialize_plugins ] Initializing plugin custom_operations 1922584ms th_a application.cpp:1123 initialize_plugins ] Initialized plugin custom_operations 1922584ms th_a application.cpp:1121 initialize_plugins ] Initializing plugin grouped_orders 1922584ms th_a application.cpp:1123 initialize_plugins ] Initialized plugin grouped_orders 1922584ms th_a application.cpp:1121 initialize_plugins ] Initializing plugin market_history 1922584ms th_a application.cpp:1123 initialize_plugins ] Initialized plugin market_history 1922584ms th_a application.cpp:1121 initialize_plugins ] Initializing plugin witness 1922584ms th_a witness.cpp:122 plugin_initialize ] witness plugin: plugin_initialize() begin 1922585ms th_a witness.cpp:115 add_private_key ] Public Key: BTS5k46b9hXwYjLCZZy8usUGjtREeoQeEoLRUonJVkvp9GvVM3bx9 1922585ms th_a witness.cpp:115 add_private_key ] Public Key: BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV 1922585ms th_a witness.cpp:168 plugin_initialize ] witness plugin: plugin_initialize() end 1922585ms th_a application.cpp:1123 initialize_plugins ] Initialized plugin witness 1922585ms th_a application.cpp:1359 initialize ] Done initializing application 1922585ms th_a application.cpp:1365 startup ] Starting up application 1922585ms th_a db_management.cpp:209 open ] Wiping object_database due to missing or wrong version 1922585ms th_a object_database.cpp:127 wipe ] Wiping object database... 1922585ms th_a object_database.cpp:129 wipe ] Done wiping object database. 1922585ms th_a object_database.cpp:150 open ] Opening object database from /home/null24/code/core/pay2exchange-core/witness_node_data_dir/blockchain ... [New Thread 0x7ffff61ff6c0 (LWP 17549)] [New Thread 0x7ffff59fe6c0 (LWP 17550)] [New Thread 0x7ffff51fd6c0 (LWP 17551)] [New Thread 0x7ffff49fc6c0 (LWP 17552)] [New Thread 0x7fffe7fff6c0 (LWP 17553)] [New Thread 0x7fffe77fe6c0 (LWP 17554)] [New Thread 0x7fffe6ffd6c0 (LWP 17555)] [New Thread 0x7fffe67fc6c0 (LWP 17556)] [New Thread 0x7fffe5ffb6c0 (LWP 17557)] [New Thread 0x7fffe57fa6c0 (LWP 17558)] [New Thread 0x7fffe4ff96c0 (LWP 17559)] [New Thread 0x7fffc7fff6c0 (LWP 17560)] [New Thread 0x7fffc77fe6c0 (LWP 17561)] [New Thread 0x7fffc6ffd6c0 (LWP 17562)] [New Thread 0x7fffc67fc6c0 (LWP 17563)] [New Thread 0x7fffc5ffb6c0 (LWP 17564)] [New Thread 0x7fffc57fa6c0 (LWP 17565)] [New Thread 0x7fffc4ff96c0 (LWP 17566)] [New Thread 0x7fffa3fff6c0 (LWP 17567)] [New Thread 0x7fffa37fe6c0 (LWP 17568)] [New Thread 0x7fffa2ffd6c0 (LWP 17569)] [New Thread 0x7fffa27fc6c0 (LWP 17570)] [New Thread 0x7fffa1ffb6c0 (LWP 17571)] [New Thread 0x7fffa17fa6c0 (LWP 17572)] 1922589ms th_a object_database.cpp:160 open ] Done opening object database. 1922590ms th_a application.cpp:482 initialize_genesis_s ] Initializing database...

Thread 1 "witness_node" hit Catchpoint 1 (exception thrown), 0x00007ffff74bb35a in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6 (gdb) bt #0 0x00007ffff74bb35a in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6 #1 0x0000555561cae11e in fc::stringstream::readsome (this=0x555563a9dce0, buf=0x7fffffffbb40 "0\352\373\367\377\177", len=1024) at /home/null24/code/tmp-core/pay2exchange-core/libraries/fc/src/io/sstream.cpp:66 #2 0x0000555561ca7a2d in fc::buffered_istream::peek (this=0x7fffffffc290) at /home/null24/code/tmp-core/pay2exchange-core/libraries/fc/src/io/buffered_iostream.cpp:120 #3 0x0000555561cb9371 in fc::skip_white_spacefc::buffered_istream (in=...) at /home/null24/code/tmp-core/pay2exchange-core/libraries/fc/src/io/json.cpp:81 #4 0x0000555561cb3c38 in fc::variant_from_stream<fc::buffered_istream, (fc::json::parse_type)0> (in=..., max_depth=200) at /home/null24/code/tmp-core/pay2exchange-core/libraries/fc/src/io/json.cpp:417 #5 0x0000555561cb1087 in fc::json::from_stream (in=..., ptype=fc::json::legacy_parser, max_depth=200) at /home/null24/code/tmp-core/pay2exchange-core/libraries/fc/src/io/json.cpp:778 #6 0x0000555561caea65 in fc::json::from_string (utf8_str="", ptype=fc::json::legacy_parser, max_depth=200) at /home/null24/code/tmp-core/pay2exchange-core/libraries/fc/src/io/json.cpp:462 #7 0x0000555560f2f372 in graphene::app::detail::application_impl::initialize_genesis_state (this=0x555563a3a800) at /home/null24/code/tmp-core/pay2exchange-core/libraries/app/application.cpp:487 #8 0x0000555560f318bd in operator() (__closure=0x7fffffffce30) at /home/null24/code/tmp-core/pay2exchange-core/libraries/app/application.cpp:583 #9 0x0000555560f49609 in std::__invoke_impl<graphene::chain::genesis_state_type, graphene::app::detail::application_impl::open_chain_database() const::<lambda()>&>(std::__invoke_other, struct {...} &) (__f=...) at /usr/include/c++/13/bits/invoke.h:61 #10 0x0000555560f494c9 in std::__invoke_r<graphene::chain::genesis_state_type, graphene::app::detail::application_impl::open_chain_database() const::<lambda()>&>(struct {...} &) (__fn=...) at /usr/include/c++/13/bits/invoke.h:139 #11 0x0000555560f48e8f in std::_Function_handler<graphene::chain::genesis_state_type(), graphene::app::detail::application_impl::open_chain_database() const::<lambda()> >::_M_invoke(const std::_Any_data &) (__functor=...) at /usr/include/c++/13/bits/std_function.h:291 #12 0x00005555613d4b36 in std::function<graphene::chain::genesis_state_type ()>::operator()() const (this=0x7fffffffce30) at /usr/include/c++/13/bits/std_function.h:591 #13 0x0000555561328a91 in graphene::chain::database::open(fc::path const&, std::function<graphene::chain::genesis_state_type ()>, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) (this=0x555563a3aa60, data_dir=..., genesis_loader=..., db_version="20230906") at /home/null24/code/tmp-core/pay2exchange-core/libraries/chain/db_management.cpp:222 #14 0x0000555560f31983 in operator() (__closure=0x7fffffffce80) at /home/null24/code/tmp-core/pay2exchange-core/libraries/app/application.cpp:587 #15 0x0000555560f48cea in graphene::chain::detail::with_skip_flags<graphene::app::detail::application_impl::open_chain_database() const::<lambda()> >(graphene::chain::database &, uint32_t, struct {...}) (db=..., skip_flags=1207, callback=...) at /home/null24/code/tmp-core/pay2exchange-core/libraries/chain/include/graphene/chain/db_with.hpp:121 #16 0x0000555560f327c0 in graphene::app::detail::application_impl::open_chain_database (this=0x555563a3a800) at /home/null24/code/tmp-core/pay2exchange-core/libraries/app/application.cpp:586 #17 0x0000555560f34815 in graphene::app::detail::application_impl::startup (this=0x555563a3a800) at /home/null24/code/tmp-core/pay2exchange-core/libraries/app/application.cpp:603 #18 0x0000555560f472ad in graphene::app::application::startup (this=0x555563a3a560) at /home/null24/code/tmp-core/pay2exchange-core/libraries/app/application.cpp:1366 #19 0x0000555560b3d1e0 in main (argc=7, argv=0x7fffffffde88) at /home/null24/code/tmp-core/pay2exchange-core/programs/witness_node/main.cpp:209 (gdb)

Contributor guide