Errors — python-masakariclient — branch stable/2026.2
Branch
stable/2026.2@073cd2cca082(8.9.0+ 2 commits) — repository https://opendev.org/openstack/python-masakariclient — analysed on 2026-11-01
[observed] means seen against a local stub, which is not Masakari. The full runs are in [_rewrite/wire-scenarios_stable-2026.2.json](_rewrite/wire-scenarios_stable-2026.2.json).
1. How a failure reaches the user
| Exit | Situation | Output | Source |
|---|---|---|---|
| 0 | success, and **any failure in segment delete** | stdout | cliff:cliff/command.py:196, masakariclient/osc/v1/segment.py:271 |
| 1 | an exception leaves take_action; cliff logs str(exc) | stderr; traceback only with --debug | cliff:cliff/app.py:462 |
| 2 | argparse refusal, or the command does not exist in the selected version | stderr, or stdout for an unknown command | openstackclient:openstackclient/shell.py:150 [observed] |
**No defect of the "returns a value from command.Command" kind**: the two Command classes, DeleteSegment and DeleteHost, return None (masakariclient/osc/v1/segment.py:263, masakariclient/osc/v1/host.py:279).
2. Exception classes of the project
| Class | Base | Raised | Source |
|---|---|---|---|
BaseException | Exception, shadows the builtin in this module | through its child | masakariclient/common/exception.py:16 |
CommandError | BaseException above, not the osc-lib class of the same name | masakariclient/common/utils.py:38, masakariclient/common/utils.py:76 | masakariclient/common/exception.py:25 |
UnsupportedVersion | Exception | masakariclient/api_versions.py:58, never seen in the runs | masakariclient/common/exception.py:29 |
3. Message catalogue
Messages written by the project
| Message | Exception | Situation | Raised at | Commands | Seen |
|---|---|---|---|---|---|
Segment is not found: %s | osc-lib CommandError | GET /segments/{id} answers 404 | masakariclient/osc/v1/segment.py:279 | segment show, also create and update on the follow-up read | [observed] |
Segment host is not found: %s | osc-lib CommandError | GET …/hosts/{id} answers 404 | masakariclient/osc/v1/host.py:296 | segment host show, also create and update | [observed] |
Notification not found: %s | osc-lib CommandError | GET /notifications/{id} answers 404 | masakariclient/osc/v1/notification.py:143 | notification show, also create | [observed] |
VMove %s is not found. | osc-lib CommandError | GET …/vmoves/{id} answers 404, including when the notification is what is missing | masakariclient/osc/v1/vmove.py:115 | notification vmove show | [observed] |
No Segment found for %s | ResourceNotFound | PUT /segments/{id} answers 404 | masakariclient/osc/v1/segment.py:242 | segment update | [observed] |
No Host found for %s | ResourceNotFound | PUT …/hosts/{id} answers 404 | masakariclient/osc/v1/host.py:253 | segment host update | [observed] |
Malformed parameter(%s). Use the key=value format. | CommandError | a --filters item without =; no request sent | masakariclient/common/utils.py:38 | 4 list commands | [observed] |
Unknown sort direction: %s | CommandError | --sort key:other, anything but asc or desc; no request sent | masakariclient/common/utils.py:76 | 4 list commands | [observed] |
Invalid format of client version '%s'… | UnsupportedVersion | the default microversion is not X.Y | masakariclient/api_versions.py:58 | gated commands | not reached |
| re-raise of the original | any | except Exception as ex: raise ex with a LOG.debug | masakariclient/osc/v1/segment.py:167, masakariclient/osc/v1/segment.py:246, masakariclient/osc/v1/host.py:177, masakariclient/osc/v1/host.py:257 | create and update | [observed] |
sdk_exc.ResourceNotFound is an alias of NotFoundException (openstacksdk:openstack/exceptions.py:296), so the except blocks that name either one catch the same class. The debug messages Failed to create segment: %s and similar print parsed_args and hold no secret.
Messages the user sees from the libraries [observed]
| Situation | Exit | Text (with <stub> for the address) | Origin |
|---|---|---|---|
| 4xx or 5xx on a request without a dedicated handler | 1 | ConflictException: 409: Client Error for url: http://<stub>/…/segments, <server message> | openstacksdk:openstack/exceptions.py:128, openstacksdk:openstack/exceptions.py:214 |
| 5xx with a non-JSON body | 1 | HttpException: 503: Server Error for url: …, Service Unavailable | same |
**5xx on get_*** | 1 | No Segment found for <uuid>: Server Error for url: …, boom; "No … found" is misleading for a 500 | openstacksdk:openstack/proxy.py:861 |
--os-ha-api-version above the service's maximum, or the default 1.3 against an older service | 1, no request | A default microversion for service instance-ha of 1.99 was requested, but the cloud only supports a minimum of 1.0 and a maximum of 1.3. … | openstacksdk:openstack/config/cloud_region.py:1263 |
--os-ha-api-version outside the list, major 1 (1.99, 1.x) | continues | ha API version 1.99 is not in supported versions: 1, 1.0, 1.1, 1.2, 1.3 | openstackclient:openstackclient/shell.py:135 |
same, other major (abc, 2, latest) | 2 | the same warning, then openstack: 'segment list' is not an openstack command. with suggestions | openstackclient:openstackclient/shell.py:150 |
no instance-ha or ha entry in the catalog | 1 | Service 'instance-ha' is disabled because its configuration could not be loaded. The service is not present in the service catalog: … | openstacksdk:openstack/service_description.py:44 |
| Keystone refuses | 1 | The request you have made requires authentication. (HTTP 401) | keystoneauth1 |
argparse: bad <recovery_method>, <type>, --reserved true, missing positional | 2 | usage, then invalid choice | masakariclient/osc/v1/segment.py:120, masakariclient/osc/v1/notification.py:103, masakariclient/osc/v1/host.py:144 |
--is_enabled maybe | 1, no request | Unrecognized value 'maybe', acceptable values are: '0', '1', 'f', 'false', 'n', 'no', 'off', 'on', 't', 'true', 'y', 'yes' | masakariclient/osc/v1/segment.py:156 |
notification create with a payload that is not JSON | 1, no request | Expecting value: line 1 column 1 (char 0) | masakariclient/osc/v1/notification.py:126 |
| 2xx without the collection key | 1 | 'segments', the bare key name of a KeyError | openstacksdk:openstack/resource.py:2294 |
| 2xx not JSON on a list | 1 | Expecting value: line 1 column 1 (char 0) | SDK |
a create answering without uuid or notification_uuid; an item in a name lookup without uuid | 1 | Request requires an ID but none was found | openstacksdk:openstack/resource.py:1331 |
401 on a service request is not an error for the user [observed]: keystoneauth re-authenticates and retries once. Both the first 401 and the retried request were recorded.
4. Defects
Each was reproduced with the real CLI on the stub, except where marked. The scenario names refer to _rewrite/wire-scenarios_stable-2026.2.json. None is caught by the unit tests.
| # | Defect | Reproduction | Result | Source | Fix for a rewrite |
|---|---|---|---|---|---|
| 1 | **segment delete exit 0 on failure**; the error goes to stdout; the loop goes on with the next name | not-found, server-errors, no-catalog-entry: segment delete nope; 409 and 403 injected | exit 0, NotFoundException: 404… on stdout. segment delete nope seg-b deletes seg-b and exits 0 | masakariclient/osc/v1/segment.py:271 | report at the end, exit 1 if any failed; segment host delete already fails correctly |
| 2 | **--limit is a page size**; the help says "Limit the number of … returned" | list-args: segment list --limit 1 | 4 requests (limit=1, then marker=1, 2, 3), 3 rows. Same on hosts, notifications, vmoves | masakariclient/common/utils.py:63, openstacksdk:openstack/resource.py:2434 | pass max_items |
| 3 | Default 1.3 is not negotiated | server-older: stub with maximum 1.2 | every command exits 1 with no request; with --os-ha-api-version 1.2 it works | masakariclient/plugin.py:22, openstacksdk:openstack/config/cloud_region.py:1263 | negotiate down |
| 4 | **--is_enabled dropped without a message under 1.2** | is-enabled, versions: --os-ha-api-version 1.1 segment update seg-a --is_enabled false | no PUT, exit 0, is_enabled absent from the output. segment create creates the segment enabled | masakariclient/osc/v1/segment.py:154, masakariclient/osc/v1/segment.py:228 | refuse the option |
| 5 | **--os-ha-api-version 1 and 1.0: columns and wire disagree** | versions | segments go out at 1.2 and yet is_enabled is neither shown nor sendable; notifications go without a header, so the server uses its default 1.0 | masakariclient/osc/v1/segment.py:72, openstacksdk:openstack/instance_ha/v1/segment.py:36, openstacksdk:openstack/config/cloud_region.py:121 | read the version actually used |
| 6 | **--marker needs an ID the CLI does not show**: help says ID; the server matches the integer id | list-args: a UUID gives 400 on the stub, whose check copies the service's | Only segment show prints id; segment list, host, notification and vmove outputs do not | masakariclient/osc/v1/segment.py:44, masakariclient/osc/v1/segment.py:69, masakariclient/osc/v1/host.py:300, masakari:masakari/db/sqlalchemy/api.py:200 | show id, or say so in the help |
| 7 | **Unknown --filters keys ignored** | list-args: segment list --filters bogus=1 | GET /segments with no parameter, all rows, exit 0 | masakariclient/common/utils.py:84, openstacksdk:openstack/resource.py:2223, openstacksdk:openstack/resource.py:340 | refuse unknown keys |
| 8 | Body attributes filter on the client side: --filters name=seg-a works, without a server parameter, after fetching every page | list-args | GET /segments, then 1 row | openstacksdk:openstack/resource.py:2236 | document |
| 9 | **Several --filters keep ; literally** | list-args: --filters 'recovery_method=auto;service_type=COMPUTE' --filters description=first | recovery_method=auto%3Bservice_type%3DCOMPUTE, no rows, exit 0 | masakariclient/common/utils.py:29 | split always |
| 10 | Failure of the read after a write reports failure | server-errors: segment create with 404 on the GET, notification create and segment update with 500 | exit 1 though the POST or PUT succeeded | masakariclient/osc/v1/segment.py:168, masakariclient/osc/v1/segment.py:247, masakariclient/osc/v1/notification.py:135, masakariclient/osc/v1/host.py:178 | show the write's response |
| 11 | A missing ID after a successful create | malformed-responses: POST /segments answering {} | exit 1, Request requires an ID but none was found, resource possibly created | masakariclient/osc/v1/segment.py:169 | check the response |
| 12 | Show with an empty body exits 0 | malformed-responses: GET /segments/{id} answering {} | an empty table, with every field None, exit 0 | masakariclient/osc/v1/segment.py:300 | treat it as an error |
| 13 | A name that does not match goes out as an ID | not-found: segment show nope | GET /segments, then GET /segments/nope, 404. On create: POST /segments/nope/hosts | masakariclient/common/utils.py:100 | stop after the failed lookup |
| 14 | Duplicate names: the first one wins without warning | names, with two seg-a | the first listed is used | masakariclient/common/utils.py:109 | report ambiguity; real names are unique per the 409 on create [inferred] |
| 15 | Deprecated keyword to the SDK | sdk-warnings with -v | masakariclient/osc/v1/host.py:294: RemovedInSDK50Warning: Parameter 'segment_id' has been renamed to 'segment'. Hidden at the default log level (osc-lib:osc_lib/logs.py:83) | masakariclient/osc/v1/host.py:172, masakariclient/osc/v1/host.py:248, masakariclient/osc/v1/host.py:287 | use segment= |
| 16 | A non-object payload is sent | client-validation: payload [1, 2] | POST with "payload": [1, 2]; stub accepted; real behaviour not tested | masakariclient/osc/v1/notification.py:126 | check the type |
Text and documentation defects (read, not run)
masakariclient/osc/v1/vmove.py:64: the help ends['type', 'status'without the closing bracket.masakariclient/osc/v1/vmove.py:96: "UUID of COMPUTE_NODE type notification", while the choice isCOMPUTE_HOST(masakariclient/osc/v1/notification.py:103).doc/source/cli/commands.rst:19and following lines read "Update Create host"; the table omits the twonotification vmovecommands.README.rst:12announces amasakaricommand that no longer exists.masakariclient/osc/v1/host.py:64: the help offersfailover_segment_idas a filter, but the service overwrites it from the URL (masakari:masakari/api/openstack/ha/hosts.py:59), so it has no effect there [inferred, the service was not run].
5. Errors that are not exceptions
The CLI never reads a resource status. A notification in error or a segment that recovery could not use exits 0 on show; the user reads the status column. See 05.
Source: reverse-spec-python-masakariclient/02-errors_stable-2026.2.md. The _rewrite/ and _inventory/ files are not published on the site.