Tag Archives: The server

[Solved] WSL error: wslregisterdistribution failed with error: 0x800701bc

1. Introduction

For the new computer, WSL has installed Ubuntu. When entering Ubuntu, an error occurs

WslRegisterDistribution failed with error: 0x800701bc

2. Solution

This is because the wsl2 kernel is not updated

Enter the administrator permission command line, WSL — update

wsl --update
Checking for updates...
Downloading updates...
Installing the update...
This change will take effect the next time WSL is fully rebooted. To force a reboot, run "wsl --shutdown".
Kernel version: 5.10.60.1

Then force restart

wsl --shutdown

Linux Connect Error: network.service failed [How to Solve]

Today, you can’t connect the virtual machine with finalshell. Later, you can modify the static IP address and restart the network.service.failed, display failed to start LSB: bring up/do...

Solution:

    1. Stop the NetworkManager service
systemctl stop NetworkManager
systemctl  disable NetworkManager
    1. Restart the network
systemctl restart network 

[Solved] Rsync synchronization Error: @ERROR: Unknown module xxx

Scenario:

Push files from server a to server B

Error message

@ERROR: Unknown module ‘xxx’

rsync error: error starting client-server protocol (code 5) at main. c(1649) [sender=3.1.6]

Finally, it is found that the default configuration file of Rsync is rsyncd.com under/etc.conf instead of the file rsyncd. In the/etc/rsyncd/folder.conf

Solution 1: directly configure /etc/rsyncd.conf file, the operation steps are omitted.

Solution 2:

(1) Modify VIM /lib/SYSTEMd/system/rsyncd.service,

The following is the configuration content

[Unit]
Description=fast remote file copy program daemon
ConditionPathExists=/etc/rsyncd/rsyncd.conf

[Service]
EnvironmentFile=/etc/sysconfig/rsyncd
ExecStart=/usr/bin/rsync --config=/etc/rsyncd/rsyncd.conf  --daemon --no-detach "$OPTIONS"

[Install]
WantedBy=multi-user.target

(2) Reload the background process and restart the Rsync service to synchronize.

systemctl daemon-reload

systemctl restart rsyncd

Related commands:

Systemctl daemon reload daemon

Systemctl restart rsyncd restart synchronization service

Systemctl start rsyncd# start

Systemctl stop rsyncd stop

systemctl status rsyncd. Service view Rsync status

PS aux | grep Rsync | viewing process

CentOS 8: No URLs in mirrorlist error [How to Solve]

Question:

In CentOS 8, there is an error using yum. There is no URL in the image list, similar to the following:

Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

reason:

On January 31, 2022, the CentOS team finally removed all packages of CentOS 8 from the official image.

CentOS 8 has expired on December 31, 2021, but the software package has been retained on the official image for some time. Now they are transferred to https://vault.centos.org

Solution:

If you still need to run CentOS 8, you can run it in/etc/yum repos. Update the source in D. Use vault.centos.Org instead of mirror.centos.org.

sudo sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-*
sudo sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-*

Essentially, it replaces the previous URL with the URL that is still running. This problem should be solved within this period of time.

[Solved] Linux Error: ENOSPC: System limit for number of file watchers

Problem:
System: Ubuntu 18
problem scenario: when using react scaffold to write a case, the command NPM start is unsuccessful, and an error: enospc: system limit for number of file watchers occurs.

Solution:
error: enospc: system limit for number of file watchers error is that the system of the file monitor has a limit and reaches the default upper limit, so the limit needs to be increased
you can use the instruction $cat/proc/sys/FS/inotify/max_user_watch to see

root@:~$ cat /proc/sys/fs/inotify/max_user_watch
es
524288

New instructions can be set for temporary limit increase:

$ sudo sysctl fs.inotify.max_user_watches=524288
$ sudo sysctl -p

Permanent increase limit

$ echo fs.inotify.max_user_watches = 524288 | sudo tee -a /etc/sysctl.conf 
$ sudo sysctl -p

