Skip to main content

CORS errors

CORS is the most common issue when setting up the Forest agent. Open your browser’s Developer Console (Network tab) to detect it. Check:
  • The Forest agent is mounted before any other middleware. In NestJS specifically, the Nest App Factory’s CORS configuration can interfere with @forestadmin/agent. Configure it after mounting the agent.
  • Your server is up and running. Test it by calling the /forest endpoint: curl http://localhost:3310/forest

403 Forbidden errors after permission changes

If you add users, create collections, or change permissions in Forest and start getting 403 errors that only go away after restarting your agent, this is likely caused by SSE (Server-Sent Events) buffering in a reverse proxy. Forest uses SSE to push permission updates to your agent in real time. Some reverse proxies buffer SSE connections and prevent the agent from receiving updates. To confirm: Restart your agent. If the 403 errors disappear, SSE buffering is the cause. Fix option 1: Disable buffering in your reverse proxy: For nginx:
fastcgi_buffering off;
proxy_buffering off;
Fix option 2: Fall back to TTL-based cache: Set instantCacheRefresh: false in your agent initialization options. This disables SSE and uses a periodic cache refresh instead.
const agent = createAgent({
  // ...
  instantCacheRefresh: false,
});

Agent health check

Test that your agent is reachable:
curl http://localhost:3310/forest
# Should return: {"meta":{"name":"@forestadmin/agent",...}}
In production, test with HTTPS:
curl https://your-agent.yourcompany.com/forest

Schema not updating

If your database schema changes are not reflected in Forest:
  1. Make sure your agent is restarted after schema changes
  2. Check that isProduction is set correctly. In production mode, the schema is not re-introspected on startup
  3. Delete .forestadmin-schema.json and restart to force a full schema refresh (development only)

Need more help?

Post your question on the Forest Community Forum. The team responds quickly.