Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating for Chang HF: ERROR: cannot alter type of a column used by a view or rule #1822

Closed
zxpectre opened this issue Aug 22, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@zxpectre
Copy link

zxpectre commented Aug 22, 2024

OS
Your OS:

Operating System: Ubuntu 24.04 LTS                
Kernel: Linux 6.8.0-40-generic
Architecture: x86-64
(hostnamectl)

Versions
The db-sync version (eg cardano-db-sync --version):
Docker image: ghcr.io/intersectmbo/cardano-db-sync:13.4.0.1

PostgreSQL version:
16.1-bullseye

Build/Install Method
The method you use to build or install cardano-db-sync:
docker-compose (podman)

Run method
The method you used to run cardano-db-sync (eg Nix/Docker/systemd/none):
docker-compose (podman)

Additional context
Add any other context about the problem here.

Using Pre-Production testnet.

Previous node data, dbsync ledger state files and postgresDB data was filled by this stack:

CARDANO_NODE_VERSION=8.9.3
OGMIOS_VERSION=v6.6.0
CARDANO_DB_SYNC_VERSION=13.2.0.2

Koios and Dandelion's PostGREST APIs are present on same docker compose stack and reading from db

Problem Report
Please do not include screenshots or images, but instead cut and paste any relevant log messages
or errors.

When updating node and APIs versions for Chang hard fork I find this issue that crashes db-sync.
This happens whether I remove the ledger state files or keep the old ones (even dropping dbsync volume). This while keeping postgresDB and cardano-node-ogmios database volumes intact to speedup sync and migration.

cardano-db-sync-1  | Connecting to network: preprod
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-22 01:04:25.50 UTC] Version number: 13.4.0.0
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-22 01:04:25.50 UTC] Git hash: dbea349bfee8159bf443ce6fdeec4d3670ac3e70
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-22 01:04:25.50 UTC] Enviroment variable DbSyncAbortOnPanic: False
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-22 01:04:25.50 UTC] SyncNodeParams {enpConfigFile = ConfigFile {unConfigFile = "/nix/store/839qrxw9249ibv4gp4sbsh055ln25s2h-db-sync-config.json"}, enpSocketPath = SocketPath {unSocketPath = "/node-ipc/node.socket"}, enpMaybeLedgerStateDir = Just (LedgerStateDir {unLedgerStateDir = "/var/lib/cexplorer"}), enpMigrationDir = MigrationDir "/nix/store/56hx3ivcrirvc4bhxdiyhj5x8z9l6izi-schema", enpPGPassSource = PGPassDefaultEnv, enpEpochDisabled = False, enpHasCache = True, enpSkipFix = False, enpOnlyFix = False, enpForceIndexes = False, enpHasInOut = True, enpSnEveryFollowing = 500, enpSnEveryLagging = 10000, enpMaybeRollback = Nothing}
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-22 01:04:25.50 UTC] SyncOptions {soptEpochAndCacheEnabled = True, soptAbortOnInvalid = False, soptCache = True, soptSkipFix = False, soptOnlyFix = False, soptPruneConsumeMigration = PruneConsumeMigration {pcmPruneTxOut = False, pcmConsumeOrPruneTxOut = False, pcmSkipTxIn = False}, soptInsertOptions = InsertOptions {ioTxCBOR = False, ioInOut = True, ioUseLedger = True, ioShelley = True, ioRewards = True, ioMultiAssets = True, ioMetadata = True, ioKeepMetadataNames = Nothing, ioPlutusExtra = True, ioOffChainPoolData = True, ioPoolStats = False, ioGov = True, ioRemoveJsonbFromSchema = False}, snapshotEveryFollowing = 500, snapshotEveryLagging = 10000}
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-22 01:04:25.51 UTC] Schema migration files validated
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-22 01:04:25.52 UTC] Running database migrations in mode Initial
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-22 01:04:25.52 UTC] Found maintenance_work_mem=1GB, max_parallel_maintenance_workers=4
cardano-db-sync-1  | ExitFailure 3
cardano-db-sync-1  | 
cardano-db-sync-1  | Errors in file: /tmp/migrate-2024-08-22T01:04:25.531061403Z.log

$ cat /tmp/migrate-2024-08-22T00:40:32.347837119Z.log

