Skip to content

[BUG][EXPORT]: Selective export fails with 'Server' object has no attribute 'is_active' #2606

@crivetimihai

Description

@crivetimihai

Bug Summary

The /export/selective endpoint fails with 500 error when exporting servers.
Error: 'Server' object has no attribute 'is_active'

Affected Component

  • mcpgateway.services.export_service - export_selective() method

Steps to Reproduce

curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"servers": ["<server_id>"]}' http://localhost:8080/export/selective

Expected Behavior

Returns JSON export of selected servers.

Actual Behavior

Returns 500 with: 'Server' object has no attribute 'is_active'

Logs

2026-01-31T13:17:52 - mcpgateway - ERROR - Unexpected selective export error: 'Server' object has no attribute 'is_active'

Root Cause

The Server model likely uses enabled or active, but export service references is_active.

Investigation Points

  • Check mcpgateway/db.py for Server model
  • Check mcpgateway/services/export_service.py for export_selective()

Workaround

Use GET /export for full export, or exclude servers from selective requests.

Discovered During

Locust load testing with ExportImportUser class.

Metadata

Metadata

Assignees

Labels

SHOULDP2: Important but not vital; high-value items that are not crucial for the immediate releasebugSomething isn't workingfixedIssue has been resolvedpythonPython / backend development (FastAPI)

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions