Skip to content

fix: [client] Correct db_schema_diagnostic endpoint path - #36

Draft
elhoim wants to merge 1 commit into
MISP:mainfrom
elhoim:fix/schema-diagnostic
Draft

elhoim wants to merge 1 commit into
MISP:mainfrom
elhoim:fix/schema-diagnostic

Conversation

@elhoim

@elhoim elhoim commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

BLUF — db_schema_diagnostic calls a nonexistent server action, so the diagnostic never runs.

  • Problem — db_schema_diagnostic() in src/client.rs issued GET servers/schemaDiagnostics, which is not a MISP action; ServersController defines dbSchemaDiagnostic(), so the call yields a MissingAction rather than schema data.
  • Fix — Points the client at GET servers/dbSchemaDiagnostic, matching the controller and PyMISP, and adds the first test for this method, db_schema_diagnostic_hits_correct_action.
  • Effect — Callers get the real database schema diagnostic back instead of an error.
  • CI — Red from a repo-level CI bug (the job ran on ubuntu-22.04, which has no php8.3 mod_php, and test_event_crud_lifecycle raced the publish worker), fixed in PR fix: [ci] Run integration tests on ubuntu-24.04 to match php8.3 #53 and unrelated to this PR.

Finding

db_schema_diagnostic calls servers/schemaDiagnostics; action is dbSchemaDiagnostic
ServersController defines dbSchemaDiagnostic(). MissingAction.

Change

db_schema_diagnostic() in src/client.rs called GET servers/schemaDiagnostics, which is not a real MISP action. ServersController defines the action as dbSchemaDiagnostic() (a GET-accessible, non-POST-restricted REST action), and PyMISP's db_schema_diagnostic() confirms the wire path is servers/dbSchemaDiagnostic. Changed the client to GET servers/dbSchemaDiagnostic and added a wiremock unit test asserting the correct path (no prior test covered this method, so nothing needed correcting — a new test was added).

Upstream evidence

MISP core app/Controller/ServersController.php:2604 (public function dbSchemaDiagnostic(), REST-accessible via $this->RestResponse->viewData(...) at line 2608, no POST-only guard like the neighboring changeLockState action); PyMISP pymisp/api.py:389 (response = self._prepare_request('GET', 'servers/dbSchemaDiagnostic')).

Verified against MISP core 843b6744 and PyMISP e7debb4f.

Tests

  • db_schema_diagnostic_hits_correct_action (src/client.rs, wiremock unit test asserting GET /servers/dbSchemaDiagnostic)

Verified locally: cargo fmt --check, cargo clippy --all-targets --all-features -- -D warnings, cargo test --all-features --lib, --test integration_tests --no-run, and cargo check --examples, each in an isolated target directory.

🤖 Generated with Claude Code

db_schema_diagnostic() requested servers/schemaDiagnostics, which does not
exist. ServersController defines the action as dbSchemaDiagnostic()
(app/Controller/ServersController.php:2604), and PyMISP calls the same
path (pymisp/api.py:389: 'servers/dbSchemaDiagnostic'). Update the client
to GET servers/dbSchemaDiagnostic, and correct/add the wiremock test that
previously would have encoded the wrong path.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JoSButbVaWEtGMXwTx73BZ
@elhoim
elhoim marked this pull request as draft September 3, 2026 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant