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 <>
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.
Closing as this bug is no longer reproducible.