Author Archives: Robins

[Solved] Hive Run SQL error: mapreduce failed to initiate a task

When running sql in hive, mapreduce fails to launch the task, check the log that APPmaster cannot find the hadoop path.
Solution:
Add the following codes in mapred-site.xml, the error will be solved.

<configuration>
<property>
  <name>yarn.app.mapreduce.am.env</name>
  <value>HADOOP_MAPRED_HOME=/opt/apps/hadoop-3.1.1</value>
</property>
<property>
  <name>mapreduce.map.env</name>
  <value>HADOOP_MAPRED_HOME=/opt/apps/hadoop-3.1.1</value>
</property>
<property>
  <name>mapreduce.reduce.env</name>
  <value>HADOOP_MAPRED_HOME=/opt/apps/hadoop-3.1.1</value>
</property>
 
</configuration>

[Solved] Docker Download Mirror Error: Cannot connect to the Docker daemon at…

If you want to download an image with docker, you will report an error

cannot connect to the docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

cause analysis: maybe docker did not exit normally last time, so docker did not start normally, and the docker process could not be found in the corresponding /var/run/ path.

Solution:
enter the command

systemctl start docker.service

Then you can download

[Solved] MySQL Lock error: Lock wait timeout exceeded; try restarting transaction ; Lock wait timeout

The error is as follows:

Lock wait timeout exceeded; try restarting transaction ; Lock wait timeout

Finally, it was found that it was caused by a local debug jam. Just stop it

If a deadlock occurs, you can use the following command to differential lock and kill it

select * from information_schema.innodb_trx

Check Lock WAIT of trx_status field
copy trx_id

kill trx_id

If trx_status is RUNNING, ignore it, it means that the transaction is being executed without locks

[Solved] SSH connect Error: “WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED“

1. Problem description

When testing the connectivity of the host with the Ping module of ansible, the host 192.168.18.80 is pinged for the first time, but there is something wrong with the host. Take it offline, replace it with a new one, and then Ping 192.168.18.80 again. The following error message appears:

[root@server ~]# ansible all -m ping
192.168.18.80 | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nIT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\r\nSomeone could be eavesdropping on you right now (man-in-the-middle attack)!\r\nIt is also possible that a host key has just been changed.\r\nThe fingerprint for the ECDSA key sent by the remote host is\nSHA256:zbEO7l6AqnhvNiZvVoy5KcYGHrn10CJw0ul169LeyHU.\r\nPlease contact your system administrator.\r\nAdd correct host key in /root/.ssh/known_hosts to get rid of this message.\r\nOffending ECDSA key in /root/.ssh/known_hosts:2\r\nPassword authentication is disabled to avoid man-in-the-middle attacks.\r\nKeyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.\r\[email protected]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).",
    "unreachable": true
}

When SSH is used for remote connection, the following error occurs

[root@server ~]# ssh 192.168.18.80
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:zbEO7l6AqnhvNiZvVoy5KcYGHrn10CJw0ul169LeyHU.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:2
ECDSA host key for 192.168.18.80 has changed and you have requested strict checking.
Host key verification failed.

 

2. Cause of problem

The identity of the SSH Remote Connection host is defaultly saved in ~/.ssh/known_hosts, each time you visit, you will check whether the host ID is the same. If not, you will be prompted with an error or warning to prevent man in the middle attacks.

 

3. Solution

Delete the information of the corresponding IP line in ~/.ssh/known_hosts, as shown in the following figure

[root@server ~]# vim  ~/.ssh/known_hosts
192.168.18.99 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGEsej5rHzUx+GX65oiHKfOqDqFP2OdNhb0i80Hns0b2TObWTQMvscKjaryuh2oZbq+Esekhn98HXDNc30aEjzA=
192.168.18.199 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHhaJ4VDE3HxK1AcsHNac4MTjv4IUauTLazQDwgh6lhCIt0qN5Zjj0+rh+isAZYOXdBp4S8K5p/YkTXalmU0CHQ=
192.168.18.80 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHKpwuBsqrI1ogpSvLkJKJpKcXIO49sJJH3gJmykHWOp3cqfekCpXIppiEzhKslxgFEmd971DILXrpPguDEQ3UE=

[Solved] FTP Error: 553 Could not create file

FTP error 553 could not create file

Problem Description:
an error occurs when uploading a file using the FTP put command 553 could not create file

Solution:
1. View the local_root configuration information in the current configuration file.
example:

vim /etc/vsftpd/vsftpd.conf
local_root=/ftpFile

2. Check if there is a directory under local_rootfor the user who is currently logged in to ftp.
example:

[root@master ~]# cd /ftpFile/
[root@master ftpFile]# ll
taotally 0
drwxr-xr-x 2 admin admin 17 Aug   4 23:49 ftpFile

/ftpFile The user of the ftpFile file in the folder is admin, the username used to log in to ftp

3. Note that when using the put command, use the relative path instead of the absolute path, or use the command CD to the FTP file directory.
example:

[root@node01 ~]# ftp 192.168.169.141
Connected to 192.168.169.141 (192.168.169.141).
220 (vsFTPd 3.0.2)
Name (192.168.169.141:root): admin		# use admin to login
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls		# You can use ls to see what files are in the current admin user's directory
227 Entering Passive Mode (192,168,169,141,87,162).
150 Here comes the directory listing.
drwxr-xr-x    2 1006     1006           17 Aug 04 15:49 ftpFile
226 Directory send OK.
ftp> put /home/diffUserFile.txt ftpFile/1111	# When using put to upload files, you can use absolute paths locally, and relative paths on the ftp side, but using absolute paths will report an error
local: /home/diffUserFile.txt remote: ftpFile/1111
227 Entering Passive Mode (192,168,169,141,128,45).
150 Ok to send data.
226 Transfer complete.
24 bytes sent in 9.1e-05 secs (263.74 Kbytes/sec)
ftp> 

