Issue starting ceramic node

Currently following the getting started guide for ComposeDB and receiving this error:

(node:5398) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
(Use `node --trace-warnings ...` to show where the warning was created)
[2023-03-26T05:04:33.206Z] IMPORTANT: Starting Ceramic Daemon at version 2.29.0 with config: 
{
  "anchor": {},
  "http-api": {
    "cors-allowed-origins": [
      ".*"
    ],
    "admin-dids": [
      "did:key:z6Mkea46mTzUBxefFPVqQKDVPnLPejcUzfRK8EXne2Tze3o6i"
    ]
  },
  "ipfs": {
    "mode": "bundled"
  },
  "logger": {
    "log-level": 2,
    "log-to-files": false
  },
  "network": {
    "name": "testnet-clay"
  },
  "node": {},
  "state-store": {
    "mode": "fs",
    "local-directory": "/home/bel/.ceramic/statestore"
  },
  "indexing": {
    "allow-queries-before-historical-sync": true,
    "disable-composedb": false,
    "enable-historical-sync": false
  }
}
[2023-03-26T05:04:33.214Z] IMPORTANT: Connecting to IPFS node available as /ip4/127.0.0.1/tcp/4011/p2p/12D3KooWBXEUgtkCEJV799MNqdCtMRaQGn1jj62FfBSUtZWK56eE, /ip4/172.22.255.25/tcp/4011/p2p/12D3KooWBXEUgtkCEJV799MNqdCtMRaQGn1jj62FfBSUtZWK56eE
Ceramic daemon failed to start up:
InvalidConnectionStringError: Invalid database connection string: undefined
    at parseURL (file:///home/bel/.local/share/pnpm/global/5/.pnpm/@ceramicnetwork+core@2.31.0/node_modules/@ceramicnetwork/core/lib/indexing/build-indexing.js:19:15)
    at buildIndexing (file:///home/bel/.local/share/pnpm/global/5/.pnpm/@ceramicnetwork+core@2.31.0/node_modules/@ceramicnetwork/core/lib/indexing/build-indexing.js:23:30)
    at makeIndexApi (file:///home/bel/.local/share/pnpm/global/5/.pnpm/@ceramicnetwork+core@2.31.0/node_modules/@ceramicnetwork/core/lib/initialization/make-index-api.js:13:22)
    at new LocalIndexApi (file:///home/bel/.local/share/pnpm/global/5/.pnpm/@ceramicnetwork+core@2.31.0/node_modules/@ceramicnetwork/core/lib/indexing/local-index-api.js:22:33)
    at new Ceramic (file:///home/bel/.local/share/pnpm/global/5/.pnpm/@ceramicnetwork+core@2.31.0/node_modules/@ceramicnetwork/core/lib/ceramic.js:117:28)
    at Function.create (file:///home/bel/.local/share/pnpm/global/5/.pnpm/@ceramicnetwork+cli@2.29.0/node_modules/@ceramicnetwork/cli/lib/ceramic-daemon.js:186:25)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Function.createDaemon (file:///home/bel/.local/share/pnpm/global/5/.pnpm/@ceramicnetwork+cli@2.29.0/node_modules/@ceramicnetwork/cli/lib/ceramic-cli-utils.js:143:24)
    at async Command.<anonymous> (file:///home/bel/.local/share/pnpm/global/5/.pnpm/@ceramicnetwork+cli@2.29.0/node_modules/@ceramicnetwork/cli/lib/bin/ceramic.js:30:5)

OS: Linux
Node version: 16

have tried both npm and pnpm commands to start the node. Any help would be appreciated.

1 Like

Hey @cozart . It seems like your Ceramic configuration file is missing a db parameter inside of the indexing section. This parameter should point to your local sqlite database which should be configured automatically for you once you start your daemon for the first time.

To fix this problem you can try one of the two options:

  1. Add a local db configuration to your daemon.config.json file as follows:
  • Open the daemon.config.json file (your config file should default to the path ~/.ceramic/daemon.config.json)
  • Add the db configuration to your config file as follows (check the indexing section):
  "anchor": {
    "auth-method": "did"
  },
  "http-api": {
    "cors-allowed-origins": [
      ".*"
    ],
    "admin-dids": ["did:key:z6Mkea46mTzUBxefFPVqQKDVPnLPejcUzfRK8EXne2Tze3o6i"]
  },
  "ipfs": {
    "mode": "bundled"
  },
  "logger": {
    "log-level": 2,
    "log-to-files": false
  },
  "metrics": {
    "metrics-exporter-enabled": false
  },
  "network": {
    "name": "testnet-clay"
  },
  "node": {},
  "state-store": {
    "mode": "fs",
    "local-directory": "/home/bel/.ceramic/statestore"
  },
  "indexing": {
    "db": "sqlite:/home/bel/.ceramic/indexing.sqlite",
    "allow-queries-before-historical-sync": true,
    "disable-composedb": false,
    "enable-historical-sync": false
  }
}
  1. You can start completely from scratch. To do that, delete the daemon.config.json and start the node again using npx @ceramicnetwork/cli daemon. This will generate a fresh daemon configuration file which should have the db parameter configured for you automatically.

Let me know if that solves your issue.

2 Likes

Also, to better understand why db parameter was missing in the first place - have you removed this parameters manually? Alternatively, have you been running older versions of Ceramic and ComposeDB before?

1 Like

Removing .ceramic directory entirely then rerunning npx @ceramicnetwork/cli daemon resolved the issue. You were correct in assuming that this was from an old version of ceramic, explains why db was missing. Thanks for the help!

2 Likes