Running : migration-2-0035-20240308.sql
psql:/nix/store/56hx3ivcrirvc4bhxdiyhj5x8z9l6izi-schema/migration-2-0035-20240308.sql:40: ERROR:  cannot alter type of a column used by a view or rule
DETAIL:  rule _RETURN on view cardano_db_sync.gov_action_proposal depends on column "description"
CONTEXT:  SQL statement "ALTER TABLE "gov_action_proposal" ALTER COLUMN "description" TYPE jsonb USING description::jsonb"
PL/pgSQL function migrate() line 7 at EXECUTE
ExitFailure 3


@zxpectre zxpectre added the bug Something isn't working label Aug 22, 2024
@zxpectre
Copy link
Author

Update: The other APIs/components of the stack was affecting dbsync migrations. A cleanup script did the trick and now it is purging ledger state files and seems starting as expected. PostgresDb and node db data is kept intact.

cardano-db-sync-1  | [db-sync-node:Warning:79] [2024-08-22 06:13:59.64 UTC] Failed to parse ledger state file /var/lib/cexplorer/66182363-ee98e8c362-156.lstate with error 'DecoderErrorDeserialiseFailure "Ledger state file" (DeserialiseFailure 349384873 "Size mismatch when decoding Record RecD.\nExpected 4, but found 5.")'. Deleting it.
cardano-db-sync-1  | [db-sync-node:Warning:79] [2024-08-22 06:13:59.68 UTC] Rollback failed. No more ledger state files.
cardano-db-sync-1  | [db-sync-node:Info:79] [2024-08-22 06:13:59.68 UTC] Setting ConsistencyLevel to DBAheadOfLedger
cardano-db-sync-1  | [db-sync-node:Info:79] [2024-08-22 06:14:00.58 UTC] Delaying delete of 2613019 while rolling back to genesis. Applying blocks until a new block is found. The node is currently at Tip (SlotNo 68624012) 75e03d5b34a2126bda91ae9ee0f0da90ac928bd2ac6cd9181eadca2a4672ecb6 (BlockNo 2614561)
cardano-db-sync-1  | [db-sync-node:Info:79] [2024-08-22 06:14:00.60 UTC] Found snapshot file for genesis
cardano-db-sync-1  | [db-sync-node:Info:79] [2024-08-22 06:14:00.60 UTC] Setting ConsistencyLevel to DBAheadOfLedger
cardano-db-sync-1  | [db-sync-node:Info:79] [2024-08-22 06:14:00.61 UTC] Reached EpochNo 0
cardano-db-sync-1  | [db-sync-node:Info:89] [2024-08-22 06:14:00.62 UTC] Asynchronously wrote a ledger snapshot to /var/lib/cexplorer/19445-5c9999c1e6-0.lstate in 0.000377574s.
cardano-db-sync-1  | [db-sync-node:Info:79] [2024-08-22 06:14:00.62 UTC] Reached EpochNo 1
cardano-db-sync-1  | [db-sync-node:Info:89] [2024-08-22 06:14:00.64 UTC] Asynchronously wrote a ledger snapshot to /var/lib/cexplorer/41042-0f3d3f1790-1.lstate in 0.000335385s.
cardano-db-sync-1  | [db-sync-node:Info:79] [2024-08-22 06:14:00.64 UTC] Reached EpochNo 2
cardano-db-sync-1  | [db-sync-node:Info:89] [2024-08-22 06:14:00.66 UTC] Asynchronously wrote a ledger snapshot to /var/lib/cexplorer/62641-e9ba4909cb-2.lstate in 0.000465088s.
cardano-db-sync-1  | [db-sync-node:Info:79] [2024-08-22 06:14:00.66 UTC] Reached EpochNo 3
cardano-db-sync-1  | [db-sync-node:Info:89] [2024-08-22 06:14:00.67 UTC] Asynchronously wrote a ledger snapshot to /var/lib/cexplorer/84242-45899e8002-3.lstate in 0.000858329s.
cardano-db-sync-1  | [db-sync-node:Info:79] [2024-08-22 06:14:00.67 UTC] Reached EpochNo 4
cardano-db-sync-1  | [db-sync-node:Info:89] [2024-08-22 06:15:25.82 UTC] Asynchronously wrote a ledger snapshot to /var/lib/cexplorer/518360-f9d8b6c77f-4.lstate in 0.000962596s.
cardano-db-sync-1  | [db-sync-node:Info:79] [2024-08-22 06:15:25.83 UTC] Reached EpochNo 5
cardano-db-sync-1  | [db-sync-node:Info:79] [2024-08-22 06:16:13.26 UTC] Reached EpochNo 6
cardano-db-sync-1  | [db-sync-node:Info:89] [2024-08-22 06:16:13.29 UTC] Asynchronously wrote a ledger snapshot to /var/lib/cexplorer/950340-74c03af754-5.lstate in 0.023230602s.
cardano-db-sync-1  | [db-sync-node:Info:89] [2024-08-22 06:16:47.58 UTC] Asynchronously wrote a ledger snapshot to /var/lib/cexplorer/1382348-af5fddc7d1-6.lstate in 0.057779894s.
cardano-db-sync-1  | [db-sync-node:Info:79] [2024-08-22 06:16:47.58 UTC] Reached EpochNo 7


Closing the issue!.

@zxpectre
Copy link
Author

zxpectre commented Aug 24, 2024

I'm reopening this issue as these new SQL operations after boot are getting triggered when restarting services and are now proven to be incompatible with our pre-conway stack.

Previously, views applied to the indexed tables were not breaking db-sync boot process

Is it possible for you to run these new migrations/actions without halting db-sync if data and views are already there?

Logs on boot:

cardano-db-sync-1  | Connecting to network: mainnet
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-24 20:19:02.64 UTC] Version number: 13.4.0.0
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-24 20:19:02.64 UTC] Git hash: dbea349bfee8159bf443ce6fdeec4d3670ac3e70
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-24 20:19:02.64 UTC] Enviroment variable DbSyncAbortOnPanic: False
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-24 20:19:02.64 UTC] SyncNodeParams {enpConfigFile = ConfigFile {unConfigFile = "/nix/store/vh8j5dajra1jki1lxl1mzfv7yrjmk6yq-db-sync-config.json"}, enpSocketPath = SocketPath {unSocketPath = "/node-ipc/node.socket"}, enpMaybeLedgerStateDir = Just (LedgerStateDir {unLedgerStateDir = "/var/lib/cexplorer"}), enpMigrationDir = MigrationDir "/nix/store/56hx3ivcrirvc4bhxdiyhj5x8z9l6izi-schema", enpPGPassSource = PGPassDefaultEnv, enpEpochDisabled = False, enpHasCache = True, enpSkipFix = False, enpOnlyFix = False, enpForceIndexes = False, enpHasInOut = True, enpSnEveryFollowing = 500, enpSnEveryLagging = 10000, enpMaybeRollback = Nothing}
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-24 20:19:02.64 UTC] SyncOptions {soptEpochAndCacheEnabled = True, soptAbortOnInvalid = False, soptCache = True, soptSkipFix = False, soptOnlyFix = False, soptPruneConsumeMigration = PruneConsumeMigration {pcmPruneTxOut = False, pcmConsumeOrPruneTxOut = False, pcmSkipTxIn = False}, soptInsertOptions = InsertOptions {ioTxCBOR = False, ioInOut = True, ioUseLedger = True, ioShelley = True, ioRewards = True, ioMultiAssets = True, ioMetadata = True, ioKeepMetadataNames = Nothing, ioPlutusExtra = True, ioOffChainPoolData = True, ioPoolStats = False, ioGov = True, ioRemoveJsonbFromSchema = False}, snapshotEveryFollowing = 500, snapshotEveryLagging = 10000}
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-24 20:19:02.64 UTC] Schema migration files validated
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-24 20:19:02.66 UTC] Running database migrations in mode Initial
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-24 20:19:02.66 UTC] Found maintenance_work_mem=1GB, max_parallel_maintenance_workers=4
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-24 20:19:04.69 UTC] All migrations were executed
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-24 20:19:04.69 UTC] New user indexes were not created. They may be created later if necessary.
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-24 20:19:04.69 UTC] Using byron genesis file from: "/nix/store/iwq90igv72ihdr9z9nl3m0dsiv0bfh7y-byron-genesis.json"
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-24 20:19:04.69 UTC] Using shelley genesis file from: "/nix/store/sr1r1fsqij2bcr3jc1xz7hdgih2w6gp7-shelley-genesis.json"
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-24 20:19:04.69 UTC] Using alonzo genesis file from: "/nix/store/8qnphq6yvcjspiy3z0aijfd6cv64l3hl-alonzo-genesis.json"
cardano-db-sync-1  | [db-sync-node:Info:6] [2024-08-24 20:19:05.28 UTC] NetworkMagic: 764824073
cardano-db-sync-1  | [db-sync-node:Warning:6] [2024-08-24 20:19:05.76 UTC] Adding jsonb datatypes back to the database. This can take time.
cardano-db-sync-1  | cardano-db-sync: DBRJsonbInSchemaSqlError {sqlState = "0A000", sqlExecStatus = FatalError, sqlErrorMsg = "cannot alter type of a column used by a view or rule", sqlErrorDetail = "rule _RETURN on view dandelion_postgrest.tx_metadata depends on column \"json\"", sqlErrorHint = ""}

