subsquid / squid-sdk

The main repo of the squid SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

relation "migrations" does not exist

ioannist opened this issue · comments

I am trying to docker compose up the substrate archiver with a remote supabase postgre db, and a local moonriver full node

I only have one service

services:
  ingest:
    restart: on-failure
    image: subsquid/substrate-ingest:firesquid
    command: [
       "-e", "ws://host.docker.internal:9944",
       "-c", "10",
       "--prom-port", "9090",
       "--out", "postgres://postgres:PASSWORD@db.DATABASE.supabase.co:6543/postgres"
    ]
    ports:
      - "9090:9090"

Here is the full error. Maybe some extra config is missing from the setup guide at
https://github.com/subsquid/substrate-archive-setup/issues

{"level":5,"time":1681318981534,"ns":"sqd:substrate-ingest","err":{"cause":{"length":109,"name":"error","severity":"ERROR","code":"42P01","position":"15","file":"parse_relation.c","line":"1392","routine":"parserOpenTable","stack":"error: relation \"migrations\" does not exist\n at Parser.parseErrorMessage (/squid/common/temp/node_modules/.pnpm/pg-protocol@1.6.0/node_modules/pg-protocol/dist/parser.js:287:98)\n at Parser.handlePacket (/squid/common/temp/node_modules/.pnpm/pg-protocol@1.6.0/node_modules/pg-protocol/dist/parser.js:126:29)\n at Parser.parse (/squid/common/temp/node_modules/.pnpm/pg-protocol@1.6.0/node_modules/pg-protocol/dist/parser.js:39:38)\n at Socket.<anonymous> (/squid/common/temp/node_modules/.pnpm/pg-protocol@1.6.0/node_modules/pg-protocol/dist/index.js:11:42)\n at Socket.emit (node:events:513:28)\n at addChunk (node:internal/streams/readable:315:12)\n at readableAddChunk (node:internal/streams/readable:289:9)\n at Socket.Readable.push (node:internal/streams/readable:228:10)\n at TCP.onStreamRead (node:internal/stream_base_commons:190:23)"},"stack":"Error: Migration failed. Reason: relation \"migrations\" does not exist\n at /squid/common/temp/node_modules/.pnpm/postgres-migrations@5.3.0/node_modules/postgres-migrations/dist/migrate.js:100:27\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async /squid/common/temp/node_modules/.pnpm/postgres-migrations@5.3.0/node_modules/postgres-migrations/dist/with-lock.js:25:28\n at async /squid/substrate/substrate-ingest/lib/main.js:109:13"}}

Tried to execute this directly ts-node from its repo (without docker). Getting the same error

17:44:13 INFO  sqd:substrate-ingest connected to postgres://db.DATABASE.supabase.co:6543/postgres
17:44:13 INFO  sqd:substrate-ingest Loading migrations from: /home/stakebaby/squid-sdk/substrate/substrate-ingest/migrations
17:44:13 INFO  sqd:substrate-ingest Found migration files: 001-initial.sql,002-ethereum-transaction.sql,003-add-evm-log.sql
17:44:13 INFO  sqd:substrate-ingest Acquiring advisory lock...
17:44:13 INFO  sqd:substrate-ingest ... acquired advisory lock
17:44:13 INFO  sqd:substrate-ingest Starting migrations
17:44:13 INFO  sqd:substrate-ingest Migrations table with name 'migrations' exists, filtering not applied migrations.
17:44:13 INFO  sqd:substrate-ingest Error while using lock: Migration failed. Reason: relation "migrations" does not exist
17:44:13 INFO  sqd:substrate-ingest Releasing advisory lock...
17:44:14 INFO  sqd:substrate-ingest ... released advisory lock
17:44:14 FATAL sqd:substrate-ingest Error: Migration failed. Reason: relation "migrations" does not exist
                                        at /home/stakebaby/squid-sdk/substrate/substrate-ingest/node_modules/postgres-migrations/dist/migrate.js:100:27
                                        at processTicksAndRejections (node:internal/process/task_queues:96:5)
                                        at async /home/stakebaby/squid-sdk/substrate/substrate-ingest/node_modules/postgres-migrations/dist/with-lock.js:25:28
                                        at async /home/stakebaby/squid-sdk/substrate/substrate-ingest/src/main.ts:110:13

Closing as not related to the SDK