Tag Archives: The server

[Solved] Sshd startup error: Failed at step CGROUP spawning /usr/sbin/sshd: No space left on device

sshd restart error:
systemctl restart sshd.service
The screenshot is as following:

Error Messages:

Failed at step CGROUP spawning /usr/sbin/sshd: No space left on device
Failed to create cgroup /system.slice/sshd.service: No such file or directory

 

The reason for this is that the cgroup is not mounted.

Solution:
Mount the cgroup directory
mount -t tmpfs cgroup_root /sys/fs/cgroup
umount -t tmpfs cgroup_root /sys/fs/cgroup
umount /sys/fs/cgroup

then restart to connect normally
systemctl start sshd.service

Node Kubelet Error: node “xxxxx“ not found [How to Solve]

11月 05 10:58:35 localhost.localdomain kubelet[974]: E1105 10:58:35.108952     974 kubelet.go:2412] "Error getting node" err="node "localhost.localdomain" not found"
11月 05 10:58:35 localhost.localdomain kubelet[974]: E1105 10:58:35.209293     974 kubelet.go:2412] "Error getting node" err="node "localhost.localdomain" not found"
11月 05 10:58:35 localhost.localdomain kubelet[974]: E1105 10:58:35.310543     974 kubelet.go:2412] "Error getting node" err="node "localhost.localdomain" not found"
11月 05 10:58:35 localhost.localdomain kubelet[974]: E1105 10:58:35.411121     974 kubelet.go:2412] "Error getting node" err="node "localhost.localdomain" not found"
11月 05 10:58:35 localhost.localdomain kubelet[974]: E1105 10:58:35.511949     974 kubelet.go:2412] "Error getting node" err="node "localhost.localdomain" not found"
11月 05 10:58:35 localhost.localdomain kubelet[974]: E1105 10:58:35.612822     974 kubelet.go:2412] "Error getting node" err="node "localhost.localdomain" not found"
11月 05 10:58:35 localhost.localdomain kubelet[974]: E1105 10:58:35.713249     974 kubelet.go:2412] "Error getting node" err="node "localhost.localdomain" not found"
11月 05 10:58:35 localhost.localdomain kubelet[974]: E1105 10:58:35.781263     974 controller.go:144] failed to ensure lease exists, will retry in 7s, error: leases.coordination.k8s.io "localhost.localdomain" is forbidden: User "system:node:k8s222" cannot get resource "leases" in API group "coordination.k8s.io" in the namespace "kube-node-lease": can only access node lease with the same name as the requesting node
11月 05 10:58:35 localhost.localdomain kubelet[974]: E1105 10:58:35.813355     974 kubelet.go:2412] "Error getting node" err="node "localhost.localdomain" not found"
11月 05 10:58:35 localhost.localdomain kubelet[974]: E1105 10:58:35.913495     974 kubelet.go:2412] "Error getting node" err="node "localhost.localdomain" not found"

1.1 this node is always notready

[root@crust-m01 ~]# kubectl get node
NAME        STATUS     ROLES                  AGE   VERSION
k8s220   NotReady   control-plane,master   44d   v1.21.3
k8s221   NotReady   <none>                 44d   v1.21.3
k8s222   NotReady   <none>                 44d   v1.21.3

1.2 view details of this node

[root@localhost ~]# kubectl describe node k8s221


……
Unschedulable:      false
Lease:
  HolderIdentity:  k8s221
  AcquireTime:     <unset>
  RenewTime:       Tue, 28 Sep 2021 14:37:08 +0800
Conditions:
  Type             Status    LastHeartbeatTime                 LastTransitionTime                Reason              Message
  ----             ------    -----------------                 ------------------                ------              -------
  MemoryPressure   Unknown   Tue, 28 Sep 2021 14:32:16 +0800   Tue, 28 Sep 2021 14:38:17 +0800   NodeStatusUnknown   Kubelet stopped posting node status.
  DiskPressure     Unknown   Tue, 28 Sep 2021 14:32:16 +0800   Tue, 28 Sep 2021 14:38:17 +0800   NodeStatusUnknown   Kubelet stopped posting node status.
  PIDPressure      Unknown   Tue, 28 Sep 2021 14:32:16 +0800   Tue, 28 Sep 2021 14:38:17 +0800   NodeStatusUnknown   Kubelet stopped posting node status.
  Ready            Unknown   Tue, 28 Sep 2021 14:32:16 +0800   Tue, 28 Sep 2021 14:38:17 +0800   NodeStatusUnknown   Kubelet stopped posting node status.
……

1.3 view kubelet logs on this node

