sysinv-helm command fails to generate application overrides

Bug #2055463 reported by Joshua Reed
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Joshua Reed

Bug Description

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

When debugging application plugins, I attempted to use the sysinv-helm command to validate override generation outside of application-apply.

Severity
-----------------
Minor: sysinv-helm command is not usable but overrides are correctly generated during application-apply

Steps to Reproduce
-----------------
source /etc/platform/openrc
system application-upload /usr/local/share/applications/helm/metrics-server-1.1-44.tgz
sudo sysinv-helm create-fluxcd-app-overrides /home/sysadmin metrics-server metrics-server

Expected Behavior
------------------
The command should result in a populated yaml file in the path specified.

Actual Behavior
----------------
Command fails with a stack trace printed to terminal.

Reproducibility
---------------
100%

System Configuration
--------------------
AIO-SX

Branch/Pull Time/Commit
-----------------------
Current Master Branch of config repo.

Last Pass
---------
Unknown

Timestamp/Logs
--------------
sysadmin@controller-0:~$ sudo sysinv-helm create-fluxcd-app-overrides /home/sysadmin metrics-server metrics-server
sysinv 2024-01-04 13:26:29.436 1074590 INFO sysinv.helm.helm [-] No entry points for systemconfig.helm_applications found.
sysinv 2024-01-04 13:26:29.437 1074590 INFO sysinv.helm.helm [-] No entry points for systemconfig.fluxcd.kustomize_ops found.
sysinv 2024-01-04 13:26:29.437 1074590 INFO sysinv.helm.helm [-] No entry points for systemconfig.app_lifecycle found.
sysinv 2024-01-04 13:26:29.737 1074590 INFO sysinv.helm.helm [-] Plugins for dell-storage : loaded from k8sapp-dell-storage - /opt/platform/helm/23.09/dell-storage/1.0-6/plugins.
sysinv 2024-01-04 13:26:29.737 1074590 INFO sysinv.helm.helm [-] Plugins for generic : loaded from sysinv - /usr/lib/python3/dist-packages.
sysinv 2024-01-04 13:26:29.737 1074590 INFO sysinv.helm.helm [-] Plugins for platform-integ-apps : loaded from k8sapp-platform - /opt/platform/helm/23.09/platform-integ-apps/23.09-121/plugins.
sysinv 2024-01-04 13:26:29.737 1074590 INFO sysinv.helm.helm [-] Plugins for rook-ceph-apps : loaded from k8sapp-rook - /opt/platform/helm/23.09/rook-ceph-apps/23.09-39/plugins.
sysinv 2024-01-04 13:26:29.739 1074590 ERROR stevedore.extension [-] Could not load 'metrics-server': name 'MetricsServerAppLifecycleOperator' is not defined: NameError: name 'MetricsServerAppLifecycleOperator' is not defined
sysinv 2024-01-04 13:26:29.744 1074590 INFO sysinv.conductor.kube_app [-] Loading application metadata for rook-ceph-apps from database
sysinv 2024-01-04 13:26:29.748 1074590 CRITICAL sysinv [-] Unhandled error: KeyError: 'apps'
2024-01-04 13:26:29.748 1074590 ERROR sysinv Traceback (most recent call last):
2024-01-04 13:26:29.748 1074590 ERROR sysinv File "/usr/bin/sysinv-helm", line 10, in <module>
2024-01-04 13:26:29.748 1074590 ERROR sysinv sys.exit(main())
2024-01-04 13:26:29.748 1074590 ERROR sysinv File "/usr/lib/python3/dist-packages/sysinv/cmd/helm.py", line 82, in main
2024-01-04 13:26:29.748 1074590 ERROR sysinv CONF.action.func(CONF.action.path,
2024-01-04 13:26:29.748 1074590 ERROR sysinv File "/usr/lib/python3/dist-packages/sysinv/cmd/helm.py", line 40, in create_fluxcd_app_overrides_action
2024-01-04 13:26:29.748 1074590 ERROR sysinv app_operator = kube_app.AppOperator(dbapi, helm_operator, {})
2024-01-04 13:26:29.748 1074590 ERROR sysinv File "/usr/lib/python3/dist-packages/sysinv/conductor/kube_app.py", line 154, in __init__
2024-01-04 13:26:29.748 1074590 ERROR sysinv self.load_application_metadata_from_database(app)
2024-01-04 13:26:29.748 1074590 ERROR sysinv File "/usr/lib/python3/dist-packages/sysinv/conductor/kube_app.py", line 2405, in load_application_metadata_from_database
2024-01-04 13:26:29.748 1074590 ERROR sysinv AppOperator.update_and_process_app_metadata(self._apps_metadata,
2024-01-04 13:26:29.748 1074590 ERROR sysinv File "/usr/lib/python3/dist-packages/oslo_concurrency/lockutils.py", line 360, in inner
2024-01-04 13:26:29.748 1074590 ERROR sysinv return f(*args, **kwargs)
2024-01-04 13:26:29.748 1074590 ERROR sysinv File "/usr/lib/python3/dist-packages/sysinv/conductor/kube_app.py", line 2363, in update_and_process_app_metadata
2024-01-04 13:26:29.748 1074590 ERROR sysinv apps_metadata_dict[constants.APP_METADATA_APPS][app_name] = metadata
2024-01-04 13:26:29.748 1074590 ERROR sysinv KeyError: 'apps'
2024-01-04 13:26:29.748 1074590 ERROR sysinv

Test Activity
-------------
Normal use

Workaround
----------
None

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to config (master)

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

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

Reviewed: https://review.opendev.org/c/starlingx/config/+/910661
Committed: https://opendev.org/starlingx/config/commit/b2e75b771fb8c6f779ef96939fac3a620cf36e0f
Submitter: "Zuul (22348)"
Branch: master

commit b2e75b771fb8c6f779ef96939fac3a620cf36e0f
Author: Joshua Reed <email address hidden>
Date: Thu Feb 29 13:23:54 2024 -0700

    Fix sysinv-helm command.

    Running the sysinv-helm command to create fluxcd app
    overrides fails with a stack trace printed to terminal.

    This fix pre-populates the apps_metadata_dict variable with
    an empty dictionary in the event that its empty, which it would
    be the first time when this command is run.

    Test Plan:
    PASS: Verify command 1 below produces {} in the output yaml.
    PASS: Verify command 2 below produces fully populated output
          accross several yaml files.
    PASS: Verify sysinv conductor starts up correctly with these
          changes in place.

    Command 1:
    system application-upload \
      /usr/local/share/applications/helm/metrics-server-1.1-44.tgz
    sudo sysinv-helm create-fluxcd-app-overrides \
      /home/sysadmin metrics-server metrics-server

    Command 2:
    sudo sysinv-helm create-fluxcd-app-overrides \
      /home/sysadmin platform-integ-apps kube-system

    Closes-Bug: 2055463

    Change-Id: I3251776653bcfb1cf11f3dfec388953d476b8465
    Signed-off-by: Joshua Reed <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Joshua Reed (jreed7)
Changed in starlingx:
assignee: nobody → Joshua Reed (jreed7)
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
tags: added: stx.9.0 stx.apps stx.config
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.