argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
16.97k stars 5.17k forks source link

Unknown command "/usr/local/bin/argocd-server" for "argocd-server" #17090

Closed niklasweimann closed 4 months ago

niklasweimann commented 6 months ago

Describe the bug When the install.yaml manifast is applied there is an invalid argument set for the argocd-server which results in the server failing to start.

To Reproduce

curl https://raw.githubusercontent.com/argoproj/argo-cd/v2.9.6/manifests/install.yaml -o output.yaml
kubectl apply -n argocd -f output.yaml

It seems that the image (quay.io/argoproj/argocd:v2.9.6) already has the entrypoint set to "/usr/local/bin/argocd-server" which results in kubernetes starting the container with "/usr/local/bin/argocd-server /usr/local/bin/argocd-server". This results in an invalid command the container is stuck in a restart loop:

image

Expected behavior Deployment finishes successfully and the server starts without an invalid command error.

Version

quay.io/argoproj/argocd:v2.9.6

Logs

Error: unknown command "/usr/local/bin/argocd-server" for "argocd-server"
2024-02-05T13:32:28.434335159Z Run 'argocd-server --help' for usage.

Workaround Do the following replacement: image

Echarnus commented 6 months ago

Having the same problem by installing it like that in Kubernetes. But initially it does work, it starts occuring after using the --unsafe parameter for ArgoCD Server.

spec:
  template:
    spec:
      containers:
      - name: argocd-server
        command: 
          - argocd-server
          - --insecure
jgwest commented 5 months ago

Incorrect wget usage:

[jgw@localhost-lan test]$ wget https://raw.githubusercontent.com/argoproj/argo-cd/v2.9.6/manifests/install.yaml -o output.yaml
[jgw@localhost-lan test]$ ls
install.yaml  output.yaml
[jgw@localhost-lan test]$ cat output.yaml 
--2024-02-08 13:05:20--  https://raw.githubusercontent.com/argoproj/argo-cd/v2.9.6/manifests/install.yaml
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.108.133, 185.199.111.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1217908 (1.2M) [text/plain]
Saving to: ‘install.yaml’

     0K .......... .......... .......... .......... ..........  4% 1.85M 1s
    50K .......... .......... .......... .......... ..........  8% 3.52M 0s
   100K .......... .......... .......... .......... .......... 12% 12.8M 0s
   150K .......... .......... .......... .......... .......... 16% 12.0M 0s
   200K .......... .......... .......... .......... .......... 21% 3.91M 0s
   250K .......... .......... .......... .......... .......... 25% 18.2M 0s
   300K .......... .......... .......... .......... .......... 29% 15.3M 0s
   350K .......... .......... .......... .......... .......... 33% 14.6M 0s
   400K .......... .......... .......... .......... .......... 37% 18.2M 0s
   450K .......... .......... .......... .......... .......... 42% 19.5M 0s
   500K .......... .......... .......... .......... .......... 46% 17.3M 0s
   550K .......... .......... .......... .......... .......... 50% 14.7M 0s
   600K .......... .......... .......... .......... .......... 54% 38.8M 0s
   650K .......... .......... .......... .......... .......... 58% 24.4M 0s
   700K .......... .......... .......... .......... .......... 63% 14.0M 0s
   750K .......... .......... .......... .......... .......... 67% 50.9M 0s
   800K .......... .......... .......... .......... .......... 71% 40.6M 0s
   850K .......... .......... .......... .......... .......... 75% 18.5M 0s
   900K .......... .......... .......... .......... .......... 79%  273M 0s
   950K .......... .......... .......... .......... .......... 84% 35.8M 0s
  1000K .......... .......... .......... .......... .......... 88% 33.5M 0s
  1050K .......... .......... .......... .......... .......... 92% 36.7M 0s
  1100K .......... .......... .......... .......... .......... 96% 35.8M 0s
  1150K .......... .......... .......... .........            100% 13.4M=0.1s
niklasweimann commented 5 months ago

Sorry, my bad. I wanted to point out the way I am applying the install.yaml file. I am using ansible, but did not want to paste the ansible yaml definitions here, so I used the appropriate linux commands.

When I apply the install.yaml every resource gets created correctly, so I highly doubt the issue is based on the way I apply the install.yaml.

(I will replace wget with curl in the initial post.)

jgwest commented 5 months ago

It seems that the image (quay.io/argoproj/argocd:v2.9.6) already has the entrypoint set to "/usr/local/bin/argocd-server"

Where are you seeing this? https://github.com/argoproj/argo-cd/blob/ba62a0a86d19f71a65ec2b510a39ea55497e1580/Dockerfile#L146

Coder63 commented 4 months ago

Is this still bug ? Any workaround..

jgwest commented 4 months ago

No response and not able to reproduce. Feel free to open a new bug with additional details, if still an issue.

MaxWinterstein commented 1 month ago

I was able to get myself in the same situation, but by walking another path:

The rendered output is running fine on another cluster, and was also deployed via "self-updating". But here it might be updated in smaller steps.

Looking at the diff between those two deployments, working one left, broken one right, I found .Containers.server.Command - which should not be there. Its neither in the official chart, nor in my rendered output. It seems like argocd has "forgotten" to remove them.

image

It started up fine after manually removing .Containers.server.Command from the deployment (k edit deployments.apps argocd-server).

tl;dr;: It seems like argocd has forgotten to remove the .Containers.server.Command that was no longer part of the deployment


The diff argocd shows me, when itself (v2.7.0) should update to v2.11.3:

image