Project init error.

613 views
Skip to first unread message

Kishan Kumar

unread,
Oct 26, 2022, 5:47:48 AM10/26/22
to Operator Framework
Hi All,

Hope everyone is very well,

I am new to operator-SDK stuff, I am not able to create a QuickStart project in operator-SDK.

I am getting an error:- 
FATA[0001] failed to initialize project: unable to scaffold with "base.go.kubebuilder.io/v3": exit status 1

Thanks & Regard,
Kishan Kumarerror.png


Marcin Owsiany

unread,
Oct 26, 2022, 5:59:10 AM10/26/22
to Kishan Kumar, Operator Framework
Something seems wrong with your directory structure. Note the error message on the line right after the "go get" command is printed.

--
You received this message because you are subscribed to the Google Groups "Operator Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to operator-framew...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/operator-framework/8fad450c-4fc8-4361-bee7-b262a8f4a2ecn%40googlegroups.com.

Kishan Kumar

unread,
Oct 26, 2022, 6:07:44 AM10/26/22
to Operator Framework
Then need again install the golang.

Austin Macdonald

unread,
Nov 1, 2022, 2:07:43 PM11/1/22
to Kishan Kumar, Operator Framework
Can you make sure you have the correct version of Golang Installed for the operator-sdk version you are using? go 1.18-> 1.19 has some breaking changes.

Kishan Kumar

unread,
Nov 3, 2022, 1:40:13 AM11/3/22
to Operator Framework
Hi Everyone,

I am still getting an error on the operator.
I am using the operator version 1.10.1 and go version 1.16.6.

This is an operator error.
FATA[0001] failed to create API: unable to run post-scaffold tasks of "base.go.kubebuilder.io/v3": exit status 2

Thanks & Regards
Kishan Kumar

Camila Macedo

unread,
Nov 3, 2022, 4:53:35 AM11/3/22
to Kishan Kumar, Operator Framework
Hi Kishan, 

The error seems like you are unable to get the dependency required (see the msg when it tries to go get the controller-runtime mod. ). I would like to recommend you check out:
  • a) Are you using a proxy? (Also, please check your go env)
  • b) Are you in a LAN that is restrictive and does not allow you to download from internet things? 
  • c) Do you have more than one go binary installed locally? If so, are you sure that you are using go version 1.16? Could you please ensure that your go env is pointed out for the version informed?
  • c) Would you be able to face the same issue with the latest version available and go 1.19? Could you please try it out? Have you any reason to still use go 1.16 and SDK version  1.10.x instead of v1.25.0 (latest release)? Would not be better to create a new project using the latest versions instead?  Why create a new project with technical debts? 
I hope that can help you out. 

Cheers, 



--
CAMILA MACEDO

SOFTWARE ENGINEER,

BLOG: www.dev4devs.com



Kishan Kumar

unread,
Nov 4, 2022, 1:44:47 AM11/4/22
to Operator Framework
Hi  Cheers,
I am new to operator-SDK. And still, get the same error.
I have checked everything is perfect.
can share with me any documents and articles for operator-SDK and golang installation?

Thanks & regard
Kishan Kumar

Austin Macdonald

unread,
Nov 4, 2022, 3:16:27 AM11/4/22
to Kishan Kumar, Operator Framework


On Fri, Nov 4, 2022, 1:44 AM Kishan Kumar <kishan...@reactiveworks.in> wrote:
Hi  Cheers,
I am new to operator-SDK. And still, get the same error.
I have checked everything is perfect.
can share with me any documents and articles for operator-SDK and golang installation?

Thanks & regard
Kishan Kumar

On Thursday, November 3, 2022 at 2:23:35 PM UTC+5:30 camilam...@gmail.com wrote:
Hi Kishan, 

The error seems like you are unable to get the dependency required (see the msg when it tries to go get the controller-runtime mod. ). I would like to recommend you check out:
  • a) Are you using a proxy? (Also, please check your go env)
  • b) Are you in a LAN that is restrictive and does not allow you to download from internet things? 
  • c) Do you have more than one go binary installed locally? If so, are you sure that you are using go version 1.16? Could you please ensure that your go env is pointed out for the version informed?
  • c) Would you be able to face the same issue with the latest version available and go 1.19? Could you please try it out? Have you any reason to still use go 1.16 and SDK version  1.10.x instead of v1.25.0 (latest release)? Would not be better to create a new project using the latest versions instead?  Why create a new project with technical debts? 
+1 to Camila. Chasing down dependency problems for a release over a year old doesn't sound like fun.

If you are required to use 1.10 (I'm curious why) be sure you are using the legacy docs. https://v1-10-x.sdk.operatorframework.io/


Kishan Kumar

unread,
Nov 4, 2022, 3:22:19 AM11/4/22
to Operator Framework
Hi
I am not interested in the 1.10 operator-SDK version. just any version install but working properly.

Thanks for replying to me.

Kishan Kumar

unread,
Nov 4, 2022, 4:25:24 AM11/4/22
to Operator Framework
Hi teams,

I was able to init the operator but when will go to create an API and controller then I got an error.

FATA[0002] failed to create API: unable to run post-scaffold tasks of "base.go.kubebuilder.io/v3": exit status 2


controller
Writing kustomize manifests for you to edit...
Writing scaffold for you to edit...
api/v1alpha1/memcached_types.go
controllers/memcached_controller.go
Update dependencies:
$ go mod tidy
Running make:
$ make generate
Makefile:170: warning: overriding recipe for target '/mnt/e/Go'
Makefile:155: warning: ignoring old recipe for target '/mnt/e/Go'
Makefile:175: warning: overriding recipe for target '/mnt/e/Go'
Makefile:170: warning: ignoring old recipe for target '/mnt/e/Go'
Makefile:180: warning: overriding recipe for target '/mnt/e/Go'
Makefile:175: warning: ignoring old recipe for target '/mnt/e/Go'
make: Circular /mnt/e/Go <- /mnt/e/Go dependency dropped.
mkdir -p /mnt/e/Go lang/new-operator/memcached-operator/bin
make: Circular /mnt/e/Go <- /mnt/e/Go dependency dropped.
make: Circular /mnt/e/Go <- /mnt/e/Go dependency dropped.
GOBIN=/mnt/e/Go lang/new-operator/memcached-operator/bin go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
bash: lang/new-operator/memcached-operator/bin: Is a directory
make: *** [Makefile:180: /mnt/e/Go] Error 126
Error: failed to create API: unable to run post-scaffold tasks of "base.go.kubebuilder.io/v3": exit status 2
Usage:
  operator-sdk create api [flags]

Examples:
  # Create a frigates API with Group: ship, Version: v1beta1 and Kind: Frigate
  operator-sdk create api --group ship --version v1beta1 --kind Frigate

  # Edit the API Scheme
  nano api/v1beta1/frigate_types.go

  # Edit the Controller
  nano controllers/frigate/frigate_controller.go

  # Edit the Controller Test
  nano controllers/frigate/frigate_controller_test.go

  # Generate the manifests
  make manifests

  # Install CRDs into the Kubernetes cluster using kubectl apply
  make install

  # Regenerate code and run against the Kubernetes cluster configured by ~/.kube/config
  make run


Flags:
      --controller           if set, generate the controller without prompting the user (default true)
      --force                attempt to create resource even if it already exists
      --group string         resource Group
  -h, --help                 help for api
      --kind string          resource Kind
      --make make generate   if true, run make generate after generating files (default true)
      --namespaced           resource is namespaced (default true)
      --plural string        resource irregular plural form
      --resource             if set, generate the resource without prompting the user (default true)
      --version string       resource Version

Global Flags:
      --plugins strings   plugin keys to be used for this subcommand execution
      --verbose           Enable verbose logging

FATA[0002] failed to create API: unable to run post-scaffold tasks of "base.go.kubebuilder.io/v3": exit status 2

Thanks & Best regard,
Kishan Kumar

Frederic Giloux

unread,
Nov 4, 2022, 8:18:44 AM11/4/22
to Kishan Kumar, Operator Framework
Hi Kishan

there is a white space in the path:
GOBIN=/mnt/e/Go lang/new-operator/memcached-operator/bin
The command is then interpreted as setting env var: GOBIN=/mnt/e/Go and running lang/new-operator/memcached-operator/bin, which as the error message states is a directory and not an exe.
Try to fix your path from "/mnt/e/Go lang" to "/mnt/e/Golang"

Regards,

Frédéric



--
Frédéric Giloux
OpenShift Engineering
Red Hat Germany

fgi...@redhat.com
   
M: +49-174-172-4661

r
edhat.com | TRIED. TESTED. TRUSTED. | redhat.com/trusted
________________________________________________________________________
Red Hat GmbH, Registered seat: Werner-von-Siemens-Ring 12, D-85630 Grasbrunn, Germany  
Commercial register: Amtsgericht München/Munich, HRB 153243,
Managing Directors: Ryan Barnhart, Charles Cachera, Michael O'Neill, Amy Ross

Kishan Kumar

unread,
Nov 4, 2022, 9:41:29 AM11/4/22
to Operator Framework

Hi  Frédéric,

Thank you so much.
Now working well.

Thanks & Best Regard.
Kishan Kumar
Reply all
Reply to author
Forward
0 new messages