Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-14405

assisted-service panics if pull secret contains null

XMLWordPrintable

    • No
    • Sprint 238
    • 1
    • False
    • Hide

      None

      Show
      None
    • Hide
      Previously, if you installed a cluster using the Agent-based installer and your pull secret had a null "auth" or "email" field, the installation would fail without providing a useful error. With this update, the `openshift-install agent wait-for install-complete` command validates your pull secret and notifies you if there are null fields. (link:https://issues.redhat.com/browse/OCPBUGS-14405[*OCPBUGS-14405*])
      Show
      Previously, if you installed a cluster using the Agent-based installer and your pull secret had a null "auth" or "email" field, the installation would fail without providing a useful error. With this update, the `openshift-install agent wait-for install-complete` command validates your pull secret and notifies you if there are null fields. (link: https://issues.redhat.com/browse/OCPBUGS-14405 [* OCPBUGS-14405 *])
    • Bug Fix
    • Done

      Description of problem:

      When the user's pull secret contains a JSON null in the "auth" or "email" keys, assisted service crashes when we attempt to create the cluster:
      
      May 31 21:06:27 example.dev.local service[3389]: time="2023-05-31T09:06:27Z" level=error msg="Failed to registered cluster example with id 3648b06e-4745-4542-9421-78ae2e249c0d" func="github.
      com/openshift/assisted-service/internal/bminventory.(*bareMetalInventory).RegisterClusterInternal.func1" file="/src/internal/bminventory/inventory.go:448" cluster_id=3648b06e-4745-4542-9421-
      78ae2e249c0d go-id=162 pkg=Inventory request_id=1252f666-cf5c-4aae-9be7-7b7a579b5bf6
      May 31 21:06:27 example.dev.local service[3389]: 2023/05/31 09:06:27 http: panic serving 10.116.24.118:46262: interface conversion: interface {} is nil, not string
      May 31 21:06:27 example.dev.local service[3389]: goroutine 162 [running]:
      May 31 21:06:27 example.dev.local service[3389]: net/http.(*conn).serve.func1()
      May 31 21:06:27 example.dev.local service[3389]:         /usr/lib/golang/src/net/http/server.go:1850 +0xbf
      May 31 21:06:27 example.dev.local service[3389]: panic({0x25d0000, 0xc00148d7d0})
      May 31 21:06:27 example.dev.local service[3389]:         /usr/lib/golang/src/runtime/panic.go:890 +0x262
      May 31 21:06:27 example.dev.local service[3389]: github.com/openshift/assisted-service/internal/cluster/validations.ParsePullSecret({0xc001ed0780, 0x1c6})
      May 31 21:06:27 example.dev.local service[3389]:         /src/internal/cluster/validations/validations.go:106 +0x718
      May 31 21:06:27 example.dev.local service[3389]: github.com/openshift/assisted-service/internal/cluster/validations.(*registryPullSecretValidator).ValidatePullSecret(0xc0005880c0, {0xc001ed0780?, 0x7?}, {0x29916da, 0x5})
      May 31 21:06:27 example.dev.local service[3389]:         /src/internal/cluster/validations/validations.go:160 +0x54
      May 31 21:06:27 example.dev.local service[3389]: github.com/openshift/assisted-service/internal/bminventory.(*bareMetalInventory).ValidatePullSecret(...)
      May 31 21:06:27 example.dev.local service[3389]:         /src/internal/bminventory/inventory.go:279
      May 31 21:06:27 example.dev.local service[3389]: github.com/openshift/assisted-service/internal/bminventory.(*bareMetalInventory).RegisterClusterInternal(0xc00112f880, {0x2fd3e20, 0xc00148cd50}, 0x0, {0xc0007c0400, 0xc0008d69a0})
      May 31 21:06:27 example.dev.local service[3389]:         /src/internal/bminventory/inventory.go:564 +0x16d0
      May 31 21:06:27 example.dev.local service[3389]: github.com/openshift/assisted-service/internal/bminventory.(*bareMetalInventory).V2RegisterCluster(0x2fd3e20?, {0x2fd3e20?, 0xc00148cd50?}, {0xc0007c0400?, 0xc0008d69a0?})
      May 31 21:06:27 example.dev.local service[3389]:         /src/internal/bminventory/inventory_v2_handlers.go:42 +0x39
      May 31 21:06:27 example.dev.local service[3389]: github.com/openshift/assisted-service/restapi.HandlerAPI.func59({0xc0007c0400?, 0xc0008d69a0?}, {0x2390b20?, 0xc0014e0240?})
      May 31 21:06:27 example.dev.local service[3389]:         /src/restapi/configure_assisted_install.go:639 +0xaf
      May 31 21:06:27 example.dev.local service[3389]: github.com/openshift/assisted-service/restapi/operations/installer.V2RegisterClusterHandlerFunc.Handle(0xc000a9d068?, {0xc0007c0400?, 0xc0008d69a0?}, {0x2390b20?, 0xc0014e0240?})
      May 31 21:06:27 example.dev.local service[3389]:         /src/restapi/operations/installer/v2_register_cluster.go:19 +0x3d
      May 31 21:06:27 example.dev.local service[3389]: github.com/openshift/assisted-service/restapi/operations/installer.(*V2RegisterCluster).ServeHTTP(0xc000571470, {0x2fc7140, 0xc00034c040}, 0xc0007c0400)
      May 31 21:06:27 example.dev.local service[3389]:         /src/restapi/operations/installer/v2_register_cluster.go:66 +0x298
      May 31 21:06:27 example.dev.local service[3389]: github.com/go-openapi/runtime/middleware.NewOperationExecutor.func1({0x2fc7140, 0xc00034c040}, 0xc0007c0400)
      May 31 21:06:27 example.dev.local service[3389]:         /src/vendor/github.com/go-openapi/runtime/middleware/operation.go:28 +0x59

      Version-Release number of selected component (if applicable):

      4.12.17

      How reproducible:

      Probably 100%

      Steps to Reproduce:

      1. Add to the pull secret in install-config.yaml an auth like:
      
              "example.com": {
                "auth": null,
                "email": null
              }
      
      2. Generate the agent ISO as usual using "openshift-install agent create image"
      3. Boot the ISO on the cluster hosts.

      Actual results:

      The create-cluster-and-infraenv.service fails to complete. In its log it reports:
      
          Failed to register cluster with assisted-service: Post \"http://10.1.1.2:8090/api/assisted-install/v2/clusters\": EOF

      Expected results:

      Cluster is installed.

      Additional info:

      This is particularly difficult to debug because users don't generally give us their pull secrets. The pull secret file in the agent-gather bundle has individual fields redacted, so it is a better guide than the install-config where the whole thing may be redacted.

              zabitter Zane Bitter
              zabitter Zane Bitter
              zhenying niu zhenying niu
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: