Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error: failed to compile target: busybox #641

Closed
retr0h opened this issue Oct 29, 2020 · 6 comments
Closed

Compile error: failed to compile target: busybox #641

retr0h opened this issue Oct 29, 2020 · 6 comments
Labels

Comments

@retr0h
Copy link

retr0h commented Oct 29, 2020

Describe the bug/feature

Error working through examples

To Reproduce
Steps to reproduce the behavior:

  1. Git clone repo
  2. cd examples/kubernetes
  3. kapitan compile

Expected behavior

Examples used in docs should work

Screenshots

~/git/kapitan/examples/kubernetes master
.venv ❯ kapitan compile
Compiled removal (0.00s)


Jsonnet error: failed to compile /Users/john.dewey/git/kapitan/examples/kubernetes/components/namespace/main.jsonnet:
 RUNTIME ERROR: 'NoneType' object has no attribute 'inventory_path'
        /Users/john.dewey/git/kapitan/.venv/lib/python3.8/site-packages/kapitan/lib/kapitan.libjsonnet:9:59-100 function <anonymous>
        /Users/john.dewey/git/kapitan/examples/kubernetes/components/namespace/main.jsonnet:3:19-34     thunk <inventory>
        /Users/john.dewey/git/kapitan/examples/kubernetes/components/namespace/main.jsonnet:4:11-20     thunk <p>
        /Users/john.dewey/git/kapitan/examples/kubernetes/components/namespace/main.jsonnet:7:36        thunk <name>
        /Users/john.dewey/git/kapitan/examples/kubernetes/lib/kube.libjsonnet:463:49-53 thunk <name>
        /Users/john.dewey/git/kapitan/examples/kubernetes/lib/kube.libjsonnet:52:23-27  object <anonymous>
        /Users/john.dewey/git/kapitan/examples/kubernetes/lib/kube.libjsonnet:52:15-29  object <anonymous>
        /Users/john.dewey/git/kapitan/examples/kubernetes/lib/kube.libjsonnet:(50:15)-(55:6)    object <anonymous>
        /Users/john.dewey/git/kapitan/examples/kubernetes/components/namespace/main.jsonnet:7:21-48     object <anonymous>
        During manifestation

Compile error: failed to compile target: busybox

~/git/kapitan/examples/kubernetes master
.venv ❯ kapitan --version
0.29.3

** If it's a bug (please complete the following information):**

  • python --version:
    Python 3.8.5
  • pip3 --version:
    pip 20.1.1 from /Users/john.dewey/git/kapitan/.venv/lib/python3.8/site-packages/pip (python 3.8)
  • Are you using pyenv or virtualenv?
    pyenv
@retr0h
Copy link
Author

retr0h commented Oct 29, 2020

Oddly works just fine if I use the docker container.

~/git/kapitan/examples/kubernetes master 12s
.venv ❯ docker run -t --rm -v $(pwd):/src:delegated deepmind/kapitan compile
Compiled busybox (0.32s)
Compiled labels (0.33s)
Compiled minikube-nginx-jsonnet (0.22s)
Compiled minikube-nginx-kadet (0.13s)
Compiled removal (0.01s)
Compiled minikube-mysql (0.40s)
Compiled minikube-es (0.98s)
Compiled all-glob (1.27s)
~/git/kapitan/examples/kubernetes master
.venv ❯ docker run -t --rm -v $(pwd):/src:delegated deepmind/kapitan --version
0.29.3

@uberspot uberspot added the bug label Oct 30, 2020
@ramaro
Copy link
Member

ramaro commented Nov 3, 2020

Thanks for reporting @retr0h
How did you install kapitan? Using pip or straight from master?

@retr0h
Copy link
Author

retr0h commented Nov 3, 2020

How did you install kapitan? Using pip or straight from master?

Pip

@roman8422
Copy link
Contributor

I'm getting the same error straight from master.
Here are steps to reproduce:

$ git clone https://github.com/deepmind/kapitan.git
$ cd kapitan
$ virtualenv venv
created virtual environment CPython3.8.6.final.0-64 in 443ms

$ source venv/bin/activate
$ pip install -r requirements.txt
$ git submodule update --init
Submodule 'kapitan/reclass' (https://github.com/kapicorp/reclass.git) registered for path 'kapitan/reclass'

$ cd examples/docker/
$ ../../bin/kapitan compile

Jsonnet error: failed to compile /Users/roman/temp/repos/kapitan/examples/docker/components/jsonnet/jsonnet.jsonnet:
 RUNTIME ERROR: 'NoneType' object has no attribute 'inventory_path'
	/Users/roman/temp/repos/kapitan/kapitan/lib/kapitan.libjsonnet:9:59-100	function <anonymous>
	/Users/roman/temp/repos/kapitan/examples/docker/components/jsonnet/jsonnet.jsonnet:2:19-34	thunk <inventory>
	/Users/roman/temp/repos/kapitan/examples/docker/components/jsonnet/jsonnet.jsonnet:6:15-24	thunk <a>
	/Users/roman/temp/repos/kapitan/examples/docker/components/jsonnet/jsonnet.jsonnet:(4:1)-(7:2)	function <anonymous>
	/Users/roman/temp/repos/kapitan/examples/docker/components/jsonnet/jsonnet.jsonnet:(4:1)-(7:2)

Compile error: failed to compile target: docker

@roman8422
Copy link
Contributor

roman8422 commented Dec 24, 2020

Compile works in version 0.29.2 and is broken in 0.29.3 and 0.29.4
Looks like something was broken in 6d23e00

@roman8422
Copy link
Contributor

roman8422 commented Jan 15, 2021

Works for me again. Was fixed in 6d8c91c.
Thanks @ramaro!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants