Skip to content

relation "migrations" does not exist #172

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

Closed
ioannist opened this issue Apr 12, 2023 · 3 comments
Closed

relation "migrations" does not exist #172

ioannist opened this issue Apr 12, 2023 · 3 comments

Comments

@ioannist
Copy link

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"}}

@ioannist
Copy link
Author

ioannist commented Apr 12, 2023

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

@ioannist
Copy link
Author

Could be this

ThomWright/postgres-migrations#33

@dzhelezov
Copy link
Contributor

Closing as not related to the SDK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants