[MXS-4657] Add human readable message text to API errors like 404 Created: 2023-06-27 Updated: 2023-07-27 Resolved: 2023-07-13 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | REST-API |
| Affects Version/s: | None |
| Fix Version/s: | 2.5.27, 6.4.8, 22.08.7, 23.02.3, 23.08.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Hartmut Holzgraefe | Assignee: | markus makela |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
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:
which failed as "galeramon" does not implement "switchover", only "mariadbmon" does. All that came back was:
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 |
| Comments |
| Comment by markus makela [ 2023-06-27 ] |
|
I'll convert this into a bug since nothing prevents a human-readable error from being returned and (IMO) it should've always have done that. |
| Comment by markus makela [ 2023-06-28 ] |
|
For 2.5 the maxctrl error message can be amended to indicate that a 404 always means that the object does not exist, the name is wrong or the type of the object is wrong. The REST-API can also generate a more detailed error for unknown module commands. |
| Comment by markus makela [ 2023-07-13 ] |
|
The REST-API will generate a more precise error in 23.08 that tells the expected type of the object if a mismatch of some sorts is found. |