You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cloro_pending_tasks is referenced in multiple places (server.js, job-manager.js, pulse/engine.js, and tracking-worker.js), but there is no migration creating the table in supabase/migrations/ or supabase/schema.sql.
On a fresh self-hosted install (supabase db reset → npm run dev), the server logs:
PGRST205: Could not find the table 'public.cloro_pending_tasks' in the schema cache
Although the startup error is swallowed, it also breaks the Cloro webhook flow because /cloro/callback cannot resolve pending tasks from the missing table.
Suggested fix: Add a migration creating cloro_pending_tasks (matching the fields used by server.js/tracking-worker.js) and regenerate supabase/schema.sql.
Steps to reproduce
Run supabase db reset.
Start the server with cd server && npm run dev.
Observe the PGRST205 error on startup.
Trigger a Cloro webhook callback and notice it cannot resolve the pending task.
Expected behavior
A fresh installation should create cloro_pending_tasks during database setup, allowing the server to start without errors and Cloro webhook callbacks to resolve pending tasks successfully.
Actual behavior
cloro_pending_tasks is missing after running all migrations. The server logs PGRST205 on startup, and Cloro webhook callbacks fail because the pending task table does not exist.
Deployment mode
Self-hosted
Environment
Windows 11, Node.js (your version), Supabase CLI (your version)
Relevant logs
PGRST205: Could not find the table 'public.cloro_pending_tasks'in the schema cache
Confirmed — good catch. The table exists on the hosted database but its DDL was never committed as a migration, so fresh installs never create it. Nothing to guess about the shape; here is the authoritative definition from the live database:
CREATETABLEIF NOT EXISTS public.cloro_pending_tasks (
task_id textPRIMARY KEY,
prompt_id uuid NOT NULLREFERENCESpublic.prompts(id) ON DELETE CASCADE,
brand_id uuid NOT NULLREFERENCESpublic.brands(id) ON DELETE CASCADE,
scraper_id textNOT NULL,
region text,
submitted_at timestamptzNOT NULL DEFAULT now()
);
CREATEINDEXIF NOT EXISTS idx_cloro_pending_tasks_brand_id ONpublic.cloro_pending_tasks(brand_id);
CREATEINDEXIF NOT EXISTS idx_cloro_pending_tasks_submitted_at ONpublic.cloro_pending_tasks(submitted_at);
ALTERTABLEpublic.cloro_pending_tasks ENABLE ROW LEVEL SECURITY;
-- No policies on purpose: the table is only touched by the server through the-- service role (it's a transient submit-queue for the tracking worker).
To fix:
Add the DDL above as a new numbered file in supabase/migrations/ (use the next free number). Keep the IF NOT EXISTS guards — databases that already have the table must be able to run it as a no-op.
Regenerate the consolidated schema with bash supabase/build-schema.sh (CI checks that supabase/schema.sql is in sync).
Add the table to web/src/types/supabase.ts — it is missing there too.
Activity
gkhngyk commentedon Aug 7, 2026
Confirmed — good catch. The table exists on the hosted database but its DDL was never committed as a migration, so fresh installs never create it. Nothing to guess about the shape; here is the authoritative definition from the live database:
To fix:
supabase/migrations/(use the next free number). Keep theIF NOT EXISTSguards — databases that already have the table must be able to run it as a no-op.bash supabase/build-schema.sh(CI checks thatsupabase/schema.sqlis in sync).web/src/types/supabase.ts— it is missing there too.Open to anyone who wants to pick this up.
fix(db): add the missing cloro_pending_tasks migration (ansvisor#692)