Category Archives: Linux

[Solved] Please clean your repository working tree before checkout

Write down a git error:  please clean your repository working tree before checkout

This error is reported if you want to refresh the code. Analysis is not added or submitted after modification.

If you think there may be a code conflict, you add the code first, submit it, and then pull it. After pushing, no error is found,

Add first, submit and then perform subsequent operations

The GIT add command writes the contents to the staging area

The GIT commit command adds the contents of the staging area to the local repository. Git commit – M [message]

 

Restore previous version

There are two operations to restore the previous version

git reset

Restore to a previously submitted version, and delete all submitted versions after that version. We don’t want it

git revert

Is to undo a previous version, keep all subsequent versions, and generate a new version,

 

The general workflow of Git is as follows:

1.Clone the GIT resource as the working directory.

2.Add or modify files on cloned resources.

3.If someone else changes it, you can update the resource.

4.View changes before submitting.

5.Submit changes.

6.After the modification is completed, if an error is found, the submission can be withdrawn and modified and submitted again.

[Solved] k8s-nfs pvc load error –nfs-client-provisioner

k8s mount nfs problem.

Error 1:
Please install on all k8s node nodes:
yum -y install nfs-utils
Error 2:
kubectl logs nfs-client-provisioner-59fd564b9b-zkpbn
Kubernetes PVC has been in Pending state
unexpected error getting claim reference: selfLink was empty, can’t make reference
Temporary solution:
1.20.4 version, solution
/etc/kubernetes/manifests/kube-apiserver.yaml add “–feature-gates=RemoveSelfLink=false”
Solution-use version v4.0.x
Use nfs-client-provisioner: v4.0.1 here
Related documents: https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner/issues/25
Use easzlab/nfs-subdir-external-provisioner:v4.0.1 directly here

[Solved] Project compile error After Install less-loader: Typeerror: this getOptions is not a function

Error:
TypeError: this.getOptions is not a function

Analysis of problems:

In fact, the version of less loader is too high and incompatible with getoptions function methods, so it is necessary to downgrade less loader

Problem-solving:

Uninstall the original version of less loader through the NPM uninstall less loader command,

Then install less through NPM- [email protected] Command to download the downgraded version of less loader. This problem can be solved

[Solved] Git Error: failed: authentication failed for ‘http: XXXX.git / ”

When you enter the user name and password incorrectly in the clone on git, the window for entering the user name and password will no longer pop up automatically. The errors are as follows:

fatal: Authentication failed for 'http:xxxx.git/''

After some Baidu found a solution, just input

git config --system --unset credential. helper

Then press enter, enter the URL of GIT clone copy, and then press enter

At this time, the command line will appear asking for the user name, then enter your git user name and press enter

Next, a small window will pop up, prompting you to enter your password, enter your git password, and click OK

Could not open lock file/var/lib/dpkg/lock [How to Solve]

Today, when installing redis in Ubuntu, the following error occurred when executing the apt get - y install redis server command:

E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

Possible causes:

The apt get command was used to install a resource before, but terminal was closed before the installation was completed. When it was opened again, another process was occupying the apt get install process. Because the system lock during software source update will be occupied during operation, an error will be reported.

Solution, run the following four commands in sequence:

sudo rm -rf /var/lib/dpkg/lock
sudo rm -rf /var/cache/apt/archives/lock
sudo apt-get update
sudo dpkg --configure -a

[Solved] was server Upgrade log4j to 2.17.0 error

Because log4j has a jndi vulnerability, the company needs to upgrade log4j to version 2.17.0. After the upgrade, the local test is no problem, but the following error is reported when it is not in the test environment:

com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl scanJAR unable to open input stream for resource log4j-core-2.17.0.jar

 

Modify the amm.filter.properties file under the /opt/IBM/WebSphere/AppServer/properties file

Add the corresponding jar in Ignore-Scanning-Archives or add the corresponding package path in Ignore-Scanning-Packages to eliminate scanning to solve the problem.

The corresponding class file under these two attributes can be modified when there is no annotation.

Linux format System Disk error [How to Solve]

#Background

When the hard disk has a system, the format prompt indicates that the system cannot format

Input: mkfs ext4 /dev/nvme0n1

Error reporting:/dev/nvme0n1 is appropriate in use by the system; will not make a filesystem here!

#Solution

Prompt that/dev/sdk1 is in use/ Dev/sdk1 is being managed by DM, so when we create the file system, we will be prompted with an error. We can manually remove it to create the file system normally. The operation is as follows:

Check:
dmsetup status

Clear:
dmsetup remove_all

Check:
dmsetup status

Execute the command: mkfs.ext4 /dev/nvme0n1

How to Solve Nginx error: 403 Forbidden

Today, I tested nginx access on my virtual machine, and the results were 403 Forbidden

First check whether there is a missing index in the nginx configuration file HTML or index PHP files, files are normal

Check the SELinux status of the server. The configuration file/etc/SELinux/config and SELinux = disabled are also correct

Then check the log information:/usr/local/nginx/logs/error log

The display is caused by permission problems. View the main configuration file of nginx/usr/local/nginx/conf/nginx conf

After changing the user to root, restart nginx # systemctl restart nginx Service access is effective

Summary: there are three common situations causing nginx access error 403 Forbidden: lack of index file, permission problem and SELinux status

It can be successfully modified according to specific problems.