paperclipai/paperclip · error · Error

Config at does not define a database connection string.

Error message

Config at ${configPath} does not define a database connection string.

What it means

The loaded config's database section does not define a usable connection string (nor embedded mode), so routines cannot construct a DB client.

Solutions

  1. Add a database connection string (DATABASE_URL) to the config or adjacent .env.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cli/src/commands/routines.ts:216 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@120ae5428f (2026-08-18). Data as JSON: /api/errors/377b3cec3ac19d5c. Report an issue: GitHub.

Appendix: source

Thrown at cli/src/commands/routines.ts:216

      const adminConnectionString = `postgres://paperclip:paperclip@127.0.0.1:${embeddedHandle.port}/postgres`;
      await ensurePostgresDatabase(adminConnectionString, "paperclip");
      const connectionString = `postgres://paperclip:paperclip@127.0.0.1:${embeddedHandle.port}/paperclip`;
      await applyPendingMigrations(connectionString);
      const db = createDb(connectionString) as ClosableDb;
      return {
        db,
        stop: async () => {
          await closeDb(db);
          if (embeddedHandle?.startedByThisProcess) {
            await embeddedHandle.stop().catch(() => undefined);
          }
        },
      };
    }

    const connectionString = nonEmpty(config.database.connectionString);
    if (!connectionString) {
      throw new Error(`Config at ${configPath} does not define a database connection string.`);
    }

    await applyPendingMigrations(connectionString);
    const db = createDb(connectionString) as ClosableDb;
    return {
      db,
      stop: async () => {
        await closeDb(db);
      },
    };
  } catch (error) {
    if (embeddedHandle?.startedByThisProcess) {
      await embeddedHandle.stop().catch(() => undefined);
    }
    throw error;
  }
}

View on GitHub (pinned to 120ae5428f)