helm / helm

The Kubernetes Package Manager
https://helm.sh
Apache License 2.0
27k stars 7.11k forks source link

Helm fails with error github.com/docker/cli/cli/config.load #11285

Closed aaktaev closed 1 year ago

aaktaev commented 2 years ago

Helm fails with error:

-> os.system("helm version --short --client")
(Pdb) n
WARNING: open /config.json: input/output error
/config.json
github.com/docker/cli/cli/config.load
    github.com/docker/cli@v20.10.17+incompatible/cli/config/config.go:138
github.com/docker/cli/cli/config.Load
    github.com/docker/cli@v20.10.17+incompatible/cli/config/config.go:111
oras.land/oras-go/pkg/auth/docker.NewClientWithDockerFallback
    oras.land/oras-go@v1.2.0/pkg/auth/docker/client.go:86
helm.sh/helm/v3/pkg/registry.NewClient
    helm.sh/helm/v3/pkg/registry/client.go:83
main.newRootCmd
    helm.sh/helm/v3/cmd/helm/root.go:152
main.main
    helm.sh/helm/v3/cmd/helm/helm.go:66
runtime.main
    runtime/proc.go:255
runtime.goexit
    runtime/asm_amd64.s:1581

Output of helm version:

version.BuildInfo{Version:"v3.9.4", GitCommit:"dbc6d8e20fe1d58d50e6ed30f09a04a77e4c68db", GitTreeState:"clean", GoVersion:"go1.17.13"}

Output of kubectl version:

Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.12", GitCommit:"b058e1760c79f46a834ba59bd7a3486ecf28237d", GitTreeState:"clean", BuildDate:"2022-07-13T14:59:18Z", GoVersion:"go1.16.15", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.11-gke.400", GitCommit:"b4e1ab06be827438def8aee0021791b413a0961d", GitTreeState:"clean", BuildDate:"2022-06-24T09:27:38Z", GoVersion:"go1.16.15b7", Compiler:"gc", Platform:"linux/amd64"}

Cloud Provider/Platform (AKS, GKE, Minikube etc.): gcp,azure,aws

yxxhero commented 2 years ago
WARNING: open /config.json: input/output error

your disk may has issue. dmesg -T to check it.

aaktaev commented 2 years ago

@yxxhero , disk is ok, it shows docker/config.json in b64 enc , I've didn't paste it here in the output error.

aaktaev commented 2 years ago

Here is the way how helm is used:

  1. There is docker container with kubctl, helmsman , helm and other tools
  2. There are python code which launches rendered helmsman file, and when helmsman starts, it fails that it can't recognize helm version.
  3. Charts are located on filesystem which is mounted to docker container
aaktaev commented 2 years ago

With helm=3.7.2 it works fine. But we would like to upgrade helm to 3.9.4

aaktaev commented 2 years ago

we are not pulling or pushing anything by helm

yxxhero commented 2 years ago

@yxxhero can you show the /config.json permission and content?

aaktaev commented 2 years ago

The most interesting thing, that when docker container starts - there is no any docker/config.json file . It somehow shows config.json (it is variable )which will be passed to our chart (and will be used in secret)to be able to pull images from private registries;

{"auths": {"$$$$$$$": {"auth": "$$$$$$$", "email": "$$$$$$", "password": "$$$$$$$", "username": "admin"}, "registry.gitlab.com": {"auth": "$$$$$", "email": "not@val.id", "password": "$$$$$$", "username": "$$$$$$"}, "$$$$$$": {"auth": "$$$$$", "email": "$$$$$$$", "password": "$$$$", "username": "$$$$$"}}}
yxxhero commented 2 years ago

@aaktaev can you share your docker image or dockerfile.

aaktaev commented 2 years ago

FROM ubuntu:20.04

ENV HELM_VERSION=3.9.4 \
    TERRAFORM_VERSION=0.15.5 \
    KUBECTL_VERSION=1.22.12 \
    AWS_IAM_AUTHENTICATIOR=0.4.0 \
    VAULT_VERSION=0.7.3 \
    STERN_VERSION=1.10.0 \
    HELMSMAN_VERSION=3.14.0 \
    PYTHON_PIP_VERSION=21.1.2 \
    KUSTOMIZE_VERSION=4.3.0 \
    YQ_VERSION=4.13.2 \
    KREW_VERSION=0.4.3 \
    DEBIAN_FRONTEND="noninteractive" \
    TZ="Etc"

RUN apt-get update && \
    apt-get install -yq git curl wget unzip python3-pip apt-transport-https \
                    netcat iputils-ping gettext jq vim bash-completion lsb-release\
                    dnsutils ca-certificates software-properties-common pacman\
    && curl -fsSL https://download.docker.com/linux/ubuntu/gpg |  apt-key add - && \
    add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && \
    apt-get update -y && apt-get install docker-ce -y \
    && apt-get clean && \
    apt-get purge && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /tmp
# Install CloudNuke
RUN wget "https://github.com/gruntwork-io/cloud-nuke/releases/download/v0.1.12/cloud-nuke_linux_amd64" && \
    chmod +x cloud-nuke_linux_amd64 && \
    mv cloud-nuke_linux_amd64 /usr/local/bin/cloud-nuke