or

[root@node01 ~]# ftp 192.168.169.141
Connected to 192.168.169.141 (192.168.169.141).
220 (vsFTPd 3.0.2)
Name (192.168.169.141:root): admin		# use admin to login
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd /ftpFile/		# Use the cd command to enter the ftp specified directory
250 Directory successfully changed.
ftp> lcd /home		# Use lcd to go to the local file path
Local directory now /home
ftp> put diffUserFile.txt 2222		# This way it can all be done with relative paths
local: diffUserFile.txt remote: 2222
227 Entering Passive Mode (192,168,169,141,202,165).
150 Ok to send data.
226 Transfer complete.
24 bytes sent in 7.6e-05 secs (315.79 Kbytes/sec)
ftp> 

[Solved] IDEA jsp File Error: pageContext.setAttribute(“APP_PATH“,request.getContextPath());

IDEA jsp file report an error:

pageContext.setAttribute(“APP_PATH“,request.getContextPath())

 

Solution: import the jar package

<!-- https://mvnrepository.com/artifact/javax.servlet/jsp-api -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>

How to Solve Yolov5 Common Error (Three Errors)

1. detect.py run error: IndexError: list index out of range Reason: Path error
Solution: Add r in front of the path
before the path

2.subprocess.CalledProcessError: Command ‘git tag‘ returned non-zero exit status

Solution: open the python environment and find the subprocess.py in Lib, change the check value to False in line 415.

My path is D:\Miniconda3\envs\pytorch\Lib

3.UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xb2 in position 6:invalidstartbyte

Solution: in line 58 of the torch_utils.py file, modify the original decode() to decode(encoding = ‘gbk’)

[Solved] arco design vite-plugin-style-import Load menu-item error: Internal server error…

According to Arco design tutorial on the official website

Load components on demand by manual import

Solution:

Change the official website example to the following. The exclude array is the component name without CSS. If you are not clear about the component name, you can print console.log of the resolveStyle function:

createStyleImportPlugin({
      libs: [
        {
          libraryName: '@arco-design/web-vue',
          esModule: true,
          resolveStyle: (name) => {
            const exclude = ['menu-item']
            if (exclude.includes(name)) return ''
            // css
            return `@arco-design/web-vue/es/${name}/style/css.js`
          },
        },
      ],
    }),

Error message

 [vite] Internal server error: Failed to resolve import "D:/Programing/WebstormProjects/cow-Low-code/node_modules/@arco-design/web-vue/es/menu-item/style/css.js" from "src\views\HomeView.vue". Does the file exist?

[Solved] mongodump Error: assertion: 2 { ok: 0.0, errmsg: “Auth mechanism not specified”, code: 2, codeName: “BadValue”…

Mongodump error

assertion: 2 { ok: 0.0, errmsg: “Auth mechanism not specified”, code: 2, codeName: “BadValue”, operationTime: Timestamp 1573815888000|1, $clusterTime: { clusterTime: Timestamp 1573815888000|1,

reason

It is caused by the lower version of mongodump. You need to uninstall the default Yum source installation version and reinstall the new version.

System default installation version: 2. X
requirement Version (support cluster version): 4. X

terms of settlement:

create a file

/etc/yum.repos.d/mongodb-org-4.0.repo

[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc

Installation configuration

yum install -y mongodb-org

How to Solve Vue add element Install Error

Install element normally

Just enter

vue add element

However, the following errors may occur:

If the error report shows that it is a node-sass problem, change the second option to no, that is, do not introduce the SCSS of element

Perfect solution

But remember to add the following code to the main file later:

import ‘element-ui/lib/theme-chalk/display.css’

It is to directly introduce the CSS of the element

Linux: How to Solve pyperclip Module Error

When pyperclip is used, the error message is as follows:

xclip needs to be installed
Step 1: install the epel repository

# yum install epel-release.noarch
             or
# dnf install epel-release

Step 2: install xclip from the EPEL repository

# dnf install xclip
Last metadata expiration check: 0:06:09 ago on Mon 07 Feb 2022 10:39:39 AM IST.
Dependencies resolved.
=============================================================================================================================================================
 Package                             Architecture                         Version                                   Repository                          Size
=============================================================================================================================================================
Installing:
 xclip                               x86_64                               0.13-8.el8                                epel                                35 k

Transaction Summary
=============================================================================================================================================================
Install  1 Package

After installation, you can use the pyperclip module normally.

How to Solve Visual Studio C4996 Error

Follow the path VisualStudio\Common7\IDE\VC to find the folder VCProjectItems:

Right click to grant access permission -> Specific user

Click “share”

Enter the folder VCProjectsItems and open the file newc++file.cpp with Notepad. Paste the following into the file and save:

#define _CRT_SECURE_NO_WARNINGS 1

Right-click the folder VCProjectItems and click Properties -> Share -> Advanced sharing, click “share this folder” to uncheck it, and click “apply” and “OK”.

This will solve the problem. Create a new C/C + + file in vs. you can see the following code on the first line:

#define _CRT_SECURE_NO_WARNINGS 1

​​​​​​​

In this way, no error will be reported when using functions such as scanf(), printf().