Skip to content

[Bug]: When attempting to delete a virtual server that is not found - it returns wrong status code #1572

@DuarteMartinho

Description

@DuarteMartinho

🐞 Bug Summary

When attempting to delete a virtual server that is not found - it returns a status code 400 with the message not found

🧩 Affected Component

Select the area of the project impacted:

  • mcpgateway - API
  • mcpgateway - UI (admin panel)
  • mcpgateway.wrapper - stdio wrapper
  • Federation or Transports
  • CLI, Makefiles, or shell scripts
  • Container setup (Docker/Podman/Compose)
  • Other (explain below)

🔁 Steps to Reproduce

  1. Go to /docs
  2. Go to DELETE /servers/{server_id}
  3. Enter your bearer token
  4. Enter a random string of an id that does not exist for example vs-server-id-not-found

🤔 Expected Behavior

What should have happened instead?
The behaviour should return status 404

📓 Logs / Error Output

Paste any relevant stack traces or logs here.
⚠️ Do not paste secrets, credentials, or tokens.
image


🧠 Environment Info

You can retrieve most of this from the /version endpoint.

Key Value
Version or commit 0.9.0
Runtime Python 3.12.10
Platform / OS macOS
Container none

🧩 Additional Context (optional)

Looking at DELETE /gateways/{gateway_id} there is a get_gateway so I just added the same to delete_server See here

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageIssues / Features awaiting triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions