Skip to content

[Bug]: NEXT_PUBLIC_API_URL Configuration Breaks All API Calls #37

Description

@kaiyu96

Affected area

Settings

Summary

The environment variable NEXT_PUBLIC_API_URL in .env.example includes an incorrect /api prefix, causing all HTTP requests to the Knowhere API to fail with 404 Not Found.

Problems:

  • API calls are routed to wrong URL path
  • All Dashboard features that call the API fail silently
  • Error messages don't clearly indicate the root cause

Current Configuration:

# .env.example
NEXT_PUBLIC_API_URL=http://localhost:5005/api

How It Breaks:

In server/external-api/request.ts:

const url = `${env.NEXT_PUBLIC_API_URL}${path}`;
// When path = "/v1/auth/list"
// Result: http://localhost:5005/api/v1/auth/list  ❌ (404)
// Expected: http://localhost:5005/v1/auth/list    ✓ (200)

Browser

Chrome

Reproduction steps

  1. Deploy Dashboard with .env.local having NEXT_PUBLIC_API_URL=http://localhost:5005/api
  2. Navigate to Dashboard (localhost:3000)
  3. Open browser DevTools (F12) → Network tab
  4. Try to list API keys or perform any API operation
  5. Expected: 200 OK response
  6. Actual: 404 Not Found with response body: {"detail":"Not Found"}
  7. Check network tab: request URL shows http://localhost:5005/api/v1/auth/list

Screenshots or recordings

No response

Relevant logs


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions