Category Archives: How to Fix

Writing to settings when appium of Xiaomi mobile phone and oppo mobile phone starts requires:android.permission.WRITE_ SECURE_ SETTINGS

Error information:
0 java.lang.SecurityException : Permission denial: writing to settings requires:android.permission.WRITE_ SECURE_ SETTINGS

terms of settlement:

Xiaomi: in the developer options, turn on “USB debugging (security settings)”. Allow USB debugging to modify permissions or simulate clicking

Oppo: in the developer option, turn on “disable permission monitoring”.
Copyright notice: This is the original article of CSDN blogger “revepon”, which follows the CC 4.0 by-sa copyright agreement. Please attach the link of the original source and this notice.
Link to the original text: https://blog.csdn.net/zzwfd/article/details/104005744

Spring cloud Alibaba 2020.0.rc1 does not integrate ribbon error reporting unknownhostexception

The title starts from 3 because other pits have been recorded before

3. Spring cloud Alibaba 2020.0.rc1 does not integrate ribbon error reporting unknownhostexception

3.1 first check whether our notes are correct, and then look at the following

3.2 no ribbon

We can see from the dependency package that spring cloud Alibaba 2020.0.rc1 is not integrated with ribbon, which is not right,

In this version, calling the microservice through resttemplate always prompts that the microservice is not found

3.3 it’s OK to go back to 2.1.4 or manually add the ribbon dependency

When I go back to 2.1.4.release and look at dependency, there is ribbon

The visit is normal

Join ribbon manually

It’s OK, too

Although I don’t know whether to give up the ribbon or forget to add it, I haven’t found any other method and usage to record the time 2021.3.22

org.apache.jasper . jasperexception: unable to compile class for jsp: error resolution

1、 The main reason for this problem is that the version of servlet API does not match the version of Tomcat.

2、 Solutions.
I’m changing the version of Tomcat.
Put the plug-in code below into the pom.xml In the middle.

<!--<build>-->
    <!--<plugins>-->
      <!--<plugin>-->
        <!--<groupId>org.apache.tomcat.maven</groupId>-->
        <!--<artifactId>tomcat7-maven-plugin</artifactId>-->
        <!--<version>2.2</version>-->
        <!--<configuration>-->
          <!--<port>8888</port>-->
        <!--</configuration>-->
      <!--</plugin>-->
    <!--</plugins>-->
  <!--</build>-->

Start with tomcat7: run.

Start with tomcat7.
The problem can be solved.

Fast DFS small demo report error org.csource.common .MyException: getStoreStorage fail, errno code: 2

Title fastdfs error

org.csource.common .MyException: getStoreStorage fail, errno code: 2

solve:

Remove the following problems in turn:

1. Can the virtual machine be pinged

Win + R
CMD + enter
Ping fastdfs server IP address

virtual machine address can be viewed through ifconfig command

2. Is the firewall closed

systemctl stop firewalld.service

3. Check whether the upload address of fastdfs configuration file is IP address

vi /etc/fdfs/ storage.conf

4. Restart the storage service

/etc/init.d/fdfs_ storaged restart

SQL query time group_ Was cut by group_ CONCAT()

 

When querying MySQL database, use group_ “Row XXX was cut by group_ Concat () “, check it out because of group_ There is a limit on the maximum length of concat. If it exceeds the maximum length, it will be truncated,

Let’s check the global environment variables of MySQL

mysql> SELECT @@global.group_concat_max_len;
+-------------------------------+
| @@global.group_concat_max_len |
+-------------------------------+
|                          1024 |
+-------------------------------+

Check the maximum length of the query field in the production environment

mysql> select max(length(extra)) from credit.apply;
+--------------------+
| max(length(extra)) |
+--------------------+
|               9599 |
+--------------------+

Check the maximum number of aggregations again

mysql> select max(c1) from (select custid,count(1) as c1 from  credit.apply group by custid )t;
+---------+
| max(c1) |
+---------+
|      58 |
+---------+

So it is estimated that the maximum possible length is

9599 *58+67=556809

You can change the group_ concat_ max_ Len variable solves the problem

SET group_concat_max_len=556809;

 

MySQL settings group_ concat_ max_ len

 

GROUP_ The concat function is used to connect multiple strings into a string. When splicing into a string, there will be the problem of splicing length. The default splicing length of MySQL is 1024 bytes. Because 1024 bytes will not be enough, sometimes it needs to be modified according to the situation. The method is as follows.

 

1. View the current MySQL group_ concat_ max_ len

Enter the MySQL state and enter: Show variables like ‘group_ concat_ max_ len’;

If it has not been modified, you will get the following result

2. Modify MySQL group_ concat_ max_ len

a) , if it is not convenient to restart mysql, you can set it in the MySQL state through the command, such as:

 
    SET GLOBAL group_ concat_ max_ len = 102400;   SET SESSION group_ concat_ max_ len = 102400;

 

Check through mode 1.

Note: in this way, the configuration file will be read and reset after the restart of MySQL, which will lead to invalid settings, so it is recommended to modify the configuration file

b) , modify configuration file: my.ini

Add a new configuration under [mysqld]: group_ concat_ max_ len = 102400

Restart and view through mode 1.

In particular, sometimes we don’t know how many bytes we need to meet the requirements. In this case, we can consider not setting the maximum number of bytes (that is, using the maximum number of bytes), that is, setting group in the configuration file_ concat_ max_ len=-1

In this case, you can view the results in mode 1 as follows:

Note: 4294967295 = 2 ^ 32 – 1

“Invalid month” in SQL query

Project scenario:

This project is an old one, which is outsourced. As a result, many parts of the development do not pay much attention to the details. There is a field of date type that is designed as integer, which is easy to cause some strange problems.


Problem Description:

In the process of development, I encountered an SQL error in the execution of “invalid month”. I checked the submission record of this file and found that the file was last modified half a year ago, indicating that it was not a SQL problem. That’s the data problem.


Cause analysis:

Preliminary analysis of this issue should date, because there is a function to in SQL_ Date (), most likely a data format.
After putting all the LR_ After replacing the date field with null, we find that SQL can find out the data, which further verifies our conjecture. It’s about the date.
First of all, we suspect that there may be a very large number or a very small number in the date field, but we find that it is not.

And then I fell into meditation.

For example, in December, I doubt whether there will be any unconventional data in this field.

In order to verify this conjecture, we use substr (a, 6, 2) to cut the field, intercept the month, and find out the data of substr (a, 6, 2) & gt; 12.

Finally, find the problem. There is a data 20211301, which leads to this problem.


Solution:

Change the date of abnormal data to normal value.

Docker builds the pit that Seata stepped on. can not connect to services-server

An error is reported when the system starts: can not connect to services server.
Always connect to the intranet IP by default, but my configuration file specifies the extranet.

2020-07-29 14:53:39.075 ERROR 20356 --- [           main] i.s.c.r.netty.NettyClientChannelManager  : 0101 can not connect to 172.19.231.5:8091 cause:can not register RM,err:can not connect to services-server.
 
io.seata.common.exception.FrameworkException: can not register RM,err:can not connect to services-server.
	at io.seata.core.rpc.netty.NettyClientChannelManager.doConnect(NettyClientChannelManager.java:210) ~[seata-all-1.3.0.jar:1.3.0]
	at io.seata.core.rpc.netty.NettyClientChannelManager.acquireChannel(NettyClientChannelManager.java:103) ~[seata-all-1.3.0.jar:1.3.0]
	at io.seata.core.rpc.netty.NettyClientChannelManager.reconnect(NettyClientChannelManager.java:175) ~[seata-all-1.3.0.jar:1.3.0]

The configuration address of the mount directory is not easy to use, or it can’t be connected, and the error has been reported all the time

docker run -id --name seata-server -p 8091:8091 \
-v /java/seata/resources/file.conf:/seata-server/resources/file.conf \
-v /java/seata/resources/registry.conf:/seata-server/resources/registry.conf \
-v /java/seata/logs:/root/logs \
seataio/seata-server:1.3.0 /bin/bash

Finally, IP and final version should be specified at runtime to solve the problem

 docker run -id --name seata-server -p 8091:8091 \
> -e SEATA_IP=192.168.23.129 \
> -e SEATA_PORT=8091 \
> -v /java/seata/resources/file.conf:/seata-server/resources/file.conf \
> -v /java/seata/resources/registry.conf:/seata-server/resources/registry.conf \
> -v /java/seata/logs:/root/logs \
> seataio/seata-server:1.3.0

Pycharm2020.3 startup error internal error

For the content of the text, please refer to the article [solved] pychar starts internal error after updating version 2020.1.

Problem description

Today, I have nothing to do to update pychar community 2020.1, and then I found that I directly reported an error when I started

Cause of error

I don’t quite understand the details, but maybe it’s a plug-in conflict?

resolvent

Refer to the answer to this question
pcharm community: internal error

The issue is known https://youtrack.jetbrains.com/issue/IDEA-237012 , please upvote and feel free to leave comments.Right now, you could either downgrade to 2019.3.4 or start IDE with default settings by renaming/removing the configuration and plugins folders https://www.jetbrains.com/help/pycharm/directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html

According to what he said, delete the plugin directory during installation and you can start it normally!!

The path of plugins directory
win10 system is as follows
syntax

%APPDATA%\JetBrains\plugins

Example

C:\Users\JohnS\AppData\Roaming\JetBrains\PyCharm2020.1\plugins

In my computer,

Error: property ‘TZ’ does not exist on type ‘type of moment’

A new ABP project, NPM install, then NPM start, results in an error: property ‘TZ’ does not exist on type ‘type of moment’

moment.tz.setDefault ( abp.timing.timeZoneInfo . iana.timeZoneId );

Because this paragraph is wrong:


Property 'tz' does not exist on type 'typeof moment'.  TS2339

    24 | 
    25 |   if (abp.clock.provider.supportsMultipleTimezone) {
  > 26 |     moment.tz.setDefault(abp.timing.timeZoneInfo.iana.timeZoneId);
       |            ^
    27 |   }
    28 | 
    29 |   const stores = initializeStores();
This error occurred during the build time and cannot be dismissed.

Serious,

https://blog.csdn.net/qq_ thirty-six million two hundred and seventy-nine thousand four hundred and forty-five

Change here to

import * as moment from ‘moment-timezone’;

 

 

Configuration: error:!! OpenSSL is not properly installed on your system

Project scenario:

In Linux system, use the command to decompress and install the keepalived source package.


Problem Description:

To install the keepalived source code package, you have run the following command:

tar -xzvf keepalived-2.2.2.tar.gz
cd keepalived-2.2.2
./configure --prefix=/usr/local/keepalived
yum -y install gcc
./configure --prefix=/usr/local/keepalived

The third command run result error, has been solved (solution), in the fifth line to re run the command error, the error message is:

configure: error:
  !!! OpenSSL is not properly installed on your system. !!!
  !!! Can not include OpenSSL headers files.   

Cause analysis:

The main reason for this error is the lack of header files. You only need to install OpenSSL and OpenSSL devel.


Solution:

To install OpenSSL and OpenSSL devel:

yum -y install openssl openssl-devel

Rerun the command ./configure -- prefix =/usr/local/kept , the command runs normally, and the problem is solved.

If there are other errors, please refer to:
configure: error: no acceptable C compiler found in $path error resolution
warning - this build will not support IPVS with IPv6

Configuration: error: no acceptable C compiler found in $path

Project scenario:

In Linux system, use the command to decompress and install the keepalived source package.


Problem Description:

To install the keepalived source code package, you have run the following command:

tar -xzvf keepalived-2.2.2.tar.gz
cd keepalived-2.2.2
./configure --prefix=/usr/local/keepalived

The first two commands run normally, and the third command runs as follows:

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/root/software/keepalived-2.2.2':
configure: error: no acceptable C compiler found in $PATH

Cause analysis:

The main reason for this error is that there is no c compiler.


Solution:

To install the C compiler:

yum -y install gcc

Rerun the command ./configure -- prefix =/usr/local/kept , the command runs normally, and the problem is solved.

If there are other errors, please refer to:
configure: error:!! OpenSSL is not properly installed on your system.!! Error resolution
warning - this build will not support IPVS with IPv6