gobitfly / eth2-beaconchain-explorer

Open source golang based explorer for the eth2 beacon chain
GNU General Public License v3.0
802 stars 420 forks source link

The sql statement does not work correctly #1588

Closed J1a-wei closed 1 year ago

J1a-wei commented 2 years ago
Password for user postgres:
CREATE EXTENSION
psql:/src/tables.sql:9: NOTICE:  table "validators" does not exist, skipping
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
psql:/src/tables.sql:38: NOTICE:  table "validator_pool" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:46: NOTICE:  table "validator_names" does not exist, skipping
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
psql:/src/tables.sql:56: NOTICE:  table "validator_set" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:71: NOTICE:  table "validator_performance" does not exist, skipping
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
psql:/src/tables.sql:90: NOTICE:  table "proposal_assignments" does not exist, skipping
DROP TABLE
CREATE TABLE
CREATE INDEX
psql:/src/tables.sql:101: NOTICE:  table "sync_committees" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:110: NOTICE:  table "validator_balances_recent" does not exist, skipping
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
CREATE INDEX
psql:/src/tables.sql:122: NOTICE:  table "validator_stats" does not exist, skipping
DROP TABLE
CREATE TABLE
CREATE INDEX
psql:/src/tables.sql:151: NOTICE:  table "validator_stats_status" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:159: NOTICE:  table "validator_attestation_streaks" does not exist, skipping
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
psql:/src/tables.sql:175: NOTICE:  table "queue" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:184: NOTICE:  table "validatorqueue_activation" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:192: NOTICE:  table "validatorqueue_exit" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:200: NOTICE:  table "epochs" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:220: NOTICE:  table "blocks" does not exist, skipping
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
psql:/src/tables.sql:271: NOTICE:  table "blocks_transactions" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:291: NOTICE:  table "blocks_proposerslashings" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:311: NOTICE:  table "blocks_attesterslashings" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:338: NOTICE:  table "blocks_attestations" does not exist, skipping
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
CREATE INDEX
psql:/src/tables.sql:360: NOTICE:  table "blocks_deposits" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:374: NOTICE:  table "blocks_voluntaryexits" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:386: NOTICE:  table "network_liveness" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:397: NOTICE:  table "graffitiwall" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:408: NOTICE:  table "eth1_deposits" does not exist, skipping
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
psql:/src/tables.sql:429: NOTICE:  table "users" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:446: NOTICE:  table "users_datatable" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:456: NOTICE:  table "users_stripe_subscriptions" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:468: NOTICE:  table "users_app_subscriptions" does not exist, skipping
DROP TABLE
CREATE TABLE
CREATE INDEX
psql:/src/tables.sql:489: NOTICE:  table "oauth_apps" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:501: NOTICE:  table "oauth_codes" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:514: NOTICE:  table "users_devices" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:529: NOTICE:  table "users_clients" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:542: NOTICE:  table "users_subscriptions" does not exist, skipping
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE TYPE
psql:/src/tables.sql:561: NOTICE:  table "users_notification_channels" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:570: NOTICE:  table "notification_queue" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:593: NOTICE:  table "users_validators_tags" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:602: NOTICE:  table "validator_tags" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:610: NOTICE:  table "users_webhooks" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:626: NOTICE:  table "mails_sent" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:635: NOTICE:  table "chart_images" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:642: NOTICE:  table "api_statistics" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:652: NOTICE:  table "stats_meta_p" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:668: NOTICE:  table "stats_process" does not exist, skipping
DROP TABLE
psql:/src/tables.sql:686: ERROR:  relation "stats_meta" does not exist
psql:/src/tables.sql:687: ERROR:  relation "stats_process" does not exist
psql:/src/tables.sql:689: NOTICE:  table "stats_add_beaconnode" does not exist, skipping
DROP TABLE
psql:/src/tables.sql:706: ERROR:  relation "stats_process" does not exist
psql:/src/tables.sql:707: ERROR:  relation "stats_add_beaconnode" does not exist
psql:/src/tables.sql:709: NOTICE:  table "stats_add_validator" does not exist, skipping
DROP TABLE
psql:/src/tables.sql:718: ERROR:  relation "stats_process" does not exist
psql:/src/tables.sql:719: ERROR:  relation "stats_add_validator" does not exist
psql:/src/tables.sql:721: NOTICE:  table "stats_system" does not exist, skipping
DROP TABLE
psql:/src/tables.sql:755: ERROR:  relation "stats_meta" does not exist
psql:/src/tables.sql:757: ERROR:  relation "stats_system" does not exist
psql:/src/tables.sql:759: NOTICE:  table "stake_pools_stats" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:770: NOTICE:  table "price" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:785: NOTICE:  table "staking_pools_chart" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:795: NOTICE:  table "stats_sharing" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:804: NOTICE:  table "finality_checkpoints" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:817: NOTICE:  table "rocketpool_export_status" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:825: NOTICE:  table "rocketpool_minipools" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:841: NOTICE:  table "rocketpool_nodes" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:860: NOTICE:  table "rocketpool_dao_proposals" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:886: NOTICE:  table "rocketpool_dao_proposals_member_votes" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:899: NOTICE:  table "rocketpool_dao_members" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:915: NOTICE:  table "rocketpool_network_stats" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:938: NOTICE:  table "rocketpool_reward_tree" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:947: NOTICE:  table "eth_store_stats" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:960: NOTICE:  table "historical_pool_performance" does not exist, skipping
DROP TABLE
CREATE TABLE
psql:/src/tables.sql:974: NOTICE:  table "relays" does not exist, skipping
DROP TABLE
psql:/src/tables.sql:975: NOTICE:  table "blocks_tags" does not exist, skipping
DROP TABLE
psql:/src/tables.sql:976: NOTICE:  table "tags" does not exist, skipping
DROP TABLE
CREATE TABLE
CREATE TABLE
CREATE INDEX
CREATE TABLE
psql:/src/tables.sql:1001: NOTICE:  table "validator_queue_deposits" does not exist, skipping
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX

Foreign key reference table does not exist. e.g. stats_meta and stats_meta_p

J1a-wei commented 2 years ago
CREATE TABLE stats_meta_p (
                              id                    bigserial UNIQUE,
                              version           int                         not null default 1,
                              ts                    timestamp                   not null,
                              process           character varying(20)       not null,
                              machine           character varying(50),
                              created_trunc       timestamp   not null,
                              exporter_version    varchar(35),
                              day                 int,

                              user_id           bigint                      not null,
                              primary key (id, day)

) PARTITION BY LIST (day);

CREATE TABLE stats_process (
                               id               bigserial           primary key,

                               cpu_process_seconds_total    bigint              not null,

                               memory_process_bytes     bigint              not null,

                               client_name          character varying(25)   not null,
                               client_version           character varying(25)       not null,
                               client_build         int                 not null,

                               sync_eth2_fallback_configured  bool              not null,
                               sync_eth2_fallback_connected     bool                not null,

                               meta_id          bigint              not null,

                               foreign key(meta_id) references stats_meta(id)
);

stats_process foreign key(meta_id) references stats_meta(id) But table.sql not create it.

Which branch is the stable version?

recy21 commented 1 year ago

Outdated issue, please report again if the problem still persists.