Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-4657

Add human readable message text to API errors like 404




      We had a customer mis-reading the switchover command documentation, putting the actual monitor section name too early in the command. Also they were using galeramon, so a switchover command does not exist in that monitor anyway.

      They got a "404 not found" in both cases without any further info, and so were lost.

      Looking at raw TCP traffic with Wireshark I'm seeing that there is indeed no additional content in the maxscale API reply providing further info, just a HTTP header with the 404 status, and some default header fields, e.g. maxctrl sent:

      GET /v1/maxscale/modules/galeramon/switchover?myMonitor&galera-node-1&galera-node-2 HTTP/1.1
      Accept: application/json, text/plain, */*
      User-Agent: axios/0.21.4
      Authorization: Basic YWRtaW46bWFyaWFkYg==
      Connection: close

      which failed as "galeramon" does not implement "switchover", only "mariadbmon" does. All that came back was:

      HTTP/1.1 404 Not Found
      Connection: close
      Content-Length: 0
      Cache-Control: no-cache
      Referrer-Policy: same-origin
      X-XSS-Protection: 1
      X-Frame-Options: Deny
      Date: Tue, 27 Jun 23 14:09:56 GMT
      Last-Modified: Tue, 27 Jun 2023 14:07:18 GMT
      ETag: "da39a3ee5e6b4b0d3255bfef95601890afd80709"

      IMHO this should definitely have an extra content section containing e.g.

      "Module 'galeramon' has no command 'switchover'"

      Also at first the customer used

      call command Galera-Monitor switchover RHEL8-Galera-2 RHEL8-Galera-1

      instead of

      call command galeramon switchover Galera-Monitor RHEL8-Galera-2 RHEL8-Galera-1

      so here they should have gotten something like

      "No such module "Galera-Monitor", available modules are 'mariadbmon', 'galeramon', 'xpandmon' ..."

      back there to help them finding the wrong command syntax used.

      Whether the feedback is returned as simple plain text message, or embedded in a JSON document, I don't care either way. But some feedback beyond "something's wrong" is definitely needed




            markus makela markus makela
            hholzgra Hartmut Holzgraefe
            0 Vote for this issue
            2 Start watching this issue



              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.