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

bug: kubefirst-api exists with status code 2 when trying to port forward #530

Open
linear bot opened this issue Jan 2, 2025 · 1 comment
Open
Labels
bug Something isn't working

Comments

@linear
Copy link

linear bot commented Jan 2, 2025

Below is the log I retrieved from the (previous) pod.

{"level":"info","time":"2025-01-02T22:46:43Z","message":"error loading .env file, using local environment variables"}
{"level":"info","time":"2025-01-02T22:46:43Z","message":"IS_CLUSTER_ZERO is set to true, skipping import cluster logic"}
{"level":"info","time":"2025-01-02T22:46:43Z","message":"Starting kubefirst API..."}
{"level":"warn","time":"2025-01-02T22:47:25Z","message":"no secret found: secrets \"kubefirst-cluster-ci-k1-fbeb9f23-akamai-gh-cf\" not found"}
[GIN] 2025/01/02 - 22:47:25 | 404 |   20.617401ms |    10.244.4.196 | GET      "/api/v1/cluster/ci-k1-fbeb9f23-akamai-gh-cf"
{"level":"warn","time":"2025-01-02T22:47:25Z","message":"no secret found: secrets \"kubefirst-cluster-ci-k1-fbeb9f23-akamai-gh-cf\" not found"}
{"level":"info","time":"2025-01-02T22:47:25Z","message":"cluster ci-k1-fbeb9f23-akamai-gh-cf does not exist, continuing"}
[GIN] 2025/01/02 - 22:47:25 | 202 |   29.084448ms |    10.244.4.196 | POST     "/api/v1/cluster/ci-k1-fbeb9f23-akamai-gh-cf"
{"level":"warn","time":"2025-01-02T22:47:25Z","message":"no secret found: secrets \"kubefirst-secret\" not found"}
{"level":"warn","time":"2025-01-02T22:47:25Z","message":"authentication secret not found, proceeding without it, using in-memory credentials"}
{"level":"warn","time":"2025-01-02T22:47:25Z","message":"no secret found: secrets \"kubefirst-cluster-ci-k1-fbeb9f23-akamai-gh-cf\" not found"}
{"level":"info","time":"2025-01-02T22:47:25Z","message":"cluster record doesn't exist, continuing"}
[GIN] 2025/01/02 - 22:47:35 | 200 |   15.991039ms |    10.244.4.196 | GET      "/api/v1/cluster/ci-k1-fbeb9f23-akamai-gh-cf"
...
panic: close of closed channel

goroutine 1042 [running]:
k8s.io/client-go/tools/portforward.(*PortForwarder).forward(0xc00148c4d0)
        /go/pkg/mod/k8s.io/[email protected]/tools/portforward/portforward.go:232 +0x186
k8s.io/client-go/tools/portforward.(*PortForwarder).ForwardPorts(0xc00148c4d0)
        /go/pkg/mod/k8s.io/[email protected]/tools/portforward/portforward.go:204 +0x259
github.com/konstructio/kubefirst-api/internal/k8s.PortForwardPod({_, _}, {0xc00245bd48, {{{0x0, 0x0}, {0x0, 0x0}}, {{0x430d271, 0x7}, {0x0, ...}, ...}, ...}, ...})
        /build/internal/k8s/portForward.go:142 +0x778
github.com/konstructio/kubefirst-api/internal/k8s.PortForwardPodWithRetry({_, _}, {0xc00245bd48, {{{0x0, 0x0}, {0x0, 0x0}}, {{0x430d271, 0x7}, {0x0, ...}, ...}, ...}, ...})
        /build/internal/k8s/portForward.go:69 +0xa6
github.com/konstructio/kubefirst-api/internal/k8s.OpenPortForwardPodWrapper.func1()
        /build/internal/k8s/wrappers.go:46 +0x39
created by github.com/konstructio/kubefirst-api/internal/k8s.OpenPortForwardPodWrapper in goroutine 74
        /build/internal/k8s/wrappers.go:45 +0x2ef

I am using v2.7.9 for charts, I am building Kubefirst CLI from disable-bubbletea branch and main for gitops-template branch. I am not able to use latest/main branch of the CLI due to the bubble-tea issue when running as a sub-process under argo-exec command.

Command I used to invoke kubefirst CLI

 /kubefirst $CLOUD create --ci --git-provider $GIT_HOST --cluster-name "{{ inputs.parameters.prefix }}" \
    --domain-name $DOMAIN \
    --subdomain "{{ inputs.parameters.prefix }}" \
    --alerts-email [email protected] \
    --github-org $GITHUB_ORG \
    --gitops-template-branch "{{ inputs.parameters.gitops-template-branch }}" \
    --gitops-template-url https://github.com/konstructio/gitops-template \
    --dns-provider $DNS_PROVIDER \
    --cloud-region $REGION 

{{ inputs.parameters.prefix }}" and "{{ inputs.parameters.gitops-template-branch }}" are substituted before the command is run.

@linear linear bot added the bug Something isn't working label Jan 2, 2025
Copy link
Author

linear bot commented Jan 2, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

0 participants