Tag Archives: Error reporting solution

[Solved] public key is not available client side (option serverRsaPublicKeyFile not set)

Error:

An occasional fault is found and an error is reported when initializing the database connection pool:

public key is not available client side (option serverRsaPublicKeyFile not set)

Detailed error reporting contents are as follows:

2022-08-24 16:35:08.008 ERROR 233504 --- [     main] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Exception during pool initialization.

java.sql.SQLTransientConnectionException: Could not connect to address=(host=127.0.0.1)(port=3306)(type=master) : RSA public key is not available client side (option serverRsaPublicKeyFile not set)
 at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:79)
 at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:192)
 at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1372)
 at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:635)

After a long time of troubleshooting, it was finally found that the reason is:
the database used in the project is MySQL 8.0.X, but the connection driver used is MariaDB (MariaDB was used before). pom file dependencies are as follows:

<dependency>
    <groupId>org.mariadb.jdbc</groupId>
    <artifactId>mariadb-java-client</artifactId>
    <version>2.6.1</version>
</dependency>

Solution:

Just change the driver to MySQL
pom.xml dependency

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
</dependency>

application.yml driver and URL configuration.

spring:
	datasource:
		driver: driver: com.mysql.cj.jdbc.Driver
		url: jdbc:mysql://127.0.0.1:3306/databaseName?serverTimezone=GMT%2B8&characterEncoding=utf8

[Solved] Python Error: asyncio RuntimeError: This event loop is already running

In case of an error, the following diagram is given:

Solution:

# download nest_asyncio
pip3 install nest_asyncio

Add the following two lines at the beginning of the asynchronous collaboration code, or in the code:

import nest_asyncio

nest_asyncio.apply()

After consulting the data, it is found that using the Jupiter notebook environment, it is connected to the IPython kernel, and the IPython kernel itself runs on the event loop, while asyncio does not allow nesting of its event loop, so the error message as shown in the above figure will appear.

nest_asyncio exists as a patch for asynchronous operations.

[Solved] RedisTemplate increment Error: io.lettuce.core.RedisCommandExecutionException: ERR value is not an intege

Redistemplate uses increment to report an error: io.lettuce.core.RedisCommandExecutionException: ERR value is not an intege

Problem analysis

We can learn from spring’s documents that spring has two rare serialization strategies for redis. One is the JDKSerializationRedisSerialzer serialization of RedisTemplate application. The serialized value contains object information, version number, class information, etc. after this serialization, a string cannot be self incremented.

The other is the StringRedisSerializer adopted by the StringRedisTemplate. This strategy converts the string value into a byte array, so the values saved in redis can be operated.

Solution:

Replace RedisTemplate with String RedisTemplate

[Solved] size_from_dim: Assertion `dim >= 0 && (size_t)dim < sizes_.size()` failed.

Problems encountered

/home/optimizer-master/third_party/onnx_common/tensor.h:117: size_from_dim: Assertion dim >= 0 && (size_t)dim < sizes_.size() failed.

 

Problem description

When import onnx, I encountered the above problems

 

Solution:

If there is an op operation that cannot be exported during onnx export, this error will be reported
How to Solve:
find the operation that cannot be exported and add a judgment. If you export onnx, the op will not be used. An example is as follows

def forward(self, x):
    if torch.onnx.is_in_onnx_export():# if onnx
        return x * self.act(x)/6
    else: # normally
        return x * self.act(x + 3)/6

[Solved] Maven Project Error: error in opening zip file

Cause:

Create a maven project in idea and import pom.xml, related configuration. The following error occurred while running

****.***.***error in opening zip file

This error report occurs due to a jar version conflict in maven.

Solution:
Delete the maven local repository jar package, and then idea in the project refresh, let maven re-download dependencies. (the error reported in those lines, there is a corresponding path, you can delete it)

According to the error path, delete the corresponding jar from your computer. When you come back and refresh, it’s finished.

[Solved] matlab error: try to write SCRIPT vl_sift is executed as a function

Cause of problem:

1. The function name is the same as the file name

2. Missing \vlfeat-0.9.21\toolbox\mex\mexw64.

File directory:

\vlfeat-0.9.21\toolbox\sift\vl_sift.m

Error: function Directory:

[ kp1,ds1 ] = vl_sift(single(rgb2gray(img1)),'PeakThresh', 0,'edgethresh',3);

Solution:

1. Rename vl_sift.m to vl_sift1.m to solve it perfectly.

2. Copy the mex folder from other projects to \vlfeat-0.9.21\toolbox directory

vlfeat-0.9.21 version may have this problem. vlfeat-0.9.14 version mex is basically compiled. So there is no such problem.

[Solved] No module named ‘pywt‘ or ModuleNotFoundError: No module named ‘skimage.metrics‘

Solution:

pip install pywavelets
or
pip install scikit-image
The relevant dependencies pywavelets will be installed automatically

If an error is reported later:
modulenotfounderror: no module named ‘skimage metrics‘

If the skimage version is too low, update to the latest version (or 0.18+):

pip install scikit-image --upgrade

[Solved] CUDA unknown error – this may be due to an incorrectly set up environment

preface

Today, a project using pytorch on the viewing server suddenly made an error after upgrading. The whole content of the error report is limited by the title. I’ll send it below.

builtins. RuntimeError: CUDA unknown error – this may be due to an incorrectly set up environment, e.g. changing env variable CUDA_ VISIBLE_ DEVICES after program start. Setting the available devices to be zero.

Screenshot of error reporting

Later, I consulted some materials, and the following are some solutions.

Solution:

Method 1: add environment variables

Since I started the project as a docker container, I installed VIM after entering the container, and then in ~/Bashrc finally added something.

export CUDA_ VISIBLE_ DEVICES=0

Since the selected graphics card number is 0 when building the container, the number I configured above is 0.

Check $CUDA after restarting the container_ VISIBLE_ The devices output is normal, but the problem is not solved, and the error is still reported.

Method 2: add environment variables to the code

Add the following code at the beginning of the initialization CUDA area.

import os
os.environ['CUDA_VISIBLE_DEVICES'] =‘0’

It still hasn’t solved the problem.

Method 3: restart the server

Referring to some articles, I mentioned that if the system upgrades the graphics card driver without restarting, it will also lead to the same error.

So I restarted the server and solved the problem.

[Solved] mongodb Startup Error: ERROR: child process failed, exited with error number 14

Mongodb used to work well before. Today, it suddenly started to report an error. According to the Internet, the possible reasons are:

1. failed to start when service mongodb restart
2. caused by not shutting down mongodb properly, such as direct kill -9 <pid> causes
3. locked by multiple threads when inserting data [may be too much data, space capacity is insufficient].

My solution:

Delete the mongod.lock file under dbpath, then delete all log files under logpath, and finally execute reboot to restart the server side.

[Solved] Kafka in Windows error:java. nio. file. Filesystemexception: this file is in use by another program and cannot be accessed by the process

Problem description

Kafka deployed in Windows environment hangs up after running for a period of time
view logs logs/server Log the following errors are found:

 ERROR Failed to clean up log for __consumer_offsets-44 in dir D:\kafka\kafka_2.13-2.8.0\kafkakafka_2.13-2.8.0kafka-logs due to IOException (kafka.server.LogDirFailureChannel)
java.nio.file.FileSystemException: D:\kafka\kafka_2.13-2.8.0\kafkakafka_2.13-2.8.0kafka-logs\__consumer_offsets-44\00000000000000000000.timeindex.cleaned -> D:\kafka\kafka_2.13-2.8.0\kafkakafka_2.13-2.8.0kafka-logs\__consumer_offsets-44\00000000000000000000.timeindex.swap: 另一个程序正在使用此文件,进程无法访问。

	at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
	at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:387)
	at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:287)
	at java.nio.file.Files.move(Files.java:1395)
	at org.apache.kafka.common.utils.Utils.atomicMoveWithFallback(Utils.java:904)
	at kafka.log.AbstractIndex.renameTo(AbstractIndex.scala:210)
	at kafka.log.LazyIndex$IndexValue.renameTo(LazyIndex.scala:155)
	at kafka.log.LazyIndex.$anonfun$renameTo$1(LazyIndex.scala:79)
	at kafka.log.LazyIndex.renameTo(LazyIndex.scala:79)
	at kafka.log.LogSegment.changeFileSuffixes(LogSegment.scala:496)
	at kafka.log.Log.$anonfun$replaceSegments$4(Log.scala:2402)
	at kafka.log.Log.$anonfun$replaceSegments$4$adapted(Log.scala:2402)
	at scala.collection.immutable.List.foreach(List.scala:333)
	at kafka.log.Log.replaceSegments(Log.scala:2402)
	at kafka.log.Cleaner.cleanSegments(LogCleaner.scala:613)
	at kafka.log.Cleaner.$anonfun$doClean$6(LogCleaner.scala:538)
	at kafka.log.Cleaner.$anonfun$doClean$6$adapted(LogCleaner.scala:537)
	at scala.collection.immutable.List.foreach(List.scala:333)
	at kafka.log.Cleaner.doClean(LogCleaner.scala:537)
	at kafka.log.Cleaner.clean(LogCleaner.scala:511)
	at kafka.log.LogCleaner$CleanerThread.cleanLog(LogCleaner.scala:380)
	at kafka.log.LogCleaner$CleanerThread.cleanFilthiestLog(LogCleaner.scala:352)
	at kafka.log.LogCleaner$CleanerThread.tryCleanFilthiestLog(LogCleaner.scala:332)
	at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:321)
	at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:96)
	Suppressed: java.nio.file.FileSystemException: D:\kafka\kafka_2.13-2.8.0\kafkakafka_2.13-2.8.0kafka-logs\__consumer_offsets-44\00000000000000000000.timeindex.cleaned -> D:\kafka\kafka_2.13-2.8.0\kafkakafka_2.13-2.8.0kafka-logs\__consumer_offsets-44\00000000000000000000.timeindex.swap: 另一个程序正在使用此文件,进程无法访问。

		at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
		at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
		at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:301)
		at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:287)
		at java.nio.file.Files.move(Files.java:1395)
		at org.apache.kafka.common.utils.Utils.atomicMoveWithFallback(Utils.java:901)
		... 20 more

reason

When the consumer offsets the log cleanup or the log file scrolls, Kafka broker will shut down because the file renaming fails. This is because cannot modify the file in use in windows.

Solution

In server In the properties configuration file:
1.Modify log retention. Hours = - 1
2.Add log at the end of the file cleaner. Enable = false
3.Restart

Suggestion

There are similar issues and PR in GitHub, but they are not merged. The author uses kafka_2.13-2.8.0 version has this problem. Kafka is not recommended for win environments.