[root@crust-m2 ~]# service kubelet status -l
Redirecting to /bin/systemctl status  -l kubelet.service
● kubelet.service - kubelet: The Kubernetes Node Agent
   Loaded: loaded (/usr/lib/systemd/system/kubelet.service; enabled; vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/kubelet.service.d
           └─10-kubeadm.conf
   Active: active (running) since 二 2021-09-28 14:51:57 CST; 4min 6s ago
     Docs: https://kubernetes.io/docs/
 Main PID: 21165 (kubelet)
    Tasks: 19
   Memory: 43.0M
   CGroup: /system.slice/kubelet.service
           └─21165 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml --network-plugin=cni --pod-infra-container-image=registry.aliyuncs.com/google_containers/pause:3.4.1

9月 28 14:56:03 crust-m2 kubelet[21165]: E0928 14:56:03.119645   21165 kubelet.go:2291] "Error getting node" err="node "crust-m2" not found"
9月 28 14:56:03 crust-m2 kubelet[21165]: E0928 14:56:03.220694   21165 kubelet.go:2291] "Error getting node" err="node "crust-m2" not found"
9月 28 14:56:03 crust-m2 kubelet[21165]: E0928 14:56:03.321635   21165 kubelet.go:2291] "Error getting node" err="node "crust-m2" not found"
9月 28 14:56:03 crust-m2 kubelet[21165]: E0928 14:56:03.385100   21165 eviction_manager.go:255] "Eviction manager: failed to get summary stats" err="failed to get node info: node "crust-m2" not found"
9月 28 14:56:03 crust-m2 kubelet[21165]: E0928 14:56:03.422387   21165 kubelet.go:2291] "Error getting node" err="node "crust-m2" not found"
9月 28 14:56:03 crust-m2 kubelet[21165]: E0928 14:56:03.523341   21165 kubelet.go:2291] "Error getting node" err="node "crust-m2" not found"
9月 28 14:56:03 crust-m2 kubelet[21165]: E0928 14:56:03.624021   21165 kubelet.go:2291] "Error getting node" err="node "crust-m2" not found"
9月 28 14:56:03 crust-m2 kubelet[21165]: E0928 14:56:03.724418   21165 kubelet.go:2291] "Error getting node" err="node "crust-m2" not found"
9月 28 14:56:03 crust-m2 kubelet[21165]: E0928 14:56:03.825475   21165 kubelet.go:2291] "Error getting node" err="node "crust-m2" not found"
9月 28 14:56:03 crust-m2 kubelet[21165]: E0928 14:56:03.926199   21165 kubelet.go:2291] "Error getting node" err="node "crust-m2" not found"

2. [troubleshooting]

The startup command of log output in 1.3 is as follows:

/usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml --network-plugin=cni --pod-infra-container-image=registry.aliyuncs.com/google_containers/pause:3.4.1

 

There is no problem viewing and analyzing all configuration files in the startup command

The error err = "node" localhost. Output in 1.3 was found localdomain "Not found
the information of kubectl get node on the master is k8s220, k8s221, k8s222

conclusion
when kubernetes was installed before, the name of the master was k8s220, and the node was k8s221, k8s222, because /etc/hostname was written as localhost.localdomain by default, kubelet has always been report errors

3. [modification]

Modify the hostname file, execute the hostname command, modify the server name,

Restart kubelete

Linux useradd Error: Creating mailbox file: File exists

If you get the error Creating mailbox file: File exists when you add a user with useradd under linux

It is possible that userdel xxx did not add -r when deleting the user, so only the user was deleted, but not the user’s configuration file

For example, the path of the configuration file is in /var/spool/mail/xxx

# userdel -r
Usage: userdel [options] LOGIN

Options:
  -f, --force                   force some actions that would fail otherwise
                                e.g. removal of user still logged in
                                or files, even if not owned by the user
  -h, --help                    display this help message and exit
  -r, --remove                  remove home directory and mail spool
  -R, --root CHROOT_DIR         directory to chroot into
  -Z, --selinux-user            remove any SELinux user mapping for the user

Kylin arm64 linux configure: error: cannot guess build type; you must specify one

error

uname -m = aarch64
uname -r = 4.19.90-23.8.v2101.ky10.aarch64
uname -s = Linux
uname -v = #1 SMP Mon May 17 17:07:38 CST 2021

/usr/bin/uname -p = aarch64
/bin/uname -X     = 

hostinfo               = 
/bin/universe          = 
/usr/bin/arch -k       = 
/bin/arch              = aarch64
/usr/bin/oslevel       = 
/usr/convex/getsysinfo = 

UNAME_MACHINE = aarch64
UNAME_RELEASE = 4.19.90-23.8.v2101.ky10.aarch64
UNAME_SYSTEM  = Linux
UNAME_VERSION = #1 SMP Mon May 17 17:07:38 CST 2021
configure: error: cannot guess build type; you must specify one

Solution:

./configure --build=aarch64-unknown-linux

effect

...
checking whether to include histogram support... no
checking whether to include dirty support... no
checking whether to include demo support... no
checking whether to include Unix-domain socket tests... no
checking whether to include DLPI tests... no
checking whether to include DCCP tests... no
checking whether to include OMNI tests... yes
checking whether to include XTI tests... no
checking whether to include SDP tests... no
checking whether to include ICSC-EXS tests... no
checking whether to include SCTP tests... no
checking whether to include paced send (intervals) support... no
checking whether paced sends should spin... no
checking whether to include initial burst support in _RR tests... yes
checking which CPU utilization measurement type to use... "procstat - auto"
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/netperf_version.h
config.status: creating src/Makefile
config.status: creating src/missing/Makefile
config.status: creating src/missing/m4/Makefile
config.status: creating doc/Makefile
config.status: creating doc/examples/Makefile
config.status: creating netperf.spec
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands

Linux Use dtc generate dtb Error: “FATAL ERROR: Unable to parse input tree“

Error: 
linux-5.10>$ dtc -I dts -O dtb arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts -o fsl-ls1046a-rdb.dtb
Error: fsl-ls1046a-rdb.dts:13.1-9 syntax error
FATAL ERROR: Unable to parse input tree

Solution:
linux-5.10>$ export ARCH=arm64
linux-5.10>$ export CROSS_COMPILE=aarch64-linux-gnu-
linux-5.10>$ make defconfig
linux-5.10>$ make dtbs or
linux-5.10>$ make freescale/fsl-ls1046a-rdb.dtb

VScode connect Remote Linux Server Error: Resolver error: Error

Problem Description
When using vscode to connect to a remote linux server ssh login suddenly fails to connect, showing Resolver error: Error

 

Personal solution:

1. Use other remote connection software to log in to the server, the blogger used Tabby
2. Use the command to find your own related processes: ps -ef | grep user_name
3. Find the pid of the process corresponding to .vscode, end the corresponding process: kill -9 $pid
4. vscode reconnect

Note:
For the time being, we do not know the reason for this frequent problem, but the above method can solve the connection failure problem.

Error: error from slirp4netns while setting up port redirection: map[desc:bad request: add_hostfwd:

Causes: accidentally use kill -9 to delete the Podman container running java program process, start the container again with an error

Description of the problem: The problem is because the port is occupied, can not start

Solution: This is because the port is occupied, you can only find out which process is occupying the port through netstat (I am showing the PID/slirp4netns ), and then kill the process number of the occupied port PID with kill -9

[Solved] Ubuntu Install jdk Error: Error occurred during initialization of VM

1. First make sure the environment variables are configured correctly.
2. Then make sure there is tools.pack and rt.pack in the directory where jdk is located, take the directory /usr/java/jdk1.8.0_221-amd64 where jdk1.8.0_221-amd64 is located as an example, make sure there is tools.pack under /usr/java/jdk1.8.0_221-amd64/lib .pack, and make sure that rt.pack is available under /usr/java/jdk1.8.0_221-amd64/jre/lib.
3. Use the tool unpack200 under /usr/java/jdk1.8.0_221-amd64/bin to extract tools.pack and rt.pack to tools.jar and rt.jar respectively,
This is done using the command line as follows.
root@iZbp1260wj4hpl4umpaodkZ:/usr/java/jdk1.8.0_221-amd64/jre/lib# …/bin/unpack200 rt.pack rt.jar
root@iZbp1260wj4hpl4umpaodkZ:/usr/java/jdk1.8.0_221-amd64/lib# …/bin/unpack200 tools.pack tools.jar

[Solved] Ubuntu conda ProxyError: Conda cannot proceed due to an error in your proxy configuration

Using conda install with a proxy may result in the following error:

ProxyError: Conda cannot proceed due to an error in your proxy configuration.
Check for typos and other configuration errors in any ‘.netrc’ file in your home directory,
any environment variables ending in ‘_PROXY’, and any other system-wide proxy
configuration settings.

 

Solution:
Input the command:env | grep -i "_PROXY" and here is the outcome:

HTTP_PROXY=http://http://localhost:8888/
https_proxy=http://http://localhost:8888/
http_proxy=http://http://localhost:8888/
no_proxy=localhost,127.0.0.0/8,::1
NO_PROXY=localhost,127.0.0.0/8,::1
HTTPS_PROXY=http://http://localhost:8888/

Then enter the command unset to delete these agents:

unset  https_proxy
unset  http_proxy
unset  no_proxy
unset  HTTPS_PROXY
unset  HTTP_PROXY
unset  NO_PROXY

Then enter CONDA installation command to solve the problem successfully

[Solved] JAVA Mail Sent Error: Sending the email to the following server failed

Htmlemail uses QQ corporate email to send problem summary

After the local mail sending test is passed according to the parameter information on htmlemail, deploy the service on the ECs to test the mail sending. The first error is reported:

Sending the email to the following server failed : smtp.exmail.qq.com:25

Ping smtp.com directly on the ECS exmail. qq. COM domain name found that the external network on the server is not connected. After opening the external network permission, the above error still exists.
browse the document and try to switch smtpport to port 465:

HtmlEmail.setSmtpPort(465);

Error still reported:

Sending the email to the following server failed : smtp.exmail.qq.com:465
Could not connect SMTP host:smtp.exmail.qq.com, port 465, response: -1

It is found that sslonconnect needs to be set to true when switching to port 465

HtmlEmail.setSSLOnConnect(true);

After modification, the error information is changed to:

Invalid address

Finally, switch smtpport to 587:

HtmlEmail.setSmtpPort(587);

Finally, no error is reported. Record it for review later.