tryethernal / ethernal

Ethernal is a block explorer for EVM-based chains. In a few seconds, spin up a fully-featured explorer for your L1/L2 rollup/testnet. Compatible with Optimism, ZK, Anvil, Hardhat, Geth...
https://www.tryethernal.com
Other
208 stars 50 forks source link

migration - function create_hypertable(unknown, unknown) does not exist #336

Open vikipedia48 opened 6 months ago

vikipedia48 commented 6 months ago

Following the self-hosted tutorial, I am trying to set up Ethernal for my local quickstart network. docker-compose created all the necessary containers.

When I ran the command docker exec -it web npx sequelize db:create, it threw an error ERROR: no PostgreSQL user name specified in startup packet I fixed that by adding DB_USER in the .prod.env file (perhaps I shouldn't have?). But then when I run docker exec -it web npx sequelize db:migrate. it throws an error ERROR: function create_hypertable(unknown, unknown) does not exist How do I fix this?

Npx output:

Sequelize CLI [Node: 16.20.2, CLI: 6.6.2, ORM: 6.19.2]

Loaded configuration file "config/database.js".
Using environment "production".
== 20220407103950-create-user: migrating =======
== 20220407103950-create-user: migrated (0.023s)
...
== 20240111132749-create-blocks-hypertable: migrating =======
Error
    at Query.run (/app/node_modules/sequelize/lib/dialects/postgres/query.js:50:25)
    at /app/node_modules/sequelize/lib/sequelize.js:310:28
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.up (/app/migrations/20240111132749-create-blocks-hypertable.js:61:11) {
  name: 'SequelizeDatabaseError',
  parent: error: function create_hypertable(unknown, unknown) does not exist
      at Parser.parseErrorMessage (/app/node_modules/pg-protocol/dist/parser.js:287:98)
      at Parser.handlePacket (/app/node_modules/pg-protocol/dist/parser.js:126:29)
      at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:39:38)
      at Socket.<anonymous> (/app/node_modules/pg-protocol/dist/index.js:11:42)
      at Socket.emit (node:events:513:28)
      at addChunk (node:internal/streams/readable:315:12)
      at readableAddChunk (node:internal/streams/readable:289:9)
      at Socket.Readable.push (node:internal/streams/readable:228:10)
      at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
    length: 227,
    severity: 'ERROR',
    code: '42883',
    detail: undefined,
    hint: 'No function matches the given name and argument types. You might need to add explicit type casts.',
    position: '8',
    internalPosition: undefined,
    internalQuery: undefined,
    where: undefined,
    schema: undefined,
    table: undefined,
    column: undefined,
    dataType: undefined,
    constraint: undefined,
    file: 'parse_func.c',
    line: '629',
    routine: 'ParseFuncOrColumn',
    sql: "SELECT create_hypertable('transaction_events', 'timestamp');",
    parameters: undefined
  },
  original: error: function create_hypertable(unknown, unknown) does not exist
      at Parser.parseErrorMessage (/app/node_modules/pg-protocol/dist/parser.js:287:98)
      at Parser.handlePacket (/app/node_modules/pg-protocol/dist/parser.js:126:29)
      at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:39:38)
      at Socket.<anonymous> (/app/node_modules/pg-protocol/dist/index.js:11:42)
      at Socket.emit (node:events:513:28)
      at addChunk (node:internal/streams/readable:315:12)
      at readableAddChunk (node:internal/streams/readable:289:9)
      at Socket.Readable.push (node:internal/streams/readable:228:10)
      at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
    length: 227,
    severity: 'ERROR',
    code: '42883',
    detail: undefined,
    hint: 'No function matches the given name and argument types. You might need to add explicit type casts.',
    position: '8',
    internalPosition: undefined,
    internalQuery: undefined,
    where: undefined,
    schema: undefined,
    table: undefined,
    column: undefined,
    dataType: undefined,
    constraint: undefined,
    file: 'parse_func.c',
    line: '629',
    routine: 'ParseFuncOrColumn',
    sql: "SELECT create_hypertable('transaction_events', 'timestamp');",
    parameters: undefined
  },
  sql: "SELECT create_hypertable('transaction_events', 'timestamp');",
  parameters: {}
}

Postgres logs:

postgres-1      | 2024-04-05 07:49:45.516 UTC [58] ERROR:  function create_hypertable(unknown, unknown) does not exist at character 8
postgres-1      | 2024-04-05 07:49:45.516 UTC [58] HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
postgres-1      | 2024-04-05 07:49:45.516 UTC [58] STATEMENT:  SELECT create_hypertable('transaction_events', 'timestamp'); postgres-1      | 2024-04-05 07:50:00.195 UTC [62] ERROR:  column "l1Explorer" does not exist at character 169
postgres-1      | 2024-04-05 07:50:00.195 UTC [62] STATEMENT:  SELECT "id", "userId", "workspaceId", "chainId", "domain", "name", "rpcServer", "slug", "themes", "token", "totalSupply", "shouldSync", "shouldEnforceQuota", "isDemo", "l1Explorer", "createdAt", "updatedAt" FROM "explorers" AS "Explorer";
postgres-1      | 2024-04-05 07:50:00.196 UTC [63] ERROR:  column Workspace.pollingInterval does not exist at character 562
...