chaos-mesh
                                
                                
                                
                                    chaos-mesh copied to clipboard
                            
                            
                            
                        "syntax error: invalid arithmetic operator" in `install.sh`
Bug Report
What version of Kubernetes are you using?
  ~ ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── at ⎈ minikube with strrl@giu at  14:04:06
❯ kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.1", GitCommit:"3ddd0f45aa91e2f30c70734b175631bec5b5825a", GitTreeState:"archive", BuildDate:"2022-05-27T18:33:09Z", GoVersion:"go1.18.2", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.3", GitCommit:"816c97ab8cff8a1c72eccca1026f7820e93e0d25", GitTreeState:"clean", BuildDate:"2022-01-25T21:19:12Z", GoVersion:"go1.17.6", Compiler:"gc", Platform:"linux/amd64"}
  ~ ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── with strrl@giu at  14:04:07
❯ minikube version
minikube version: v1.25.2
commit: 362d5fdc0a3dbee389b3d3f1034e8023e72bd3a7-dirty
What version of Chaos Mesh are you using?
❯ k -n chaos-testing exec chaos-controller-manager-bc4b9bf7b-gkch2  -- /usr/local/bin/chaos-controller-manager -version
Controller manager Version: version.Info{GitVersion:"master-gbb58c2efcf6942", GitCommit:"bb58c2efcf69421cf332947c051fa6e336ab4990", BuildDate:"2022-06-07T18:04:46Z", GoVersion:"go1.18", Compiler:"gc", Platform:"linux/amd64"}
What did you do?
minikube startcurl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash
What did you expect to see?
Chaos Mesh installed, no warning, no error.
What did you see instead?
Chaos Mesh installed but with warning:
main: line 651: ((: 10#1.24.1 > 10#1.12.0: syntax error: invalid arithmetic operator (error token is ".24.1 > 10#1.12.0")
main: line 655: ((: 10#1.24.1 < 10#1.12.0: syntax error: invalid arithmetic operator (error token is ".24.1 < 10#1.12.0")
main: line 651: ((: 10#1.23.3 > 10#1.12.0: syntax error: invalid arithmetic operator (error token is ".23.3 > 10#1.12.0")
main: line 655: ((: 10#1.23.3 < 10#1.12.0: syntax error: invalid arithmetic operator (error token is ".23.3 < 10#1.12.0")
Output of chaosctl
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 21 days
This still exists:
curl -sSL https://mirrors.chaos-mesh.org/v2.4.2/install.sh | sh  
sh: line 647: 10#1.25.4 > 10#1.12.0: syntax error: invalid arithmetic operator (error token is ".25.4 > 10#1.12.0")
sh: line 651: 10#1.25.4 < 10#1.12.0: syntax error: invalid arithmetic operator (error token is ".25.4 < 10#1.12.0")
sh: line 647: 10#1.24.3 > 10#1.12.0: syntax error: invalid arithmetic operator (error token is ".24.3 > 10#1.12.0")
sh: line 651: 10#1.24.3 < 10#1.12.0: syntax error: invalid arithmetic operator (error token is ".24.3 < 10#1.12.0")
Install Chaos Mesh chaos-mesh
^C
It results in some issues with the CA not being trusted:
k apply -f latency-chaos.yaml                                    
Error from server (InternalError): error when creating "latency-chaos.yaml": Internal error occurred: failed calling webhook "mnetworkchaos.kb.io": failed to call webhook: Post "https://chaos-mesh-controller-manager.chaos-mesh.svc:443/mutate-chaos-mesh-org-v1alpha1-networkchaos?timeout=5s": x509: certificate signed by unknown authority (possibly because of "x509: cannot verify signature: insecure algorithm SHA1-RSA (temporarily override with GODEBUG=x509sha1=1)" while trying to verify candidate authority certificate "chaos-mesh-controller-manager.chaos-mesh.svc")
                                    
                                    
                                    
                                
/remove stale
https://stackoverflow.com/questions/4023830/how-to-compare-two-strings-in-dot-separated-version-format-in-bash#comment41113351_4025065
This issue only happens on mac?(I faced the same issue on mac
This still exists:
curl -sSL https://mirrors.chaos-mesh.org/v2.4.2/install.sh | sh sh: line 647: 10#1.25.4 > 10#1.12.0: syntax error: invalid arithmetic operator (error token is ".25.4 > 10#1.12.0") sh: line 651: 10#1.25.4 < 10#1.12.0: syntax error: invalid arithmetic operator (error token is ".25.4 < 10#1.12.0") sh: line 647: 10#1.24.3 > 10#1.12.0: syntax error: invalid arithmetic operator (error token is ".24.3 > 10#1.12.0") sh: line 651: 10#1.24.3 < 10#1.12.0: syntax error: invalid arithmetic operator (error token is ".24.3 < 10#1.12.0") Install Chaos Mesh chaos-mesh ^CIt results in some issues with the CA not being trusted:
k apply -f latency-chaos.yaml Error from server (InternalError): error when creating "latency-chaos.yaml": Internal error occurred: failed calling webhook "mnetworkchaos.kb.io": failed to call webhook: Post "https://chaos-mesh-controller-manager.chaos-mesh.svc:443/mutate-chaos-mesh-org-v1alpha1-networkchaos?timeout=5s": x509: certificate signed by unknown authority (possibly because of "x509: cannot verify signature: insecure algorithm SHA1-RSA (temporarily override with GODEBUG=x509sha1=1)" while trying to verify candidate authority certificate "chaos-mesh-controller-manager.chaos-mesh.svc")
When I fixed the script issue for myself on mac, it did not fix the certificate issue. I am still trying to figure out how to fix that.
Close this as #3901 is being merged. If you still have problems, feel free to comment again.
This issue exists in windows as well. Enviornment: Minikube
- Installed version =v2.5.1
 
$ curl -sSL https://mirrors.chaos-mesh.org/v2.5.1/install.sh | bash -s main: line 647: ((: 10#1.25.3 > 10#1.12.0: syntax error: invalid arithmetic operator (error token is ".25.3 > 10#1.12.0") main: line 651: ((: 10#1.25.3 < 10#1.12.0: syntax error: invalid arithmetic operator (error token is ".25.3 < 10#1.12.0") main: line 647: ((: 10#1.24.3 > 10#1.12.0: syntax error: invalid arithmetic operator (error token is ".24.3 > 10#1.12.0") main: line 651: ((: 10#1.24.3 < 10#1.12.0: syntax error: invalid arithmetic operator (error token is ".24.3 < 10#1.12.0") Install Chaos Mesh chaos-mesh customresourcedefinition.apiextensions.k8s.io/awschaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/azurechaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/blockchaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/dnschaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/gcpchaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/httpchaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/iochaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/jvmchaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/kernelchaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/networkchaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/physicalmachinechaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/physicalmachines.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/podchaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/podhttpchaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/podiochaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/podnetworkchaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/remoteclusters.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/schedules.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/statuschecks.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/stresschaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/timechaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/workflownodes.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/workflows.chaos-mesh.org created
- Installed version =latest
 
$ curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash Install Chaos Mesh chaos-mesh customresourcedefinition.apiextensions.k8s.io/awschaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/azurechaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/blockchaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/dnschaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/gcpchaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/httpchaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/iochaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/jvmchaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/kernelchaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/networkchaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/physicalmachinechaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/physicalmachines.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/podchaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/podhttpchaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/podiochaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/podnetworkchaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/remoteclusters.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/schedules.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/statuschecks.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/stresschaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/timechaos.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/workflownodes.chaos-mesh.org created customresourcedefinition.apiextensions.k8s.io/workflows.chaos-mesh.org created error: no objects passed to apply
- Installed using helm. Here, chaos-daemon pod is failing
 
$ kubectl get po -n chaos-mesh
NAME READY STATUS RESTARTS AGE chaos-controller-manager-578cd597f7-9f2hz 1/1 Running 0 8m5s chaos-controller-manager-578cd597f7-qqlt7 1/1 Running 0 8m5s chaos-controller-manager-578cd597f7-xlxcc 1/1 Running 0 8m5s chaos-daemon-dvtpr 0/1 CrashLoopBackOff 6 (50s ago) 8m5s chaos-dashboard-54877cfb99-9wvft 1/1 Running 0 8m5s
Trying to reproduce the issue. https://github.com/containerd/containerd/issues/7388
Events: Type Reason Age From Message Normal Scheduled 7m53s default-scheduler Successfully assigned chaos-mesh/chaos-daemon-dvtpr to minikube Normal Pulling 7m52s kubelet Pulling image "ghcr.io/chaos-mesh/chaos-daemon:v2.5.1" Normal Pulled 6m23s kubelet Successfully pulled image "ghcr.io/chaos-mesh/chaos-daemon:v2.5.1" in 1m29.065978101s Normal Created 4m52s (x5 over 6m23s) kubelet Created container chaos-daemon Warning Failed 4m52s (x5 over 6m23s) kubelet Error: failed to create containerd task: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/run/containerd/io.containerd.runtime.v2.task/k8s.io/chaos-daemon/C:/Program Files/Git/run/containerd" to rootfs at "/host-run": stat /run/containerd/io.containerd.runtime.v2.task/k8s.io/chaos-daemon/C:/Program Files/Git/run/containerd: no such file or directory: unknown Normal Pulled 4m52s (x4 over 6m23s) kubelet Container image "ghcr.io/chaos-mesh/chaos-daemon:v2.5.1" already present on machine Warning BackOff 2m50s (x18 over 6m22s) kubelet Back-off restarting failed container
Any help would be much appreciated.
@Imran489 Thanks for the information. I'll check it out in a few days. 🤔
Hi @Imran489 , that's not the same problem with this issue.
It seems the issue is caused by the container runtime, and Chaos Mesh does NOT support Windows now, and Windows Support is not on the roadmap.
I am going to close this issue now.
If you still face the same issue with contained, fell free to create a new issue.
If you think the problem is still similar to the bash syntax problem, feel free to reopen it! Thanks!
Also cc @g1eny0ung
Got it!