first install sealer run. exception. failed to execute command (exit status 127) containerd.sh: 19: [: !=: unexpected operator
What happen?
failed to exec init.sh: failed to execute command(cd /var/lib/sealer/data/my-cluster/rootfs && chmod +x scripts/* && cd scripts && bash init.sh /var/lib/docker sea.hub 5000) on host(192.168.64.25): error(exit status 127)
Relevant log output?
root@k1:/var/lib/sealer/data/my-cluster/rootfs/scripts# sealer run registry.cn-qingdao.aliyuncs.com/sealer-io/kubernetes:v1.24.3 --masters 192.168.64.25 --passwd 123456 -d
2022-08-17 22:10:59 [INFO] [local.go:287] Start to create a new cluster: master [192.168.64.25], worker []
2022-08-17 22:10:59 [DEBUG] [default_image.go:75] image registry.cn-qingdao.aliyuncs.com/sealer-io/kubernetes:v1.24.3 already exists
2022-08-17 22:10:59 [DEBUG] [default_image.go:75] image registry.cn-qingdao.aliyuncs.com/sealer-io/kubernetes:v1.24.3 already exists
2022-08-17 22:10:59 [DEBUG] [overlay2.go:103] mount data : index=off,lowerdir=/var/lib/sealer/data/overlay2/edeb93e1005eb81bef35aafa048eff337a781a65cb33b25606f390f8b91b2232:/var/lib/sealer/data/overlay2/1870986e7317c85f22ccb1519a33b16f134b97bde00b9c985a9f955b00d2c4d4:/var/lib/sealer/data/overlay2/b67cb993f07cdfac7673fcece89740323ab142b71d1c1af2574c7dd257ea62b7:/var/lib/sealer/data/overlay2/52c1cab459eb5772d06c7edc112e491d5e2d849c1b9681f830641ed78ed21ccf:/var/lib/sealer/data/overlay2/2faaf95d04fb05b51cbbd55450cd950939d38ba4be7dc70c05b9c980d987f10a:/var/lib/sealer/data/overlay2/47edf033f3b0097f0e236e3d78d8e1cfde5b004f5f4ffbf9c1588efecae4a3d4:/var/lib/sealer/data/overlay2/f0d4eebf98b7587464d0fb29d8c397ed2a7bf0e37bc3f756d3f99b42d4a98498:/var/lib/sealer/data/overlay2/53f77280189e81b46989a78c618063862973348c3b6d1192050c44d8ea53e2f3,upperdir=/var/lib/sealer/data/my-cluster/mount/linux_arm64_v8/upper,workdir=/var/lib/sealer/data/my-cluster/mount/linux_arm64_v8/work
2022-08-17 22:10:59 [DEBUG] [registry.go:139] show registry info, IP: 192.168.64.25, Domain: sea.hub
2022-08-17 22:10:59 [DEBUG] [config.go:74] clusterfile config is empty!
2022-08-17 22:10:59 [DEBUG] [registry.go:139] show registry info, IP: 192.168.64.25, Domain: sea.hub
2022-08-17 22:10:59 [DEBUG] [registry.go:139] show registry info, IP: 192.168.64.25, Domain: sea.hub
2022-08-17 22:10:59 [DEBUG] [scp.go:142] local copy files src /var/lib/sealer/data/my-cluster/mount/linux_arm64_v8/Kubefile to dst /var/lib/sealer/data/my-cluster/rootfs/Kubefile
2022-08-17 22:10:59 [DEBUG] [scp.go:142] local copy files src /var/lib/sealer/data/my-cluster/mount/linux_arm64_v8/Metadata to dst /var/lib/sealer/data/my-cluster/rootfs/Metadata
2022-08-17 22:10:59 [DEBUG] [scp.go:142] local copy files src /var/lib/sealer/data/my-cluster/mount/linux_arm64_v8/README.md to dst /var/lib/sealer/data/my-cluster/rootfs/README.md
2022-08-17 22:10:59 [DEBUG] [scp.go:142] local copy files src /var/lib/sealer/data/my-cluster/mount/linux_arm64_v8/bin to dst /var/lib/sealer/data/my-cluster/rootfs/bin
2022-08-17 22:10:59 [DEBUG] [scp.go:142] local copy files src /var/lib/sealer/data/my-cluster/mount/linux_arm64_v8/cri to dst /var/lib/sealer/data/my-cluster/rootfs/cri
2022-08-17 22:10:59 [DEBUG] [scp.go:142] local copy files src /var/lib/sealer/data/my-cluster/mount/linux_arm64_v8/etc to dst /var/lib/sealer/data/my-cluster/rootfs/etc
2022-08-17 22:10:59 [DEBUG] [scp.go:142] local copy files src /var/lib/sealer/data/my-cluster/mount/linux_arm64_v8/images to dst /var/lib/sealer/data/my-cluster/rootfs/images
2022-08-17 22:10:59 [DEBUG] [scp.go:142] local copy files src /var/lib/sealer/data/my-cluster/mount/linux_arm64_v8/lib64 to dst /var/lib/sealer/data/my-cluster/rootfs/lib64
2022-08-17 22:10:59 [DEBUG] [scp.go:142] local copy files src /var/lib/sealer/data/my-cluster/mount/linux_arm64_v8/manifests to dst /var/lib/sealer/data/my-cluster/rootfs/manifests
2022-08-17 22:10:59 [DEBUG] [scp.go:142] local copy files src /var/lib/sealer/data/my-cluster/mount/linux_arm64_v8/scripts to dst /var/lib/sealer/data/my-cluster/rootfs/scripts
2022-08-17 22:10:59 [DEBUG] [scp.go:142] local copy files src /var/lib/sealer/data/my-cluster/mount/linux_arm64_v8/statics to dst /var/lib/sealer/data/my-cluster/rootfs/statics
2022-08-17 22:10:59 [DEBUG] [sshcmd.go:114] failed to execute command(cd /var/lib/sealer/data/my-cluster/rootfs && chmod +x scripts/* && cd scripts && bash init.sh /var/lib/docker sea.hub 5000) on host(192.168.64.25): error(failed to execute command(cd /var/lib/sealer/data/my-cluster/rootfs && chmod +x scripts/* && cd scripts && bash init.sh /var/lib/docker sea.hub 5000) on host(192.168.64.25): error(exit status 127))
Usage:
sealer run [flags]
Examples:
create cluster to your bare metal server, appoint the iplist:
sealer run kubernetes:v1.19.8 --masters 192.168.0.2,192.168.0.3,192.168.0.4 \
--nodes 192.168.0.5,192.168.0.6,192.168.0.7 --passwd xxx
specify server SSH port :
All servers use the same SSH port (default port: 22):
sealer run kubernetes:v1.19.8 --masters 192.168.0.2,192.168.0.3,192.168.0.4 \
--nodes 192.168.0.5,192.168.0.6,192.168.0.7 --port 24 --passwd xxx
Different SSH port numbers exist:
sealer run kubernetes:v1.19.8 --masters 192.168.0.2,192.168.0.3:23,192.168.0.4:24 \
--nodes 192.168.0.5:25,192.168.0.6:25,192.168.0.7:27 --passwd xxx
create a cluster with custom environment variables:
sealer run -e DashBoardPort=8443 mydashboard:latest --masters 192.168.0.2,192.168.0.3,192.168.0.4 \
--nodes 192.168.0.5,192.168.0.6,192.168.0.7 --passwd xxx
Flags:
--cluster-name string set cluster name (default "my-cluster")
--cmd-args strings set args for image cmd instruction
-e, --env strings set custom environment variables
-h, --help help for run
-m, --masters string set count or IPList to masters
-n, --nodes string set count or IPList to nodes
-p, --passwd string set cloud provider or baremetal server password
--pk string set baremetal server private key (default "/root/.ssh/id_rsa")
--pk-passwd string set baremetal server private key password
--port uint16 set the sshd service port number for the server (default port: 22) (default 22)
--provider ALI_CLOUD set infra provider, example ALI_CLOUD, the local server need ignore this
-u, --user string set baremetal server username (default "root")
Global Flags:
--color string set the log color mode, the possible values can be [never always] (default "always")
--config string config file of sealer tool (default is $HOME/.sealer.json)
-d, --debug turn on debug mode
--hide-path hide the log path
--hide-time hide the log time
--log-to-file write log message to disk
-q, --quiet silence the usage when fail
--remote-logger-url string remote logger url, if not empty, will send log to this url
--task-name string task name which will embedded in the remote logger header, only valid when --remote-logger-url is set
2022-08-17 22:10:59 [ERROR] [root.go:70] sealer-v0.8.6: failed to mount rootfs(/var/lib/sealer/data/my-cluster/rootfs): failed to exec init.sh: failed to execute command(cd /var/lib/sealer/data/my-cluster/rootfs && chmod +x scripts/* && cd scripts && bash init.sh /var/lib/docker sea.hub 5000) on host(192.168.64.25): error(exit status 127)
root@k1:/var/lib/sealer/data/my-cluster/rootfs/scripts# cd /var/lib/sealer/data/my-cluster/rootfs && chmod +x scripts/* && cd scripts && bash init.sh /var/lib/docker sea.hub 5000
+ REGISTRY_DOMAIN=sea.hub
+ REGISTRY_PORT=5000
+ chmod -R 755 ../bin/conntrack ../bin/containerd-rootless-setuptool.sh ../bin/containerd-rootless.sh ../bin/crictl ../bin/kubeadm ../bin/kubectl ../bin/kubelet ../bin/nerdctl ../bin/seautil
+ chmod 644 ../bin
+ cp ../bin/conntrack ../bin/containerd-rootless-setuptool.sh ../bin/containerd-rootless.sh ../bin/crictl ../bin/kubeadm ../bin/kubectl ../bin/kubelet ../bin/nerdctl ../bin/seautil /usr/bin
+ chmod a+x containerd.sh
+ sh containerd.sh sea.hub 5000
+ set -e
+ systemctl status containerd
+ [ != 0 ]
containerd.sh: 19: [: !=: unexpected operator
+ pwd
+ dirname /var/lib/sealer/data/my-cluster/rootfs/scripts
+ rootfs=/var/lib/sealer/data/my-cluster/rootfs
+ image_dir=/var/lib/sealer/data/my-cluster/rootfs/images
+ dump_config_dir=/var/lib/sealer/data/my-cluster/rootfs/etc/dump-config.toml
+ mkdir -p /etc/containerd
+ sed -i s/sea.hub/sea.hub/g /var/lib/sealer/data/my-cluster/rootfs/etc/dump-config.toml
+ sed -i s/5000/5000/g /var/lib/sealer/data/my-cluster/rootfs/etc/dump-config.toml
+ containerd --config /var/lib/sealer/data/my-cluster/rootfs/etc/dump-config.toml config dump
containerd.sh: 46: containerd: not found
What you expected to happen?
containerd.sh
if [ $(systemctl status containerd > /dev/null 2>&1; echo $?) != 0 ]; then. (这行报错)
tar -xvzf ../cri/containerd.tar.gz -C /
cp -rf ../lib64/lib* /usr/lib64/
systemctl enable containerd.service
systemctl restart containerd.service
fi
How to reproduce it (as minimally and precisely as possible)?
No response
Anything else we need to know?
first run
What is the version of Sealer you using?
{"gitVersion":"v0.8.6","gitCommit":"884513e","buildDate":"2022-07-12 03:00:22","goVersion":"go1.16.15","compiler":"gc","platform":"linux/arm64"}
What is your OS environment?
NAME="Ubuntu" VERSION="20.04.4 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.4 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal
What is the Kernel version?
Linux k1 5.4.0-124-generic #140-Ubuntu SMP Thu Aug 4 02:27:01 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
Other environment you want to tell us?
- Cloud provider or hardware configuration:
- Install tools: sealer 0.8.6.
- Others:
install command : sealer run registry.cn-qingdao.aliyuncs.com/sealer-io/kubernetes:v1.24.3 --masters 192.168.64.25 --passwd 123456 -d
@kakaZhou719 @justadogistaken When I try to seek the root cause of this issue in repo https://github.com/sealerio/basefs , I found that I cannot get the corresponding files. And actually we have not planned the version policy for basefs.
I think we had better version every basefs in sealer's released binary very well. Then when end user ran into issues, we could quickly find the corresponding version of basefs and find the root cause.
https://github.com/sealerio/sealer/issues/1646
@bxvs888 , The reason for this problem should be the cloudimage, and we will re-update those cloudimages at the end of this month.
OK