dcmanager subcloud deploy resume results in type error exception

Bug #2067326 reported by Raphael Lima
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Raphael Lima

Bug Description

Brief Description
-----------------

Executing the subcloud deploy resume command after aborting a subcloud deployment during bootstrap results in a type error.

Severity
-----------------

Minor: System/Feature is usable with minor issue

Steps to Reproduce
-----------------

In a DC system:

1. Import the ISO
system --os-region-name SystemController load-import --active starlingx-intel-x86-64-cd.iso starlingx-intel-x86-64-cd.sig

2. Start the subcloud deployment
dcmanager subcloud add --bootstrap-address 10.10.20.12 --bootstrap-values bootstrap-values-subcloud1.yml --deploy-config deployment-config-subcloud1.yaml --sysadmin-password <password> --bmc-password <password> --install-values install-values-subcloud1.yml

3. Abort the subcloud deployment during the bootstrap stage
dcmanager subcloud deploy abort subcloud1

4. Execute the subcloud deploy resume
dcmanager subcloud deploy resume subcloud1 --bootstrap-address 10.10.20.12 --bootstrap-values bootstrap-values-subcloud1.yml --deploy-config deployment-config-subcloud1.yaml --sysadmin-password <password> --bmc-password <password> --install-values install-values-subcloud1.yml

Expected Behavior
-----------------

The subcloud deploy resume should be executed successfully and the subcloud should start the bootstrap process.

Actual Behavior
-----------------

The command execution fails with the message ERROR (app) b''.

Reproducibility
-----------------

100% Reproducible

System Configuration
-----------------

DC system with one subcloud

Last Pass
-----------------

N/A

Timestamp/Logs
-----------------

dcmanager-api.log

2024-05-15 19:06:08.651 21960 INFO dccommon.drivers.openstack.sdk_platform [req-042fc092-ed24-4ad9-92bd-3ace1e09f16a 0c9be6f5630544c89c65d3c4a1c81172 - - default default] The cached keystone token for subcloud RegionOne will expire soon 2024-05-15T19:03:06.000000Z
2024-05-15 19:06:08.652 21960 INFO dccommon.endpoint_cache [req-042fc092-ed24-4ad9-92bd-3ace1e09f16a 0c9be6f5630544c89c65d3c4a1c81172 - - default default] The cached keystone token for RegionOne will expire soon 2024-05-15T19:03:06.000000Z
2024-05-15 19:06:08.929 21960 INFO dccommon.endpoint_cache [req-042fc092-ed24-4ad9-92bd-3ace1e09f16a 0c9be6f5630544c89c65d3c4a1c81172 - - default default] Generated Master keystone client and master token as they are expiring soon
2024-05-15 19:06:09.012 21960 ERROR dcmanager.common.context.auditor [req-042fc092-ed24-4ad9-92bd-3ace1e09f16a 0c9be6f5630544c89c65d3c4a1c81172 - - default default] Exception in AuditLoggingHook passed to event 'on_error': not indexable: TypeError: not indexable
2024-05-15 19:06:09.012 21960 ERROR dcmanager.common.context.auditor Traceback (most recent call last):
2024-05-15 19:06:09.012 21960 ERROR dcmanager.common.context.auditor   File "/usr/lib/python3/dist-packages/pecan/core.py", line 683, in __call__
2024-05-15 19:06:09.012 21960 ERROR dcmanager.common.context.auditor     self.invoke_controller(controller, args, kwargs, state)
2024-05-15 19:06:09.012 21960 ERROR dcmanager.common.context.auditor   File "/usr/lib/python3/dist-packages/pecan/core.py", line 574, in invoke_controller
2024-05-15 19:06:09.012 21960 ERROR dcmanager.common.context.auditor     result = controller(*args, **kwargs)
2024-05-15 19:06:09.012 21960 ERROR dcmanager.common.context.auditor   File "/usr/lib/python3/dist-packages/dcmanager/api/controllers/v1/phased_subcloud_deploy.py", line 549, in patch
2024-05-15 19:06:09.012 21960 ERROR dcmanager.common.context.auditor     subcloud = self._deploy_resume(context, pecan.request, subcloud)
2024-05-15 19:06:09.012 21960 ERROR dcmanager.common.context.auditor   File "/usr/lib/python3/dist-packages/dcmanager/api/controllers/v1/phased_subcloud_deploy.py", line 470, in _deploy_resume
2024-05-15 19:06:09.012 21960 ERROR dcmanager.common.context.auditor     psd_common.pre_deploy_bootstrap(context, payload, subcloud,
2024-05-15 19:06:09.012 21960 ERROR dcmanager.common.context.auditor   File "/usr/lib/python3/dist-packages/dcmanager/common/phased_subcloud_deploy.py", line 1090, in pre_deploy_bootstrap
2024-05-15 19:06:09.012 21960 ERROR dcmanager.common.context.auditor     format_ip_address(payload)
2024-05-15 19:06:09.012 21960 ERROR dcmanager.common.context.auditor   File "/usr/lib/python3/dist-packages/dcmanager/common/phased_subcloud_deploy.py", line 724, in format_ip_address
2024-05-15 19:06:09.012 21960 ERROR dcmanager.common.context.auditor     if k in payload[consts.INSTALL_VALUES]:
2024-05-15 19:06:09.012 21960 ERROR dcmanager.common.context.auditor   File "/usr/lib/python3.9/cgi.py", line 573, in __contains__
2024-05-15 19:06:09.012 21960 ERROR dcmanager.common.context.auditor     raise TypeError("not indexable")
2024-05-15 19:06:09.012 21960 ERROR dcmanager.common.context.auditor TypeError: not indexable
2024-05-15 19:06:09.012 21960 ERROR dcmanager.common.context.auditor
2024-05-15 19:06:09.013 21960 INFO dcmanager.common.context.auditor [req-042fc092-ed24-4ad9-92bd-3ace1e09f16a 0c9be6f5630544c89c65d3c4a1c81172 - - default default] Request id is not in request, setting it to an auto generated id.
2024-05-15 19:06:09.013 21960 INFO dcmanager.common.context.auditor [req-1b0c4fd3-cf3e-4974-9912-b9b5077c9a61 0c9be6f5630544c89c65d3c4a1c81172 7bacf79a63ae4a1599f369081d3a3124 - - -] 192.168.204.3 "PATCH /v1.0/phased-subcloud-deploy/subcloud1/resume HTTP/1.0" status: 200 len: 0 time: 0.3794286251068115 POST: NestedMultiDict([('install_values', FieldStorage('install_values', 'install-values-subcloud1.yml')), ('bootstrap-address', '10.10.20.12'), ('sysadmin_password', '******'), ('bmc_password', '******')]) host:192.168.204.2:8119 agent:python-requests/2.25.1 user: admin tenant: admin domain: Default

Alarms
-----------------

N/A

Workaround
-----------------

The key error raised is related to the install values. Because of that, running the resume command without it results in the correct behavior.

dcmanager subcloud deploy resume subcloud1 --bootstrap-address 10.10.20.12 --bootstrap-values bootstrap-values-subcloud1.yml --deploy-config deployment-config-subcloud1.yaml --sysadmin-password <password> --bmc-password <password> --install-values install-values-subcloud1.yml

Raphael Lima (r-lima)
Changed in starlingx:
assignee: nobody → Raphael Lima (r-lima)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to distcloud (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/distcloud/+/920598

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to distcloud (master)

Reviewed: https://review.opendev.org/c/starlingx/distcloud/+/920598
Committed: https://opendev.org/starlingx/distcloud/commit/ccdacffb1f6c63cb7949bab150057e1308357d4f
Submitter: "Zuul (22348)"
Branch: master

commit ccdacffb1f6c63cb7949bab150057e1308357d4f
Author: Raphael Lima <email address hidden>
Date: Mon May 27 19:32:59 2024 -0300

    Add file validation to subcloud deploy resume

    Adds a file validation to subcloud deploy resume command in order to
    accept payloads that contain only the required data files, quitting the
    execution if any other one is sent, e.g. a subcloud in
    bootstrap-complete state should only receive the deploy config file
    since that's the remaining step to execute. If a bootstrap values or
    install values is sent, the execution is terminated.

    Test plan:
    1. PASS: In a bootstrapped subcloud, execute the resume command sending
    both the bootstrap values and install values, resulting in a failure.
    2. PASS: In a bootstrapped subcloud, execute the resume command sending
    only the bootstrap values, resulting in a failure.
    3. PASS: In a bootstrapped subcloud, execute the resume command sending
    only the install values, resulting in a failure.
    4. PASS: In a bootstrapped subcloud, execute the resume command without
    sending any files, resulting in the process starting.
    5. PASS: In a bootstrapped subcloud, execute the resume command sending
    only the deploy config file, resulting in the process starting.

    Closes-Bug: 2067326

    Change-Id: I6221ea6c15e119d7451611309bff557a6e2b783c
    Signed-off-by: Raphael Lima <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.