Author Archives: Robins

[Solved] Node Connect MYSQL Error: Client does not support authentication protocol requested by server; consider upgrading MySQL client

Client does not support authentication protocol requested by server; consider upgrading MySQL client

Database connection failed,

Execute in MySQL window

 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '密码';

The code then:

flush privileges;

Reload permission table operation. Run the JS file again to successfully connect to the MySQL database.

Linux Files Save Error: E325: ATTENTION [How to Solve]

Error Messages:

E325: ATTENTION
Found a swap file by the name “.server.properties.swp”
owned by: root dated: Thu Jan 1 12:02:39 2022
file name: /server.properties
modified: YES
user name: root host name: wang.localdomain
process ID: 10718 (still running)
While opening file “server.properties”
dated: Thu Jan 1  12:02:39 2022
(1) Another program may be editing the same file. If this is the case,
be careful not to end up with two different instances of the same
file when making changes. Quit, or continue with caution.
(2) An edit session for this file crashed.
Error: If this is the case, use “:recover” or “vim -r server.properties”
to recover the changes (see “:help recovery”).
Error: If you did this already, delete the swap file “.server.properties.swp”
to avoid this message.

 

Solution:

First use (individual tutorials have said that the deleted files are in the root directory, at least I didn’t find them)
ls -a
to see if there is a .swp file that opens with an error
For example, the one I opened with an error was server.properties
In this file directory use ls -a

Then use rm -f

Then the error report disappears.

[Solved] Jenkins Run python Project Error: “ModuleNotFoundError: No module named ‘xxx‘”

At runtime, jekins will take all folder paths of the current project as the search path of the package, while the command line only searches the current path by default.

Error message: modulenotfounderror: no module named ‘xxx’#

Solution:

Configure environment variables in jekins: system management → system settings (global settings and paths)

1.Global properties check Environment variables
2.Add new key-value pairs
Key:PYTHONPATH
Value:/var/lib/jenkins/workspace/project name

jenkins+sonar-scanner Scan Error: Failed to find ‘typescript’ module.Please check, NODE_PATH contains location of global ‘typescript’ or install locally in your project

Step: Jenkins sends out the task and uses the shell script to trigger the sonar scanner scan. report errors:

Failed to find ‘typescript’ module. Please check, NODE_ PATH contains location of global ‘typescript’ or install locally in your project

After trying for a day, it was finally solved. The method is as follows:

Premise: nodejs is installed.

1. Install typescript globally (I installed it. When I only installed the global separately, the task issued by Jenkins still reported an error. This step may be useless or useful. But I did, so it’s safer to record it).

Online installation method: NPM install – G typescript

————————————————————-

Offline installation method: first find a machine that can connect to the Internet and dig the package download address: the command is NPM info typescript Copy the tarball connection in the output and download it with the browser.

Copy to the sonar scanner machine, NPM install – G typescript-4.5.4.tgz

2. Locally install typescript (this step is very important and the key to success)

The path to execute the sonar scanner command (!! note here that it must be the path used to execute this command)

NPM install typescript (in offline mode, it is NPM install typescript-4.5.4.tgz. You will find that it will get stuck after running. If it’s OK, just exit. Three files node_modules. Package.json package-lock.json will appear in the directory)

Sudo Jenkins switches users and runs the sonar scanner command to see if there is still an error. If no error is reported, Copy the three JSON files (node_modules. package.json. package-lock.) into a new folder under rook.

The shell script in the Jenkins task reads as follows:

cd ${WORKSPACE}
sudo cp -r /root/workspace_bk/node_modules/ .
sudo cp -r /root/workspace_bk/package.json .
sudo cp -r /root/workspace_bk/package-lock.json .
sudo sonar-scanner ....

JAVA api Access HDFS Error: Permission denied in production environment

An error occurs when the Java API accesses the HDFS file system without specifying the access user

        //1. Create the object of hadoop configuration
//        Configuration conf = new Configuration();
        Configuration conf = new Configuration();
        conf.set("fs.defaultFS","hdfs://linux121:9000");
        //2. Create the object of hadoop FileSystem
//        FileSystem fileSystem = FileSystem.get(new URI("hdfs://linux121:9000"), conf, "root");
        FileSystem fileSystem = FileSystem.get(conf);
        //3. Create the files
        fileSystem.mkdirs(new Path("/tp_user"));
        //4. Close
        fileSystem.close();

The following error messages appear:

org.apache.hadoop.security.AccessControlException: Permission denied: user=QI, access=WRITE, inode="/":root:supergroup:drwxr-xr-x
	at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.check(FSPermissionChecker.java:350)
	at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkPermission(FSPermissionChecker.java:251)
	at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkPermission(FSPermissionChecker.java:189)
	at org.apache.hadoop.hdfs.server.namenode.FSDirectory.checkPermission(FSDirectory.java:1753)
	at org.apache.hadoop.hdfs.server.namenode.FSDirectory.checkPermission(FSDirectory.java:1737)
	at org.apache.hadoop.hdfs.server.namenode.FSDirectory.checkAncestorAccess(FSDirectory.java:1696)
	at org.apache.hadoop.hdfs.server.namenode.FSDirMkdirOp.mkdirs(FSDirMkdirOp.java:60)
	at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirs(FSNamesystem.java:2990)
	at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.mkdirs(NameNodeRpcServer.java:1096)
	at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.mkdirs(ClientNamenodeProtocolServerSideTranslatorPB

If the access name is not specified, the default is to use the current system user name for access, and an error will be reported if the permission is insufficient. The access permission of HDFS user is weak, which can not prevent bad people from doing bad things!!

In the case of production, there are three solutions:

Specify the user information to obtain the file system object and close the HDFS cluster permission verification

Turn off HDFS cluster permission verification

vim hdfs-site.xml
#Add the following properties
<property>
<name>dfs.permissions</name>
<value>true</value>
</property>

Based on the weak characteristics of HDFS permissions, we can completely give up HDFS permission verification. If we are in a production environment, we can consider using Kerberos, sentry and other security frameworks to manage the security of big data clusters. Therefore, we directly modify the root directory permission of HDFS to 777

hadoop fs -chmod -R 777 /

adb: failed to install Magisk-v23.0.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install com.topjohnwu.magisk without first uninstalling.]

adb android magisk error: adb: failed to install Magisk-v23.0.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install com.topjohnwu.magisk without first uninstalling.]

C:\Users\16613\Desktop\shuaji8.1>adb install Magisk-v23.0.apk
adb: failed to install Magisk-v23.0.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install com.topjohnwu.magisk without first uninstalling.]

C:\Users\16613\Desktop\shuaji8.1>adb install -r C:\Users\16613\Desktop\shuaji8.1\Magisk-v23.0.apk
Success

When using ADB install to install APK, a version has been installed on the device. If you install it again, the installation will fail. The following prompt message appears: install_FAILED_ALREADY_EXISTS

In this case, simply add – r to the command to overwrite the installation:

ADB install – r your APK full path

IDEA Could Not pull Codes to Local Error: Can’t Update No tracked branch configured for branch master or the branch doesn’t exist.

When you pull your own code to the local area, you can’t pull it alive or dead, and an error message appears:

Can't Update
No tracked branch configured for branch master or the branch doesn't exist.
To make your branch track a remote branch call, for example,
git branch --set-upstream-to=origin/master master 

Reason: there are many explanations on the Internet. In short, I don’t know the pull, but I only have a project branch. Because it is a personal project, I didn’t make a branch, which is very outrageous.

Solution:

Open the GIT window under the project directory and enter

git branch --set-upstream-to=origin/master

Attached with reference to the old man’s original station:

Can’t update no tracked branch configured for branch master or the branch

Prompt can’t update no tracked branch configured for branch when solving git update_u012556114

IAR contains unknown tools [How to Solve]

There are three files under IAR project to describe the project, with suffixes respectively .eww, .ewp, .ewd:

.eww  –> IAR · EWARM workspace file, which describes the projects contained in the workspace;

.ewd   –> C-spy debugger project setting file;

.ewp   –> IAR # EWARM project file, which contains all the configuration information about the project;

So if the following error occurs

“The project ‘…’ contains the unknown tools ‘Coder’  ”

We need to revise it The EWP file, for example, the unknown tool here is’ coder ‘. After opening the file, we find the following line:

<settings>
<name>Coder</name>
<archiveVersion>0</archiveVersion>
<data/>
</settings>

(Note: if you can’t find the upper line in the .EWP file, you can find it in the .EWD file)

Delete the above lines, repeat the search for the above lines containing ‘coder’, delete them all, and save the modifications.

Reopen the project, OK, and no more errors will be reported.

WARNING: POSSIBLE DNS SPOOFING DETECTED [How to Solve]

Everything was fine. Suddenly one day, an error was reported with git push :

WARNING: POSSIBLE DNS SPOOFING DETECTED!

The above errors are generally caused by the migration of the company’s Git warehouse, resulting in ip changes. There is a known_hostsfile in the git directory that stores the connected domain name and the corresponding ip. Every time there is a remote operation, it will verify whether the information in it matches, and the warehouse is migrated. known_hostsThe domain name and ip in the latter file must not match, so the above error will occur. The easiest way is to delete known_hoststhe domain name and the information behind it or empty the file.

: > ~/.ssh/known_hosts

Don’t forget the previous : number, and then re-verify the connection

ssh -T [email protected]

be accomplished!