Troubleshooting
Common issues and solutions for A²D deployment, development, and usage.
Quick Fixes
Development Server Won’t Start
Problem: npm run dev fails or shows errors
Solutions:
rm -rf .next
npm run devrm -rf node_modules package-lock.json
npm installnode --version
# Should be 18.17+ or 20.x# macOS/Linux
lsof -i :3000
# Windows
netstat -ano | findstr :3000Database Connection Errors
Problem: “Failed to connect to database” or “Invalid API key”
Symptoms:
- Cannot sign up or log in
- API routes return 500 errors
- “Supabase client initialization failed”
Solutions:
-
Verify
.env.localexists and has correct values:cat .env.local -
Check Supabase project status:
- Go to app.supabase.com
- Verify project is not paused (free tier auto-pauses)
- Click “Resume” if paused
-
Verify credentials:
# Check format NEXT_PUBLIC_SUPABASE_URL=https://xxxxx.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ... (starts with eyJ) SUPABASE_SERVICE_ROLE_KEY=eyJ... (starts with eyJ) -
Restart development server:
# Stop (Ctrl+C) and restart npm run dev
MCP Endpoint Returns 404
Problem: MCP endpoint not found or returns 404
URL Format: https://your-domain.com/api/platform/[server-id]/mcp
Solutions:
-
Verify server ID:
- Must be valid UUID format
- Copy from browser URL or server detail page
-
Check server exists:
- Go to MCP Servers list
- Verify server is created and visible
-
Ensure server is enabled:
- Open server detail page
- Check “Enabled” toggle is ON
-
Check deployment logs (Vercel):
- Go to Vercel dashboard → Logs
- Look for errors in function logs
Authentication Fails
Problem: Cannot log in or sign up, or redirects fail
Solutions:
-
Check Supabase Auth is enabled:
- Supabase dashboard → Authentication → Providers
- Verify “Email” provider is enabled
-
Verify redirect URLs:
- Supabase dashboard → Authentication → URL Configuration
- Add your app URL to allowed redirect URLs
-
Check browser console:
- Open DevTools (F12)
- Look for errors in Console tab
-
Clear cookies and try again:
# Or use Incognito/Private browsing -
Verify
NEXT_PUBLIC_APP_URL:# Should match your actual URL NEXT_PUBLIC_APP_URL=http://localhost:3000 # Local NEXT_PUBLIC_APP_URL=https://your-domain.com # Production
RLS Policy Errors
Problem: “Row violates row-level security policy” or “permission denied”
Symptoms:
- Cannot create/update data
- Queries return empty results unexpectedly
- “new row violates row-level security policy” error (e.g. for table
agent_cardsoragent_skills)
Solutions:
-
For agent_cards / agent_skills: Ensure the migration that adds RLS policies for these tables has been applied (e.g.
20260213000001_add_agent_cards_agent_skills_rls.sql). Multi-tenant migrations (e.g.organization_members, RLS helpers) must also be applied so the user has membership in an org. -
Verify user’s organization membership: Access is based on the
organization_memberstable, not onlyusers.organization_id. Ensure the user has at least one row inorganization_members, and that the app’s current org (stored in a cookie) matches one of those orgs. In the app, use the sidebar organization switcher if you belong to multiple orgs. For more detail, see Multi-Tenancy. -
Check RLS policies are enabled:
- Supabase dashboard → Table Editor
- Select a table (including
agent_cardsandagent_skills) - Verify RLS toggle is ON
-
Logout and login again:
- Allows the app to set the current organization cookie correctly
-
Verify using correct Supabase client:
// ✅ Use server client in server components import { createClient } from '@/lib/supabase/server' const supabase = await createClient() // ✅ Use browser client in client components import { createClient } from '@/lib/supabase/client' const supabase = createClient()
Common Questions
How do I reset my database?
This deletes all data! Only do this in development.
Using Supabase CLI:
supabase db resetManually via Dashboard:
- Go to Supabase dashboard
- Database → Settings
- Click “Reset database”
- Confirm
- Re-run all migrations
How do I debug MCP endpoints?
Test with curl:
curl -X POST https://your-domain.com/api/platform/SERVER_ID/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}'Test with MCP Inspector:
npx @modelcontextprotocol/inspector https://your-domain.com/api/platform/SERVER_ID/mcpCheck server logs:
- Local: Check terminal running
npm run dev - Production: Vercel dashboard → Logs tab
How do I see application logs?
Local Development:
- Terminal running
npm run dev - Browser console (F12 → Console)
Production (Vercel):
- Go to vercel.com/dashboard
- Select your project
- Click “Logs” tab
- Filter by:
- Function (API route)
- Time range
- Error level
How do I update environment variables?
Local:
- Edit
.env.local - Stop dev server (Ctrl+C)
- Restart:
npm run dev
Production (Vercel):
- Vercel dashboard → Settings → Environment Variables
- Edit variable
- Redeploy (automatic on next push)
Error Reference
MCP Protocol Errors
| Name | Type | Description |
|---|---|---|
-32700 Parse Error | json-rpc | Invalid JSON - check JSON syntax |
-32600 Invalid Request | json-rpc | Missing required fields (jsonrpc, method) |
-32601 Method Not Found | json-rpc | Unknown MCP method - verify method name |
-32602 Invalid Params | json-rpc | Tool arguments don’t match schema |
-32603 Internal Error | json-rpc | Server error - check logs |
-32001 Unauthorized | mcp-custom | Authentication required or invalid |
See API Reference: Error Handling for details.
Build Errors
“Module not found”:
npm install # Reinstall dependenciesTypeScript errors:
npm run type-check # Check for type errorsESLint errors:
npm run lint # Check and auto-fixDatabase Errors
“relation does not exist”:
- Migrations not run
- Run:
supabase db push
“permission denied for table”:
- RLS policies not configured
- Check policies in Supabase dashboard
“connection refused”:
- Supabase project paused
- Resume project in dashboard
Getting More Help
Documentation
- Getting Started - Setup guides
- API Reference - Complete API documentation
- Architecture - System design and multi-tenancy
Community Support
- GitHub Issues: Report bugs
- GitHub Discussions: Ask questions
Detailed Troubleshooting Guides
Additional detailed troubleshooting guides coming soon:
- Database problems
- Deployment issues
- Authentication errors
- MCP debugging
- Performance optimization
Still stuck? Open an issue with:
- Error message
- Steps to reproduce
- Environment (local/production)
- Screenshots if applicable