openshift / appliance

OpenShift-based Appliance Builder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to build appliance disk image

inho-cho-redhat opened this issue · comments

I downloaded release-4.14 and release-4.16.
Both occured the same error.

Here are my steps.

  1. Download release-4.14 (or release-4.16)
  2. Unzip release.
  3. make build-appliance
  4. generate-config-file-template
    ./build/openshift-appliance generate-config --dir assets
  5. Start appliance disk image build
    export LIBGUESTFS_BACKEND=direct
    ./build/openshift-appliance build --dir assets --log-level info
#./build/openshift-appliance build --dir assets --log-level info
...
DEBUG   Generating Data ISO...                     
DEBUG Running cmd: skopeo copy docker://docker.io/library/registry:2 docker-archive:assets/cache/4.14.1-x86_64/registry.tar:registry:2 
INFO Successfully pulled container registry image 
| Pulling OpenShift 4.14.1 release images required for bootstrap...DEBUG Stopping registry container                  
DEBUG Running cmd: podman rm registry -f           
DEBUG Running cmd: podman run --net=host --privileged -d --name registry -v /root/workspaces/agent-based-installation/appliance-release-4.16/assets/temp/data/oc-mirror/bootstrap:/var/lib/registry --restart=always -e REGISTRY_HTTP_ADDR=0.0.0.0:5005 docker.io/library/registry:2 
ERROR Failed to pull OpenShift 4.14.1 release images required for bootstrap 
FATAL failed to fetch Appliance disk image: failed to fetch dependency of "Appliance disk image": failed to generate asset "Data ISO": registry start failure: Failed to execute cmd (/usr/bin/podman run --net=host --privileged -d --name registry -v /root/workspaces/agent-based-installation/appliance-release-4.16/assets/temp/data/oc-mirror/bootstrap:/var/lib/registry --restart=always -e REGISTRY_HTTP_ADDR=0.0.0.0:5005 docker.io/library/registry:2): Trying to pull docker.io/library/registry:2... 
FATAL Getting image source signatures              
FATAL Copying blob sha256:834bccaa730c985b202b64916ba9cbab707b8a165cece04b8aea3801d6a75741 
FATAL Copying blob sha256:87a69098c0a9de0cc3ba47b55ccaaeb5e9cc0207cea65cffc099901ae584ac60 
FATAL Copying blob sha256:96526aa774ef0126ad0fe9e9a95764c5fc37f409ab9e97021e7b4775d82bf6fa 
FATAL Copying blob sha256:afc17120a9f79c15fe4431b56f04be686bc6b46efa8a37e8b411c45fa3427c6c 
FATAL Copying blob sha256:e5ac04f3acf5ffaabc4cba31e45edb0878ca4b63c99a0665069f4aecc09c5afa 
FATAL Error: copying system image from manifest list: trying to reuse blob sha256:96526aa774ef0126ad0fe9e9a95764c5fc37f409ab9e97021e7b4775d82bf6fa at destination: looking for layers with digest "sha256:96526aa774ef0126ad0fe9e9a95764c5fc37f409ab9e97021e7b4775d82bf6fa": loading primary layer store data: []storage.layerMountPoint: decode slice: expect [ or n, but found �, error found in #1 byte of ...|�5|..., bigger context ...|�5|... 
FATAL : exit status 125                            

How to resolve this issue?

Hey @inho-cho-redhat, can you please try to build the appliance with the podman flow: https://github.com/openshift/appliance/blob/master/docs/user-guide.md#build-the-disk-image
(using the binary is mainly for development purposes).
Also, can you please share your appliance-config.yaml?

When I follow the user-guide instructions, I can't use additionalImages & operators fields.
It made an error "unknown field" - Refer to this (#163 (comment))

Here is my appliance-config.yaml

apiVersion: v1beta1
kind: ApplianceConfig
ocpRelease:
  version: 4.14.1
  channel: stable
  cpuArchitecture: x86_64
#diskSizeGB: disk-size
# PullSecret required for mirroring the OCP release payload
pullSecret: 'my pull secret'
sshKey: 'public ssh key'
userCorePass: 'Redhat!123'
imageRegistry:
  # uri: registry.ocp4-helper
  # port: 5002
#enableDefaultSources: false
#stopLocalRegistry: false
additionalImages:
  - name: registry.redhat.io/ubi9/ubi:latest
  - name: registry.redhat.io/rhel9/support-tools:latest
  - name: quay.io/openshift/origin-must-gather:4.14
operators:
- catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
  packages:
  - name: lvms-operator
    channels:
    - name: 'stable-4.14'
      minVersion: '4.14.0'
      maxVersion: '4.14.0'
  - name: 'ptp-operator'
    channels:
    - name: 'stable'
      minVersion: '4.14.0-202310201027'
      maxVersion: '4.14.0-202310201027'
  - name: 'sriov-network-operator'
    channels:
    - name: 'stable'
      minVersion: '4.14.0-202310201027'
      maxVersion: '4.14.0-202310201027'
- catalog: registry.redhat.io/redhat/certified-operator-index:v4.14
  packages:
  - name: sriov-fec
    channels:
    - name: stable

Maybe there's an old version of the image cached in your machine. Can you please try to remove the appliance image and pull it again?

Like you said, there is a problem with my env.
running "podman images" command causes an error.
But I have no idea how to handle it.
Even if I remove all related with podman and install again, the same error occurs.

yum remove buildah skopeo podman 
rm -rf /etc/containers/* /var/lib/containers/* /etc/subuid* /etc/subgid*
rm -rf $HOME/.local/share/containers/
yum install buildah skopeo podman 

podman images -a
Error: loading primary layer store data: []storage.layerMountPoint: decode slice: expect [ or n, but found �, error found in #1 byte of ...|�5|..., bigger context ...|�5|...

May you know how to resolve it?

Maybe try to remove all images:
podman image prune --all

I did it already but not worked.

Try to look into /etc/containers/storage.conf
Maybe storage is configured to some custom dir.

@danielerez Thank you. It resolved.

INFO Time elapsed: 10m50s                         
INFO                                              
INFO Appliance disk image was successfully created in assets directory: assets/appliance.raw 
INFO                                              
INFO Create configuration ISO using: openshift-install agent create config-image 
INFO Download openshift-install from: https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/4.14.1/openshift-install-linux.tar.gz 

sure, np:)