grafana / agent

Vendor-neutral programmable observability pipelines.
https://grafana.com/docs/agent/
Apache License 2.0
1.56k stars 479 forks source link

Tanka init fail #6892

Closed Its-Alex closed 1 month ago

Its-Alex commented 1 month ago

What's wrong?

When I try to use tk init I got an error with k8s-libsonnet:

Steps to reproduce

$ tk init

System information

6.8.8-arch1-1

Software version

Tanka: 2024/05/03 10:40:21 tk version v0.26.0 jb: v0.5.1

Configuration

No response

Logs

$ tk init --log-level trace -f
GET https://github.com/grafana/jsonnet-libs/archive/249e94b853952d0155d3ac4ce17c5fdbd90f779c.tar.gz 200
GET https://github.com/jsonnet-libs/docsonnet/archive/6ac6c69685b8c29c54515448eaca583da2d88150.tar.gz 200
GET https://github.com/jsonnet-libs/k8s-libsonnet/archive/bf9a62cfd32a58c071b8410bfcdec058475dd25e.tar.gz 200
panic: rename /home/itsalex/Documents/tk/vendor/.tmp/28d5d0cf4e0847d16afe3035627683a6750259751/1.20 /home/itsalex/Documents/tk/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.20: no such file or directory

goroutine 1 [running]:
github.com/jsonnet-bundler/jsonnet-bundler/pkg.(*GitPackage).Install(0xc00038e090, {0x829ee8?, 0xc00001c128}, {0xc0000147e0, 0x2a}, {0xc0000147b0, 0x21}, {0x7ffdca18cb5c, 0x4})
        /home/metalmatze/src/github.com/jsonnet-bundler/jsonnet-bundler/pkg/git.go:228 +0x1a9d
github.com/jsonnet-bundler/jsonnet-bundler/pkg.download({{0xc000010500, 0x0}, {0x7ffdca18cb5c, 0x4}, {0x0, 0x0}, 0x0, {0x0, 0x0}}, {0xc0000147b0, ...}, ...)
        /home/metalmatze/src/github.com/jsonnet-bundler/jsonnet-bundler/pkg/packages.go:309 +0x3b1
github.com/jsonnet-bundler/jsonnet-bundler/pkg.ensure(0x20?, {0xc0000147b0, 0x21}, {0x0, 0x0}, 0x0?)
        /home/metalmatze/src/github.com/jsonnet-bundler/jsonnet-bundler/pkg/packages.go:234 +0x61d
github.com/jsonnet-bundler/jsonnet-bundler/pkg.Ensure({0xc0000a5fb0?, 0x0?}, {0xc0000147b0, 0x21}, 0x0?)
        /home/metalmatze/src/github.com/jsonnet-bundler/jsonnet-bundler/pkg/packages.go:55 +0x54
main.installCommand({0xc000018064?, 0x7a64a2?}, {0x79370b, 0x6}, {0xc0000b44c0, 0x3, 0x0?}, 0x0, {0x0, 0x0})
        /home/metalmatze/src/github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb/install.go:85 +0x46d
main.Main()
        /home/metalmatze/src/github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb/main.go:87 +0xd27
main.main()
        /home/metalmatze/src/github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb/main.go:39 +0x19
Installing k.libsonnet: exit status 2
Directory structure set up! Remember to configure the API endpoint:
`tk env set environments/default --server=https://127.0.0.1:6443`
Errors occurred while initializing the project. Check the above logs for details.
jonerrr commented 1 month ago

I ran into the same issue on Fedora 39.

jonerrr commented 1 month ago

Looks like the version 1.20 for k8s-libsonnet doesn't exist anymore in the Github repo. I was able to initialize Tanka successfully by setting the version to 1.29: tk init --k8s=1.29.

Its-Alex commented 1 month ago

I opened https://github.com/jsonnet-libs/k8s/issues/417

dan-os commented 1 month ago

I opened a pull request grafana/tanka#1010 to fix this a while back which has been merged as of today. Hopefully this will be shipped soon. In the meantime, as @jonerrr points out, specifying the --k8s version manually fixes this issue.

Its-Alex commented 1 month ago

I will close since this is not the right repository for this issue