@zxpectre zxpectre reopened this Aug 24, 2024
@sgillespie
Copy link
Contributor

This is curious:

cardano-db-sync-1  | [db-sync-node:Warning:6] [2024-08-24 20:19:05.76 UTC] Adding jsonb datatypes back to the database. This can take time.

Did you change any config before restarting?

@zxpectre
Copy link
Author

zxpectre commented Aug 26, 2024

Hi @sgillespie !

Our backend consists on Cardano GraphQL, Koios and Dandelion-PostGREST. As Cardano GraphQL is the most complex dependency, we always start upgrading by following their latest setup. In this case config files came from https://github.com/cardano-foundation/cardano-graphql/tree/8.2.1 tag.

What config you think may be involved?

Update (clarification):

To manage to put all services up now this is the procedure I have to do manually:

  • let node sync to tip
  • remove all other API schemas from database only leaving dbsync data and schema there
  • let dbsync fix stuff on boot sequence
  • reapply all API schemas
  • now everything works ok.

on system restarts I am forced now to manually follow this procedure again to keep systems online, what is not ideal. Before this update, everything was working smoothly.

@sgillespie
Copy link
Contributor

Sorry, I'm just referring to the db-sync configuration (presumably db-sync-config.json or db-sync-config.yaml)

@zxpectre
Copy link
Author

zxpectre commented Aug 26, 2024

well yes @sgillespie , in that case i can confirm some files, not that exactly has changed for Chang.
This is the applied Cardano GraphQL changelog cardano-foundation/cardano-graphql@8.0.3...8.2.1

for example: config/network/mainnet/cardano-db-sync/config.json

@zxpectre
Copy link
Author

zxpectre commented Aug 26, 2024

During these hours the posgresDB container volume grew up to 1.2TB and I had to wipe the volume as emergency measure to gain control back of the OS. As far as I could find out, podman logs where not the reason, but something else writing on the volume.

These were last postgresDB logs (maybe irrelevant)

2024-08-26 15:16:50.566 UTC [1] LOG:  database system is ready to accept connections
2024-08-26 15:16:53.435 UTC [223383] ERROR:  could not write to file "base/pgsql_tmp/pgsql_tmp223383.0.fileset/o29of32.p0.0": No space left on device
2024-08-26 15:16:53.435 UTC [223383] STATEMENT:  SELECT  json_build_object('aggregate', json_build_object('sum', json_build_object('amount', (sum("amount" ))::text ) ) ) AS "root" FROM  (SELECT  "_root.base"."amount" AS "amount" FROM  (SELECT  *  FROM "public"."Reward"  WHERE ('true')     ) AS "_root.base"      ) AS "_root"      
2024-08-26 15:16:53.436 UTC [223384] ERROR:  could not write to file "base/pgsql_tmp/pgsql_tmp223383.0.fileset/o26of32.p2.0": No space left on device
2024-08-26 15:16:53.436 UTC [223384] STATEMENT:  SELECT  json_build_object('aggregate', json_build_object('sum', json_build_object('amount', (sum("amount" ))::text ) ) ) AS "root" FROM  (SELECT  "_root.base"."amount" AS "amount" FROM  (SELECT  *  FROM "public"."Reward"  WHERE ('true')     ) AS "_root.base"      ) AS "_root"      
2024-08-26 15:16:53.436 UTC [223385] ERROR:  could not write to file "base/pgsql_tmp/pgsql_tmp223383.0.fileset/o13of32.p1.0": No space left on device
2024-08-26 15:16:53.436 UTC [223385] STATEMENT:  SELECT  json_build_object('aggregate', json_build_object('sum', json_build_object('amount', (sum("amount" ))::text ) ) ) AS "root" FROM  (SELECT  "_root.base"."amount" AS "amount" FROM  (SELECT  *  FROM "public"."Reward"  WHERE ('true')     ) AS "_root.base"      ) AS "_root"  

and these are the latest dbsync logs (last db write attempts):


1
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:23:09.19 UTC] Pool Offchain metadata fetch: 0 results, 1 fetch errors
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:23:22.23 UTC] Insert Babbage Block: epoch 505, slot 133072692, block 10752174, hash f67a9629831dc4fadd12e36527f33cdf4110f4e93deb0184fbb2b55b212f0dcf
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:23:22.42 UTC] Insert Babbage Block: epoch 505, slot 133072694, block 10752175, hash faeca8e422a1930c1ae7b7a3c77de3c66e0360cdb477a8cfec111d186d7dc1a2
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:23:29.17 UTC] Insert Babbage Block: epoch 505, slot 133072702, block 10752176, hash 7ff28f3a3ed257b732e183001f26019a7e4faf14cf999287e57af24d991c0e86
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:23:59.23 UTC] Insert Babbage Block: epoch 505, slot 133072732, block 10752177, hash 99e6c43f996b250280379723e2b62e3578f82bf9cf1243342ee21a4495e20aa9
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:23:59.23 UTC] Pool Offchain metadata fetch: 0 results, 11 fetch errors
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:24:11.29 UTC] Insert Babbage Block: epoch 505, slot 133072737, block 10752178, hash 95e47e6a2ae80ee289646bedbeecafbb482c3e395b46ed0540784b6a83137db5
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:24:23.02 UTC] Insert Babbage Block: epoch 505, slot 133072756, block 10752179, hash b54952778d519cc43f205ca6615e7fc435fa131b9b16b8e1cf744175de8c6acf
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:24:25.36 UTC] Insert Babbage Block: continuing epoch 505 (slot 275957/432000)
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:24:25.36 UTC] Insert Babbage Block: epoch 505, slot 133072757, block 10752180, hash aa98d107d81cedd3848ead887ececbd278deb71bed104218da5ca4e86688c8da
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:24:25.37 UTC] Delaying delete of 1 blocks after Just 10752179 while rolling back to (slot 133072756, hash b54952778d519cc43f205ca6615e7fc435fa131b9b16b8e1cf744175de8c6acf). Applying blocks until a new block is found. The node is currently at Tip (SlotNo 133072757) 02e7139479f2b44ecf692e1fd3e52000baa38168c2c75d306d5c4c8c126b9b0a (BlockNo 10752180)
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:24:25.37 UTC] Found in memory ledger snapshot at slot 133072756, hash b54952778d519cc43f205ca6615e7fc435fa131b9b16b8e1cf744175de8c6acf
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:24:25.37 UTC] Setting ConsistencyLevel to DBAheadOfLedger
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:24:25.37 UTC] Received block which is not in the db with HeaderFields {headerFieldSlot = SlotNo 133072757, headerFieldBlockNo = BlockNo 10752180, headerFieldHash = 02e7139479f2b44ecf692e1fd3e52000baa38168c2c75d306d5c4c8c126b9b0a}. Time to restore consistency.
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:24:25.37 UTC] Deleting 1 numbered equal to or greater than BlockNo 10752180
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:24:25.47 UTC] Blocks deleted
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:24:25.47 UTC] Insert Babbage Block: continuing epoch 505 (slot 275957/432000)
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:24:25.47 UTC] Insert Babbage Block: epoch 505, slot 133072757, block 10752180, hash 02e7139479f2b44ecf692e1fd3e52000baa38168c2c75d306d5c4c8c126b9b0a
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:24:25.48 UTC] Setting ConsistencyLevel to Consistent
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:26:12.93 UTC] Insert Babbage Block: epoch 505, slot 133072863, block 10752181, hash 31547130f56a8a0c219295087b1e711773bf3653750f1c4688b10d41efaa3047
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:26:13.12 UTC] Insert Babbage Block: epoch 505, slot 133072864, block 10752182, hash 21ea1e754a6e8672b6cb0a9bf2c23a7e345d1d0d61fbda94d2f2c92601cfd457
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:26:18.11 UTC] Insert Babbage Block: epoch 505, slot 133072871, block 10752183, hash ec8d847cdc41a3c4e30f8b92538326324b03eddce45b92e77cdf513d20bd6630
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:26:42.28 UTC] Insert Babbage Block: epoch 505, slot 133072893, block 10752184, hash d0b7572babb0423fac638d19840ceee38e5be36482f3dc9a07a8d92a4eb2e7f7
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:27:02.32 UTC] Insert Babbage Block: epoch 505, slot 133072915, block 10752185, hash ad78850a0957b75db61d1f7af1f7b6610defc5bcac07157790692cfd90f486f0
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:27:16.05 UTC] Insert Babbage Block: epoch 505, slot 133072929, block 10752186, hash f583101df52a22a8e20cc89515f97a649d7f313f2079b023b4ad1ae774b70959
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:27:18.29 UTC] Insert Babbage Block: epoch 505, slot 133072931, block 10752187, hash 1bff2dbc89d633473f0c305a76fc2cb81029e179370e2e5c132d80b1ab06db54
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:27:34.11 UTC] Insert Babbage Block: epoch 505, slot 133072947, block 10752188, hash 4e390a5c99d649f1d23345bc2032c94ac1beeca719a6de87e0abbf20260d4d3e
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:28:33.33 UTC] Insert Babbage Block: epoch 505, slot 133073006, block 10752189, hash 53781a21568c98a2132afeccdbd49c5bf14e3cb52665d92938d572dab743c3a6
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:28:44.04 UTC] Insert Babbage Block: epoch 505, slot 133073017, block 10752190, hash dd7c477d838bbdf6a70d8a3eca1587b62342a4a14bd2649991aece76ad2098c1
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:29:18.36 UTC] Insert Babbage Block: epoch 505, slot 133073051, block 10752191, hash 8034f9c3ff735ba34dbe3a696b160eaaeb3a49d295e92d0f96a141be5b3fa053
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:29:18.36 UTC] Pool Offchain metadata fetch: 0 results, 18 fetch errors
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:30:19.03 UTC] Insert Babbage Block: epoch 505, slot 133073110, block 10752192, hash aabf4e46308c25fc74fbfef318c49dc552062b0b6285dfcb3403aeb4d391967e
cardano-db-sync-1  | [db-sync-node:Info:80] [2024-08-26 02:30:19.03 UTC] Pool Offchain metadata fetch: 0 results, 23 fetch errors
cardano-db-sync-1  | [db-sync-node:Error:80] [2024-08-26 02:30:50.18 UTC] runDBThread: DbInsertException "Many Rewards" (SqlError {sqlState = "53100", sqlExecStatus = FatalError, sqlErrorMsg = "could not extend file \"base/16384/1263327.1\": No space left on device", sqlErrorDetail = "", sqlErrorHint = "Check free disk space."})
cardano-db-sync-1  | [db-sync-node:Error:105] [2024-08-26 02:30:50.18 UTC] ChainSyncWithBlocksPtcl: AsyncCancelled
cardano-db-sync-1  | [db-sync-node.Subscription:Error:101] [2024-08-26 02:30:50.18 UTC] Identity Application Exception: LocalAddress "/node-ipc/node.socket" SubscriberError {seType = SubscriberWorkerCancelled, seMessage = "SubscriptionWorker exiting", seStack = []}
cardano-db-sync-1  | cardano-db-sync: DbInsertException "Many Rewards" (SqlError {sqlState = "53100", sqlExecStatus = FatalError, sqlErrorMsg = "could not extend file \"base/16384/1263327.1\": No space left on device", sqlErrorDetail = "", sqlErrorHint = "Check free disk space."})

@zxpectre
Copy link
Author

Some API-created views of public.tx_metadata table are causing the issue on db-sync start sequence.

These views has been working perfectly in the past prior to this new version.

Can you guys relax a bit those initial operations to avoid failing at least if cannot be executed?

We are running out of time so I'm crippling some wallet features for now in order to survive Chang for our users. Hope you can help.

@rdlrt
Copy link

rdlrt commented Aug 28, 2024

Ideally , any secondary layer changes should not be made on same schema as db-sync itself.
So far the start-up sequence as per your logs has had trouble due to storage, which - if not coming from dbsync (as you mention , 'some API-created views' - is best tackled on respective API repository. There is not much details in this thread anyways to assist you.

The dbsync mainnet database size (including tx_cbor flag recently added, which amounts to ~180GB ) is still around 600GB (if not using tx_cbor flag, that'd be ~410-420GB).

I would strongly oppose requests to add changes to dbsync for something introduced externally, they should be managed in their own schema and sized accordingly.

@zxpectre
Copy link
Author

I totally agree with you @rdlrt , and this is why I think there is something not ideal happening.
For me errors were a bit related, but as I was able to spot the exact initial issue ("size bomb" issue never happened again) I'm closing this messed up error report in favor of a clean one: #1832

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants