Bug 2116489 - [Agent]: unable to create agent.iso when providing agent-config (without networkConfig) and manifests files together
Summary: [Agent]: unable to create agent.iso when providing agent-config (without netw...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 4.11
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.12.0
Assignee: Pawan Pinjarkar
QA Contact: Manoj Hans
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-08-08 15:40 UTC by Manoj Hans
Modified: 2022-09-26 21:26 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-09-26 21:26:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Manoj Hans 2022-08-08 15:40:24 UTC
Description: unable to create agent.iso when providing agent-config and manifests files (including nmstateconfig.yaml) together.

Here is the content of agent-config.yaml
--------------------------------------------
kind: AgentConfig
metadata:
  name: sno-cluster
spec:
  rendezvousIP: 192.168.111.80
  hosts:
    - hostname: master-0
      role: master
      rootDeviceHints:
       deviceName: /dev/sdb
      interfaces:
       - name: eno1
         macAddress: 00:ef:44:21:e6:a5
--------------------------------------------

How reproducible:

always

Repro Steps: 

1) Get the latest agent-installer and build

git clone -b agent-installer https://github.com/openshift/installer.git
cd installer/
hack/build.sh

2) Create agent.iso using agent-config and all manifests files including nmstateconfig.


Expected: Agent.iso should be created without any issue.
Actual: Unable to create agent.iso image, below are the logs:

INFO[0001] Start configuring static network for 1 hosts  pkg=manifests
ERRO[0001] <nmstatectl gc> failed, errorCode 1, stderr Traceback (most recent call last):
  File "/usr/bin/nmstatectl", line 11, in <module>
    load_entry_point('nmstate==1.2.1', 'console_scripts', 'nmstatectl')()
  File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 74, in main
    return args.func(args)
  File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 390, in run_gen_config
    if statedata[0] == "{":
IndexError: string index out of range
, input yaml <>  pkg=manifests
ERRO[0001] Failed to create static config for host       error="<nmstatectl gc> failed, errorCode 1, stderr Traceback (most recent call last):\n  File \"/usr/bin/nmstatectl\", line 11, in <module>\n    load_entry_point('nmstate==1.2.1', 'console_scripts', 'nmstatectl')()\n  File \"/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py\", line 74, in main\n    return args.func(args)\n  File \"/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py\", line 390, in run_gen_config\n    if statedata[0] == \"{\":\nIndexError: string index out of range\n, input yaml <>" pkg=manifests
ERROR failed to write asset (Agent Installer ISO) to disk: image reader not available 
FATAL failed to fetch Agent Installer ISO: failed to fetch dependency of "Agent Installer ISO": failed to generate asset "Agent Installer Ignition": failed to create StaticNetwork config data: <nmstatectl gc> failed, errorCode 1, stderr Traceback (most recent call last): 
FATAL   File "/usr/bin/nmstatectl", line 11, in <module> 
FATAL     load_entry_point('nmstate==1.2.1', 'console_scripts', 'nmstatectl')() 
FATAL   File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 74, in main 
FATAL     return args.func(args)                   
FATAL   File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 390, in run_gen_config 
FATAL     if statedata[0] == "{":                  
FATAL IndexError: string index out of range        
FATAL , input yaml <>

Comment 1 Zane Bitter 2022-08-17 02:21:49 UTC
Looks like we are trying to pass an empty string to nmstatectl. We should detect that earlier and neither create the NMStateConfig resource if there is no networkConfig provided in agent-config, nor call nmstatectl to generate the keyfiles if the NMStateConfig's nmstate field is empty.

Comment 2 Pawan Pinjarkar 2022-09-26 21:26:13 UTC
Closing as this bug is no longer reproducible.


Note You need to log in before you can comment on or make changes to this bug.