# Install Helmsman
RUN wget "https://github.com/Praqma/helmsman/releases/download/v${HELMSMAN_VERSION}/Helmsman_${HELMSMAN_VERSION}_linux_amd64.tar.gz" -O helmsman.tar.gz && \
    tar -zxvf helmsman.tar.gz && \
    rm helmsman.tar.gz && \
    mv helmsman /opt/helmsman && \
    chmod 755 /opt/helmsman

# Install Kustomize
RUN wget "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz" -O kustomize.tar.gz && \
    tar -zxvf kustomize.tar.gz && \
    rm -f kustomize.tar.gz && \
    mv kustomize /opt/kustomize && \
    chmod 755 /opt/kustomize

# Install Terraform
RUN wget "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip" -O terraform.zip && \
    unzip terraform.zip && \
    rm terraform.zip && \
    mv terraform /opt/terraform && \
    chmod 755 /opt/terraform

# Install Stern
RUN wget "https://github.com/wercker/stern/releases/download/${STERN_VERSION}/stern_linux_amd64" -O /opt/stern && \
    chmod 755 /opt/stern

# Install Vault
RUN wget "https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip" -O vault.zip && \
    unzip vault.zip && \
    rm vault.zip && \
    mv vault /opt/vault && \
    chmod 755 /opt/vault

# Install Kubectl
RUN wget "https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl" -O /opt/kubectl && \
    chmod 755 /opt/kubectl

# Install Kubectl exec user
RUN git clone https://github.com/mikelorant/kubectl-exec-user.git /opt/kubectl-exec-user && \
    cd /opt/kubectl-exec-user && \
    ./install.sh && \
    echo "source <(kubectl completion bash)" >> ~/.bashrc

# Install k9s

RUN wget "https://github.com/derailed/k9s/releases/download/v0.26.3/k9s_Linux_x86_64.tar.gz" -O k9s.tar.gz && \
    tar xzvf k9s.tar.gz && \
    rm LICENSE && \
    rm k9s.tar.gz && \
    rm README.md && \
    mv k9s /opt/k9s && \
    chmod 755 /opt/k9s

# Install Google CLI
RUN export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" && \
    echo "deb http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
    curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \
    apt-get update -y && \
    apt-get install google-cloud-sdk -yq

RUN mkdir -p /root/.config/gcloud/configurations

# Install AWS IAM authenticator
RUN wget https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v${AWS_IAM_AUTHENTICATIOR}/aws-iam-authenticator_${AWS_IAM_AUTHENTICATIOR}_linux_amd64 -O /opt/aws-iam-authenticator && \
    chmod 755 /opt/aws-iam-authenticator

COPY config.template /root/.kube

# Better vim configuration
COPY .vimrc /root/.vimrc

COPY bashrc-ps .

RUN echo "source /etc/profile.d/bash_completion.sh" >> /root/.bashrc && \
    echo "alias k='kubectl'" >> /root/.bashrc && \
    echo "alias dcc='python3 deployer/deploy.py single core-cloud --force'" >> /root/.bashrc && \
    echo "alias dk='python3 deployer/deploy.py single kubernetes --force'" >> /root/.bashrc && \
    echo "alias dka='python3 deployer/deploy.py single kubernetes-apps --force'" >> /root/.bashrc && \
    echo "alias dca='python3 deployer/deploy.py single configure-apps --force'" >> /root/.bashrc && \
    echo "alias da2='python3 deployer/deploy.py single ansible-stage2 --force'" >> /root/.bashrc && \
    cat bashrc-ps >> /root/.bashrc

COPY requirements.txt /tmp/requirements.txt
RUN  pip3 install --upgrade pip==${PYTHON_PIP_VERSION} && \
     pip3 install --upgrade requests && \
     pip3 install --no-cache-dir -r /tmp/requirements.txt

ENV PATH="/opt:${PATH}" \
    LC_ALL=C.UTF-8 \
    LANG=C.UTF-8

# Install azure cli aks-preview extension
RUN /usr/local/bin/az extension add --name aks-preview

# Install krew
RUN curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/download/v${KREW_VERSION}/krew-linux_amd64.tar.gz" && \
    tar zxvf krew-linux_amd64.tar.gz && mv /tmp/krew-linux_amd64 /usr/bin/krew && \
    echo export PATH="/root/.krew/bin:$PATH" >> /root/.bashrc && \
    krew install df-pv exec-cronjob images mtail node-shell pod-dive resource-capacity sniff view-utilization

RUN wget "https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_amd64" -O /opt/yq && \
    chmod 755 /opt/yq

RUN wget "https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz" -O helm.tar.gz && \
    tar -zxvf helm.tar.gz && \
    rm helm.tar.gz && \
    mv linux-amd64/helm /opt/helm && \
    chmod 755 /opt/helm && \
    chown root:root /opt/helm && \
    ln -s /opt/helm /usr/bin/helm && \
    ln -s /opt/helm /usr/local/bin/helm && \
    mkdir -p /root/.helm/plugins && \
    /opt/helm plugin install https://github.com/databus23/helm-diff --version master

# Cleanup
RUN rm -rf /tmp/*

WORKDIR /2021
ENTRYPOINT [ "sh", "/2021/docker/entrypoint.sh" ]
github-actions[bot] commented 1 year ago

This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.