Category Archives: Error

[Solved] Ubantu CONDA Error: from CONDA cli import main ModuleNotFoundError: No module named ‘conda’

Recently, when I ran an experiment on the server in the laboratory, I needed to install another tensorboardx library. Due to my improper operation, I did CONDA install tensorboardx without switching to my own environment. As a result, when I found out later, something had been updated, and CONDA’s system crashed.

Later, I found many tutorials on the Internet. One of them found similar problems in the stack overflow community. He only needs to update the existing CONDA environment with the original Anaconda installation package.

bash Anaconda3-5.3.1-Linux-x86_64.sh -u

Remember that you must install Anaconda’s installation package. If it’s other installation packages, you can’t.

For example, I can’t use the package from windows.

How to Solve webdriver-manager Error

#When using webdriver manager to run crawlers frequently, the following errors are often reported

HTTPSConnectionPool(host=’chromedriver.storage.googleapis.com’, port=443): Max retries exceeded with url: /LATEST_ RELEASE_ 96.0.4664 (caused by newconnectionerror (‘& lt; urlib3. Connection. Httpsconnection object at 0x051bd478 & gt;: failed to establish a new connection: [winerror 10060] the connection attempt failed because the connector did not reply correctly after a period of time or the connected host did not respond.))

#Solution

Enter chrome.py

Then enter manager.py

Enter the above method and add the following two lines to get_latest_release_version()

react Cannot find file: ‘index.js’ does not match the corresponding name on disk:

1. Error information

./src/components/Header/index.jsx 2.42 KiB [built] [code generated]

ERROR in ./src/components/Header/index.jsx 5:0-35
Module not found: Error: Cannot find file: 'index.js' does not match the corresponding name on disk: '.\node_modules\prop-Types\prop-types'.
 @ ./src/App.js 5:0-41 104:40-46
 @ ./src/index.js 6:0-24 8:38-41

webpack 5.65.0 compiled with 1 error in 193 ms

2. Problem

Error introducing proptypes

import PropTypes from 'prop-Types' =>>>>>>> import PropTypes from 'prop-types'

[Solved] c# yolo cuDNN Error: CUDNN_STATUS_BAD_PARAM

The following problems occurred when loading the weight file:
cudnn status error in: File: D: \Darknet master\SRC\revolutionary_layer.c : cudnn_convolutional_setup() : line: 253 : build time: Dec 31 2021 – 14:37:05

cuDNN Error: CUDNN_STATUS_BAD_PARAM

The online search said that the data type was wrong and there was not enough video memory, but they didn’t solve my problem

After tossing for a day, it was found that the parameters read when loading the cfg file did not match those in the file, as shown in the following figure:

By comparing the yolowrapper in Darknet with that in my program, it turns out that the two versions are different. There is one more initializeyolo parameter in the initialization function Use the yolowrapper in the program to solve the Darknet problem.

Solve the problem of link: fatal error LNK1104: unable to open the file “d3dx9. Lib”

Solve the problem of link: fatal error LNK1104: unable to open the file “d3dx9. Lib”

First install the microsoft directx SDK (June 2010). The installation package name is DXSDK_ Jun10. Exe,
microsoft directx SDK 2010 version download http://www.microsoft.com/en-us/download/details.aspx?id=6812
Version:
Date Published:
9.29.1962
6/7/2010
File name:
File size:
DXSDK_ Jun10. exe
571.7 MB

 

If there is an error before the installation is completed, uninstall 86 and x64 redistributions of VC + + 2010 in the computer (10.0.xxx, XXX higher than 30319 is probably this number. As long as it is higher than this version, the installed 86 and x64 redistributions of VC + + 2010 must be deleted),

Reinstall the microsoft directx SDK (June 2010) again and the installation will be successful

Then select release from the drop-down box next to the compile button, and click the green compile button on the right side of Win32. If an error is reported at this time, it says that d3d9x cannot be found Lib
select the project name in the left column, right-click to open the lowest project – properties – configuration properties – VC + + directory, or directly press Alt + F7 to open the VC + + directory setting window
add these two paths to the beginning of the containing directory and Library Directory respectively, and be sure to separate them with semicolons and subsequent paths,

Include directory: D: \ program files (x86) \ microsoft directx SDK (June 2010) \ include
Library Directory: D: \ program files (x86) \ microsoft directx SDK (June 2010) \ lib \ x86;

Because:
d3dx9 Lib and d3d9 Lib is located in D: \ program files (x86) \ microsoft directx SDK (June 2010) \ lib \ x86 directory
d3d9 H (header file of Direct3D) is located in D: \ program files (x86) \ microsoft directx SDK (June 2010) \ include directory

Note that the premise of this setting is that the microsoft directx SDK (June 2010) must be installed in D: \ program files (x86) \ microsoft directx SDK (June 2010)

Select debug from the drop-down box next to the compile button and click the compile green button on the right side of Win32. Generally, no error will be reported because these two paths already exist in the include directory and Library Directory of the project – properties – configuration properties – VC + + directory

[Solved] ConnectionPoolTimeoutException: Timeout waiting for connection from pool

background

An error was found in the monitoring system today. The error is as follows

org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for connection from pool
	at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.leaseConnection(PoolingHttpClientConnectionManager.java:316)
	at org.apache.http.impl.conn.PoolingHttpClientConnectionManager$1.get(PoolingHttpClientConnectionManager.java:282)
	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:190)
	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)

action

At first, it was suspected that the connection pool setting was too small, so check the code’s setting of the connection pool size

It is found that the connection pool setting is large enough that our business can not use so many connections at all, so it is suspected that the connections have not been released after running out. View the number of connections on the server

netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'

Check the code and find that the connection is not released, as shown below

HttpResponse response = httpclient.execute(httpPost);

List<String> lines = IOUtils.readLines(response.getEntity().getContent(), "utf-8");
StringBuffer res = new StringBuffer();
for (String line : lines) {
   res.append(line);
}
       
ChatMessage chatMessage = getChatMessage(sendChatMessageDTO, replyMessageInfo, sendMessageesResultBO);
return chatMessage;

Solution:

Once the problem is found, we can return the connection to the connection pool.

HttpPost httpPost = new HttpPost(connectUrl);
InputStream inputStream = null;
try {
            
    HttpResponse response = httpclient.execute(httpPost);
    inputStream = response.getEntity().getContent();
    List<String> lines = IOUtils.readLines(inputStream, "utf-8");
} catch (Exception e){
    logger.error("connect error", e);
    if(httpPost != null){
    	httpPost.abort();
     }
} finally {
    if(inputStream != null){
        try {
            inputStream.close();
         } catch (Exception e){
            logger.error("", e);
         }
    }
}

Thinking (based on version 4.5)

What is the principle of httpclient connection pooling?

There are three main attributes in the connection pool, which are used for connections in different states

//Store the connection in use
private final Set<E> leased;
// holds the available connections
private final LinkedList<E> available;
// holds pending connections 
private final LinkedList<PoolEntryFuture<E>> pending;

What is the default connection pool size?

We check the official code (version 4.5) and find that the default total size is 20, and the default maximum size of each route is 2

 public PoolingHttpClientConnectionManager(
        final HttpClientConnectionOperator httpClientConnectionOperator,
        final HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory,
        final long timeToLive, final TimeUnit timeUnit) {
        super();
        this.configData = new ConfigData();
        this.pool = new CPool(new InternalConnectionFactory(
                this.configData, connFactory), 2, 20, timeToLive, timeUnit);
        this.pool.setValidateAfterInactivity(2000);
        this.connectionOperator = Args.notNull(httpClientConnectionOperator, "HttpClientConnectionOperator");
        this.isShutDown = new AtomicBoolean(false);
    }

How does close work?

There are two kinds of close

CloseableHttpResponse.Close(): this method is to put the exhausted connections back to the available collection of the connection pool, rather than actually closing the connections.Release() is called internally

httpClient.Close(): This is to close the connection pool and release all resources in the pool, that is, to really close the connection

[Solved] Greenplum Use the Storage Error: function cannot execute on a QE slice because it accesses relation

Error message:

In Greenplum database, when we use stored procedures to query data, we will report the following error information

function cannot execute on a QE slice because it accesses relation

First, let’s understand the replication table below

Replicated table

Greenplum 6 supports a new distribution strategy: copy table, that is, the whole table has a complete copy on each node.

test=# CREATE TABLE t2 (id int) DISTRIBUTED REPLICATED;
CREATE TABLE
test=# INSERT INTO t2 VALUES (1), (2), (3);
INSERT 0 3
test=# SELECT * FROM t2;
 id
----
  1
  2
  3
(3 rows)

test=# SELECT gp_segment_id, * from t2;
 gp_segment_id | id
---------------+----
         0 |  1
         0 |  2
         0 |  3

UDF cannot access any tables on segment. Due to the characteristics of MPP, any segment only contains part of the data, so the UDF executed in the segment cannot access any tables, otherwise the data calculation is wrong.

yydzero=# CREATE FUNCTION c() RETURNS bigint AS $$
yydzero$#  SELECT count(*) from t1 AS result;
yydzero$# $$ LANGUAGE SQL;
CREATE FUNCTION
yydzero=# SELECT c();
 c
---
 6
(1 row)

yydzero=# select c() from t2;
ERROR:  function cannot execute on a QE slice because it accesses relation "public.t1"  (seg0 slice1 192.168.1.107:25435 pid=76589)

If the above T1 is changed to a copy table, this problem does not exist.

Avoid distributed query plans:

If the data of a table is copied on each segment, a local connection plan can be generated to avoid data movement between different nodes of the cluster. If a replicated table is used to store a table with a small amount of data (such as thousands of rows), the performance will be significantly improved. A table with a large amount of data is not suitable for the replicated table mode.

Solution:

If the reason is found, it is simple. You only need to modify the table creation statement to solve the problem

ALTER TABLE table_name SET DISTRIBUTED REPLICATED;

jenkins Build Error: “‘: Failed to establish a new connection: [Errno -2] Name or service not known'”

Problem phenomenon

An error is reported when an interface request is initiated in Jenkins container:

Analysis

Report that the host cannot be obtained. Ping the host domain name in the Jenkins container (if Ping is not installed, install the Ping tool first). If the Ping fails, it indicates that the network connection configuration is wrong

Solution:

A new line of configuration is added to/etc/hosts in Jenkins container. The format is: host IP address domain name

If necessary, check testerhome Com initiates a request, first use the ping command to determine the IP, and then edit it into the hosts file

Precautions

After restarting the container each time, the hosts file will be initialized, resulting in the invalidation of the previously added configuration. You can continue to add
after restarting

docker exec -it -u root 647bf755ba2e /bin/bash -c "echo -e $loccalhost_ip $domain1 $domain2 >> /etc/hosts"

[Solved] ShardingJDBC Error: The bean ‘dataSource’, defined in class path resource [org/apache/shardingsphere/shardingjdbc/spring/boot/SpringBootConfiguration.class], could not be registered.

Error message

This means that there is already a bean with the same name in springboot, and rewriting this bean is not allowed

***************************
APPLICATION FAILED TO START
***************************

Description:

The bean 'dataSource', defined in class path resource [org/apache/shardingsphere/shardingjdbc/spring/boot/SpringBootConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class] and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

Solution:

In application Add the following configuration in properties: it is allowed to rewrite duplicate beans and overwrite the previous bean

spring.main.allow-bean-definition-overriding=true