Bug 1771329

Summary: Failed to run `oc adm catalog build` command on MacOS
Product: OpenShift Container Platform Reporter: Jian Zhang <jiazha>
Component: ocAssignee: Nick Hale <nhale>
Status: CLOSED ERRATA QA Contact: Jian Zhang <jiazha>
Severity: high Docs Contact:
Priority: high    
Version: 4.3.0CC: aos-bugs, bandrade, cdjohnson, chuo, jfan, jokerman, mfojtik, nhale, scolange
Target Milestone: ---   
Target Release: 4.3.0   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Release Note
Doc Text:
Story Points: ---
Clone Of:
: 1772206 (view as bug list) Environment:
Last Closed: 2020-05-04 11:15:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1772206    

Description Jian Zhang 2019-11-12 07:48:18 UTC
Description of problem:
Got the below error when running it on MacOS.

mac:learn jianzhang$ oc adm catalog build --appregistry-org=jiazha --to=quay.io/jiazha/learn-test:v1
error: Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub

Version-Release number of selected component (if applicable):
MacOS version:
mac:learn jianzhang$ sw_vers 
ProductName:	Mac OS X
ProductVersion:	10.14.6
BuildVersion:	18G1012
mac:learn jianzhang$ uname

oc version:
mac:learn jianzhang$ oc version
Client Version: openshift-clients-4.3.0-201910250623-48-g8c30708e

How reproducible:

Steps to Reproduce:
1. Install the oc binary(MAC version) from https://openshift-release-artifacts.svc.ci.openshift.org/4.3.0-0.nightly-2019-11-12-013930/
2. Run "oc adm catalog build --appregistry-org=jiazha --to=quay.io/jiazha/learn-test:v1" command.

Actual results:

error: Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub

Expected results:
It works well on MacOS.

Additional info:
The oc of the Linux version works well.
[root@dhcp-140-36 jzhang]#  oc adm catalog build --appregistry-org=jiazha --to=quay.io/jiazha/learn-test:v1
INFO[0002] loading Bundles                               dir=/tmp/manifests-143131030
INFO[0002] directory                                     dir=/tmp/manifests-143131030 file=manifests-143131030 load=bundles
INFO[0002] directory                                     dir=/tmp/manifests-143131030 file=learn-operator load=bundles
[root@dhcp-140-36 jzhang]# uname

Comment 1 Nick Hale 2019-11-12 18:25:38 UTC
*** Bug 1771635 has been marked as a duplicate of this bug. ***

Comment 5 Jian Zhang 2019-11-25 09:24:00 UTC
Hi, Nick

> I'm opening a duplicate BZ, targeting 4.4, where we'll find a more permanent fix.

I change the target release of this bug to 4.3 since you have opened another bug for 4.4.
Now, this `oc adm catalog` command only supports on Linux, not on Mac and Windows. I think we should highlight it in the 4.3 release document.

Download the latest `oc` for MacOS.
mac:Downloads jianzhang$ tar -zxvf openshift-client-mac-4.3.0-0.nightly-2019-11-25-022933.tar.gz
x oc
x kubectl
mac:Downloads jianzhang$ ./oc version
Client Version: openshift-clients-4.3.0-201910250623-68-g9d412f42
Server Version: 4.2.0-0.nightly-2019-11-22-005934
Kubernetes Version: v1.14.6+a11558a

Now, we can see the "catalog" option has been removed. LGTM, verify it.
mac:Downloads jianzhang$ ./oc adm catalog
error: unknown command "catalog"
See 'oc adm -h' for help and examples
mac:Downloads jianzhang$ ./oc adm --help
Administrative Commands

 Actions for administering an OpenShift cluster are exposed here.

  oc adm [flags]

Cluster Management:
  upgrade                            Upgrade a cluster
  top                                Show usage statistics of resources on the server
  must-gather                        Launch a new instance of a pod for gathering debug information
  inspect                            Collect debugging data for a given resource

Node Management:
  drain                              Drain node in preparation for maintenance
  cordon                             Mark node as unschedulable
  uncordon                           Mark node as schedulable
  taint                              Update the taints on one or more nodes
  node-logs                          Display and filter node logs

Security and Policy:
  new-project                        Create a new project
  policy                             Manage cluster authorization and security policy
  groups                             Manage groups
  certificate                        Approve or reject certificate requests
  pod-network                        Manage pod network

  prune                              Remove older versions of resources from the server
  migrate                            Migrate data in the cluster

  create-kubeconfig                  Create a basic .kubeconfig file from client certs
  create-bootstrap-project-template  Create a bootstrap project template
  create-login-template              Create a login template
  create-provider-selection-template Create a provider selection template
  create-error-template              Create an error page template

Other Commands:
  build-chain                        Output the inputs and dependencies of your builds
  completion                         Output shell completion code for the specified shell (bash or zsh)
  config                             Change configuration files for the client
  verify-image-signature             Verify the image identity contained in the image signature

Use "oc adm <command> --help" for more information about a given command.
Use "oc adm options" for a list of global command-line options (applies to all commands).

Comment 7 errata-xmlrpc 2020-05-04 11:15:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Comment 8 Chris Johnson 2020-07-15 19:00:59 UTC
The errata suggests that `oc adm catalog` is available in OCP 4.4.3.  I've confirmed that it is not, nor is it in 4.4.13.  It is, however, available in 4.5.1.