OpenKeel: the sovereign French Cloud solution of the inherent group, with a European reach Discover inherent

Reverse-spec · Clients

python-masakariclient — Errors

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

ExitSituationOutputSource
0success, and **any failure in segment delete**stdoutcliff:cliff/command.py:196, masakariclient/osc/v1/segment.py:271
1an exception leaves take_action; cliff logs str(exc)stderr; traceback only with --debugcliff:cliff/app.py:462
2argparse refusal, or the command does not exist in the selected versionstderr, or stdout for an unknown commandopenstackclient: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

ClassBaseRaisedSource
BaseExceptionException, shadows the builtin in this modulethrough its childmasakariclient/common/exception.py:16
CommandErrorBaseException above, not the osc-lib class of the same namemasakariclient/common/utils.py:38, masakariclient/common/utils.py:76masakariclient/common/exception.py:25
UnsupportedVersionExceptionmasakariclient/api_versions.py:58, never seen in the runsmasakariclient/common/exception.py:29

3. Message catalogue

Messages written by the project

MessageExceptionSituationRaised atCommandsSeen
Segment is not found: %sosc-lib CommandErrorGET /segments/{id} answers 404masakariclient/osc/v1/segment.py:279segment show, also create and update on the follow-up read[observed]
Segment host is not found: %sosc-lib CommandErrorGET …/hosts/{id} answers 404masakariclient/osc/v1/host.py:296segment host show, also create and update[observed]
Notification not found: %sosc-lib CommandErrorGET /notifications/{id} answers 404masakariclient/osc/v1/notification.py:143notification show, also create[observed]
VMove %s is not found.osc-lib CommandErrorGET …/vmoves/{id} answers 404, including when the notification is what is missingmasakariclient/osc/v1/vmove.py:115notification vmove show[observed]
No Segment found for %sResourceNotFoundPUT /segments/{id} answers 404masakariclient/osc/v1/segment.py:242segment update[observed]
No Host found for %sResourceNotFoundPUT …/hosts/{id} answers 404masakariclient/osc/v1/host.py:253segment host update[observed]
Malformed parameter(%s). Use the key=value format.CommandErrora --filters item without =; no request sentmasakariclient/common/utils.py:384 list commands[observed]
Unknown sort direction: %sCommandError--sort key:other, anything but asc or desc; no request sentmasakariclient/common/utils.py:764 list commands[observed]
Invalid format of client version '%s'…UnsupportedVersionthe default microversion is not X.Ymasakariclient/api_versions.py:58gated commandsnot reached
re-raise of the originalanyexcept Exception as ex: raise ex with a LOG.debugmasakariclient/osc/v1/segment.py:167, masakariclient/osc/v1/segment.py:246, masakariclient/osc/v1/host.py:177, masakariclient/osc/v1/host.py:257create 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]

SituationExitText (with <stub> for the address)Origin
4xx or 5xx on a request without a dedicated handler1ConflictException: 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 body1HttpException: 503: Server Error for url: …, Service Unavailablesame
**5xx on get_***1No Segment found for <uuid>: Server Error for url: …, boom; "No … found" is misleading for a 500openstacksdk:openstack/proxy.py:861
--os-ha-api-version above the service's maximum, or the default 1.3 against an older service1, no requestA 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)continuesha API version 1.99 is not in supported versions: 1, 1.0, 1.1, 1.2, 1.3openstackclient:openstackclient/shell.py:135
same, other major (abc, 2, latest)2the same warning, then openstack: 'segment list' is not an openstack command. with suggestionsopenstackclient:openstackclient/shell.py:150
no instance-ha or ha entry in the catalog1Service '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 refuses1The request you have made requires authentication. (HTTP 401)keystoneauth1
argparse: bad <recovery_method>, <type>, --reserved true, missing positional2usage, then invalid choicemasakariclient/osc/v1/segment.py:120, masakariclient/osc/v1/notification.py:103, masakariclient/osc/v1/host.py:144
--is_enabled maybe1, no requestUnrecognized 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 JSON1, no requestExpecting value: line 1 column 1 (char 0)masakariclient/osc/v1/notification.py:126
2xx without the collection key1'segments', the bare key name of a KeyErroropenstacksdk:openstack/resource.py:2294
2xx not JSON on a list1Expecting value: line 1 column 1 (char 0)SDK
a create answering without uuid or notification_uuid; an item in a name lookup without uuid1Request requires an ID but none was foundopenstacksdk: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.

#DefectReproductionResultSourceFix for a rewrite
1**segment delete exit 0 on failure**; the error goes to stdout; the loop goes on with the next namenot-found, server-errors, no-catalog-entry: segment delete nope; 409 and 403 injectedexit 0, NotFoundException: 404… on stdout. segment delete nope seg-b deletes seg-b and exits 0masakariclient/osc/v1/segment.py:271report 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 14 requests (limit=1, then marker=1, 2, 3), 3 rows. Same on hosts, notifications, vmovesmasakariclient/common/utils.py:63, openstacksdk:openstack/resource.py:2434pass max_items
3Default 1.3 is not negotiatedserver-older: stub with maximum 1.2every command exits 1 with no request; with --os-ha-api-version 1.2 it worksmasakariclient/plugin.py:22, openstacksdk:openstack/config/cloud_region.py:1263negotiate 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 falseno PUT, exit 0, is_enabled absent from the output. segment create creates the segment enabledmasakariclient/osc/v1/segment.py:154, masakariclient/osc/v1/segment.py:228refuse the option
5**--os-ha-api-version 1 and 1.0: columns and wire disagree**versionssegments 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.0masakariclient/osc/v1/segment.py:72, openstacksdk:openstack/instance_ha/v1/segment.py:36, openstacksdk:openstack/config/cloud_region.py:121read the version actually used
6**--marker needs an ID the CLI does not show**: help says ID; the server matches the integer idlist-args: a UUID gives 400 on the stub, whose check copies the service'sOnly segment show prints id; segment list, host, notification and vmove outputs do notmasakariclient/osc/v1/segment.py:44, masakariclient/osc/v1/segment.py:69, masakariclient/osc/v1/host.py:300, masakari:masakari/db/sqlalchemy/api.py:200show id, or say so in the help
7**Unknown --filters keys ignored**list-args: segment list --filters bogus=1GET /segments with no parameter, all rows, exit 0masakariclient/common/utils.py:84, openstacksdk:openstack/resource.py:2223, openstacksdk:openstack/resource.py:340refuse unknown keys
8Body attributes filter on the client side: --filters name=seg-a works, without a server parameter, after fetching every pagelist-argsGET /segments, then 1 rowopenstacksdk:openstack/resource.py:2236document
9**Several --filters keep ; literally**list-args: --filters 'recovery_method=auto;service_type=COMPUTE' --filters description=firstrecovery_method=auto%3Bservice_type%3DCOMPUTE, no rows, exit 0masakariclient/common/utils.py:29split always
10Failure of the read after a write reports failureserver-errors: segment create with 404 on the GET, notification create and segment update with 500exit 1 though the POST or PUT succeededmasakariclient/osc/v1/segment.py:168, masakariclient/osc/v1/segment.py:247, masakariclient/osc/v1/notification.py:135, masakariclient/osc/v1/host.py:178show the write's response
11A missing ID after a successful createmalformed-responses: POST /segments answering {}exit 1, Request requires an ID but none was found, resource possibly createdmasakariclient/osc/v1/segment.py:169check the response
12Show with an empty body exits 0malformed-responses: GET /segments/{id} answering {}an empty table, with every field None, exit 0masakariclient/osc/v1/segment.py:300treat it as an error
13A name that does not match goes out as an IDnot-found: segment show nopeGET /segments, then GET /segments/nope, 404. On create: POST /segments/nope/hostsmasakariclient/common/utils.py:100stop after the failed lookup
14Duplicate names: the first one wins without warningnames, with two seg-athe first listed is usedmasakariclient/common/utils.py:109report ambiguity; real names are unique per the 409 on create [inferred]
15Deprecated keyword to the SDKsdk-warnings with -vmasakariclient/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:287use segment=
16A non-object payload is sentclient-validation: payload [1, 2]POST with "payload": [1, 2]; stub accepted; real behaviour not testedmasakariclient/osc/v1/notification.py:126check 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 is COMPUTE_HOST (masakariclient/osc/v1/notification.py:103).
  • doc/source/cli/commands.rst:19 and following lines read "Update Create host"; the table omits the two notification vmove commands.
  • README.rst:12 announces a masakari command that no longer exists.
  • masakariclient/osc/v1/host.py:64: the help offers failover_segment_id as 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.