[Solved] Linux shell Script Error: syntax error near unexpected token `do

[problem] the error content reported by the Linux server running the shell script is shown in the following figure.

[reason] incompatible carriage return and line feed characters under Linux and windows

[solution] change the windows newline character “CR lf” in the file to UNIX “LF”

Use Notepad + + to set the view first -> Display symbol -> When all symbols are displayed, you will see “CR lf”

Edit -> with Notepad + +; Document format conversion -> Convert to UNIX (LF)

Re-run to solve the problem.

[Solved] Ubuntu: su Switch root Error: Authentication failure

[Ubuntu] solve the problem of error reporting when switching root with Su: authentication failure user authentication failure

Question:

Authentication failure occurs when Ubuntu uses Su to switch root. Authentication fails

Error reporting reason:

Because the Ubuntu system does not activate the root user by default, you need to activate it manually and then use the Su command

Solution:

Enter the following code to set the root password

sudo passwd root

How to Solve “RIP Address Out Of Range” Error

When restarting Windows Server 2008 R2, you see this error on the HP ProLiant} dl388 Gen 9 server. The error may display several messages that do not mean much to you, such as:

X64 exception type 0d – General protection exception

Rip address out of range

RIP Address Out Of Range

This error was seen when Windows Server 2008 R2 was restarted

To resolve this error, disable the following settings in the BIOS:

UEFI optimization startup

Linux: How to Solve vim ~/.bashrc Execute Error

1. If you want to add environment variables under Linux, execute VIM ~/The bashrc command has the following error:

2. Execute sudo apt update first to see what happens

3. Execute sudo apt install — reinstall command not found

4. Finally, execute sudo sudo chmod -R o+r /var/lib/command-not-found/ to successfully solve the problem!

[Solved] ××: error while loading shared libraries: ××.so.19: cannot open shared object file: No such file or directory

××: error while loading shared libraries: ××. so. 19: cannot open shared object file: No such file or directory

When starting some programs, the corresponding link library could not find a solution

[root@feng1 build]# ttyd --help
ttyd: error while loading shared libraries: libwebsockets.so.19: cannot open shared object file: No such file or directory
[root@feng1 build]# ttyd --help
ttyd: error while loading shared libraries: libjson-c.so.5: cannot open shared object file: No such file or directory

This means that the program needs libwebsockets.so.19 and libjson-c.so.5 the functions in the two dynamic link libraries can not be found in the corresponding directory. The dynamic link library under Linux is composed of LD So is responsible for loading, and his configuration file is in etc/LD.so.conf , it is found that there is really no ××.So file under/usr/local/lib configured, we can manually add the specified path to solve the error problem

/environment/libwebsockets/build/lib		## libwebsockets.so.19
/cpack/json-c/build					## libjson-c.so.5

Then refresh the cache and run it again

[root@feng1 build]# sudo ldconfig		

[root@feng1 build]# ttyd --help
ttyd is a tool for sharing terminal over the web

USAGE:
    ttyd [options] <command> [<arguments...>]

VERSION:
    1.6.3-3e37e33

OPTIONS:
    -p, --port              Port to listen (default: 7681, use `0` for random port)
    -i, --interface         Network interface to bind (eg: eth0), or UNIX domain socket path (eg: /var/run/ttyd.sock)
    -c, --credential        Credential for basic authentication (format: username:password)
    -H, --auth-header       HTTP Header name for auth proxy, this will configure ttyd to let a HTTP reverse proxy handle authentication
    -u, --uid               User id to run with
    -g, --gid               Group id to run with
    -s, --signal            Signal to send to the command when exit it (default: 1, SIGHUP)
    -w, --cwd               Working directory to be set for the child program
    -a, --url-arg           Allow client to send command line arguments in URL (eg: http://localhost:7681?arg=foo&arg=bar)
    -R, --readonly          Do not allow clients to write to the TTY
    -t, --client-option     Send option to client (format: key=value), repeat to add more options
    -T, --terminal-type     Terminal type to report, default: xterm-256color
    -O, --check-origin      Do not allow websocket connection from different origin
    -m, --max-clients       Maximum clients to support (default: 0, no limit)
    -o, --once              Accept only one client and exit on disconnection
    -B, --browser           Open terminal with the default system browser
    -I, --index             Custom index.html path
    -b, --base-path         Expected base path for requests coming from a reverse proxy (eg: /mounted/here, max length: 128)
    -P, --ping-interval     Websocket ping interval(sec) (default: 5)
    -S, --ssl               Enable SSL
    -C, --ssl-cert          SSL certificate file path
    -K, --ssl-key           SSL key file path
    -A, --ssl-ca            SSL CA file path for client certificate verification
    -d, --debug             Set log level (default: 7)
    -v, --version           Print the version and exit
    -h, --help              Print this text and exit

Visit https://github.com/tsl0922/ttyd to get more information and report bugs.
[root@feng1 build]#

[Solved] Error: ER_ACCESS_DENIED_ERROR: Access denied for user ‘root’@‘localhost’ (using password: YES)

Add the port number when configuring the server file

// Create the connection of database
const mysql=require('mysql')
const db=mysql.createPool({
  host:'127.0.0.1',
  port:'3307',
  user:'root',
  password:'admin123',
  database:'my_db'
})
module.exports=db

When creating a table, check the ID and increment options

After Vue is packaged to the server, the static resource path reports an error

The error reporting path is:
http: domain name/CSS/XX css

In fact, it should be:
http: domain name/dist/CSS/XX/CSS

Method:
ensure that the value of publicpath is: publicpath: ‘. /’

ps:config.js or Vue-config.js file, according to the actual situation, if the editor cannot be found, search publicpath globally