plandex-ai/plandex · error

error updating plan updated at: %v

Error message

error updating plan updated at: %v

What it means

BumpPlanUpdatedAt runs an UPDATE on the plans table setting updated_at for a plan. Any Exec failure — connection error, constraint issue, plan row missing doesn't error here but a DB failure does — is wrapped with this message and returned to the caller (StorePlanSettings).

Source

Thrown at app/server/db/plan_helpers.go:491

	// owner has access
	if plan.OwnerId == userId {
		return plan, nil
	}

	// plan is shared with org
	if plan.SharedWithOrgAt != nil {
		return plan, nil
	}

	return nil, nil
}

func BumpPlanUpdatedAt(planId string, t time.Time) error {
	_, err := Conn.Exec("UPDATE plans SET updated_at = $1 WHERE id = $2", t, planId)

	if err != nil {
		return fmt.Errorf("error updating plan updated at: %v", err)
	}

	return nil
}

func GetPlanIdsForProject(projectId string) ([]string, error) {
	var ids []string
	err := Conn.Select(&ids, "SELECT id FROM plans WHERE project_id = $1", projectId)
	if err != nil {
		return nil, fmt.Errorf("error getting plan ids for project: %v", err)
	}
	return ids, nil
}

View on GitHub (pinned to e2d772072e)

Solutions

  1. Inspect the wrapped inner error for the exact driver failure
  2. Verify DB connectivity and connection pool settings
  3. Check for statement timeouts or aborted transactions around the call
  4. Retry the bump; the operation is idempotent (it just sets a timestamp)
Defensive patterns

Strategy: retry

Validate before calling

if planId == "" || t.IsZero() {
    return errors.New("planId and non-zero timestamp required")
}

Try / catch

err := BumpPlanUpdatedAt(planId, time.Now())
if err != nil {
    // idempotent: safe to retry
    time.Sleep(100 * time.Millisecond)
    err = BumpPlanUpdatedAt(planId, time.Now())
}
return err

Prevention

When it happens

Trigger: Conn.Exec("UPDATE plans SET updated_at = $1 WHERE id = $2") fails during StorePlanSettings — DB down, connection pool exhausted, transaction aborted, or invalid time value serialization.

Common situations: Connection pool exhaustion under load, database restarts mid-request, timezone/time serialization issues, or the DB session being killed by a statement timeout.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05). Data as JSON: /api/errors/f655de1c510a648c. Report an issue: GitHub.