Author Archives: Robins

[Solved] MySQL Install Error: GPG check FAILED

I just got a Huawei Cloud ECS and chose Centos8 system, today I installed mysql, the version I chose is 5.7.

Import of key(s) didn't help, wrong key(s)?
Public key for mysql-community-client-5.7.39-1.el7.x86_64.rpm is not installed. Failing package is: mysql-community-client-5.7.39-1.el7.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Public key for mysql-community-common-5.7.39-1.el7.x86_64.rpm is not installed. Failing package is: mysql-community-common-5.7.39-1.el7.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Public key for mysql-community-libs-5.7.39-1.el7.x86_64.rpm is not installed. Failing package is: mysql-community-libs-5.7.39-1.el7.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Public key for mysql-community-server-5.7.39-1.el7.x86_64.rpm is not installed. Failing package is: mysql-community-server-5.7.39-1.el7.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'yum clean packages'.
Error: GPG check FAILED 

Solution:

Re-import secret key

rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022

Then execute the installation command

yum -y install mysql-community-server

[Solved] catkin_make Error: Invoking “make -j12 -l12“ failed

While studying the official ROS tutorial Writing a Simple Publisher and Subscriber (C++), the following error occurred when running catkin_make:

Base path: /home/free/catkin_ws
Source space: /home/free/catkin_ws/src
Build space: /home/free/catkin_ws/build
Devel space: /home/free/catkin_ws/devel
Install space: /home/free/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/free/catkin_ws/build"
####
####
#### Running command: "make -j12 -l12" in "/home/free/catkin_ws/build"
####
[  0%] Built target std_msgs_generate_messages_lisp
[  0%] Built target std_msgs_generate_messages_nodejs
[  0%] Built target std_msgs_generate_messages_cpp
[  0%] Built target std_msgs_generate_messages_py
[  0%] Built target std_msgs_generate_messages_eus
[  0%] Built target _beginner_tutorials_generate_messages_check_deps_Num
[  0%] Built target _beginner_tutorials_generate_messages_check_deps_AddTwoInts
[ 58%] Built target beginner_tutorials_generate_messages_py
[ 64%] Built target beginner_tutorials_generate_messages_eus
[ 58%] Built target beginner_tutorials_generate_messages_lisp
[ 58%] Built target beginner_tutorials_generate_messages_cpp
[ 76%] Built target beginner_tutorials_generate_messages_nodejs
[ 76%] Built target beginner_tutorials_generate_messages
[ 82%] Linking CXX executable /home/free/catkin_ws/devel/lib/beginner_tutorials/talker
[ 88%] Linking CXX executable /home/free/catkin_ws/devel/lib/beginner_tutorials/listener
/usr/bin/ld: CMakeFiles/listener.dir/src/listener.cpp.o: relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: Final link failure: output non-representable links
collect2: error: ld returned 1 exit status
beginner_tutorials/CMakeFiles/listener.dir/build.make:112: recipe for target '/home/free/catkin_ws/devel/lib/beginner_tutorials/listener' failed
make[2]: *** [/home/free/catkin_ws/devel/lib/beginner_tutorials/listener] Error 1
CMakeFiles/Makefile2:1344: recipe for target 'beginner_tutorials/CMakeFiles/listener.dir/all' failed
make[1]: *** [beginner_tutorials/CMakeFiles/listener.dir/all] Error 2
make[1]: *** Waiting for unfinished tasks....
/usr/bin/ld: CMakeFiles/talker.dir/src/talker.cpp.o: relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: Final link failure: output non-representable links
collect2: error: ld returned 1 exit status
beginner_tutorials/CMakeFiles/talker.dir/build.make:112: recipe for target '/home/free/catkin_ws/devel/lib/beginner_tutorials/talker' failed
make[2]: *** [/home/free/catkin_ws/devel/lib/beginner_tutorials/talker] Error 1
CMakeFiles/Makefile2:1381: recipe for target 'beginner_tutorials/CMakeFiles/talker.dir/all' failed
make[1]: *** [beginner_tutorials/CMakeFiles/talker.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j12 -l12" failed

After looking for the reason for a long time, I finally found that the final error was due to the wrong version of GCC and G + +. After changing GCC and g++ 5.5.0, I successfully compiled

Process for installing GCC and g++ version 5.5.0:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test 
sudo apt-get update 
sudo apt-get install gcc-5
sudo apt-get install g++-5

Change GCC and g++ versions

cd /usr/bin 
sudo rm gcc 
sudo ln -s gcc-5 gcc 
sudo rm g++ 
sudo ln -s g++-5 g++

Finally, check whether the modification is successful

gcc --version
g++ --version

Recompile:

catkin_make clean   #Clear the front compile
catkin_make 

[Solved] failed (13: Permission denied) while reading upstream

Error Messages:

/usr/local/nginx/logs/error.log
2022/08/11 09:36:47 [crit] 2821940#0: *6263 open() "/usr/local/nginx/proxy_temp/2/29/0000000292" failed 
(13: Permission denied) while reading upstream, client: 15.60.178.88, server: demo.jichu.com, 
request: "GET /static/css/bootstrap.min.css.map HTTP/1.1", 
upstream: "http://15.60.178.88:3001/static/css/bootstrap.min.css.map", host: "demo.jichu.com"
2022/08/11 09:36:49 [crit] 2821940#0: *6261 open() "/usr/local/nginx/proxy_temp/3/29/0000000293" failed (
13: Permission denied) while reading upstream, client: 15.60.178.88, server: demo.jichu.com, 
request: "GET /class/studChoiceConfig?v=463&_=1660181808733 HTTP/1.1", 
upstream: "http://15.60.178.88:3001/class/stu?v=463&_=1660181808733", host: "demo.jichu.com", 
referrer: "http://demo.jichu.com/class/class"

 

Solution:
vi /usr/local/nginx/conf/nginx.conf
#use nobody;
Modify to
use root;
Restart nginx

[FAILED] Failed to start Raise network interfaces

[FAILED] Failed to start Raise network interfaces. 

The following error occurred during startup. Linux and windows cannot communicate. The reason may be that DHCP and static IP conflict. Use the ifconfig command to check that there is only IPv6 address but no IPv4 address.

 

Solution:

Modify the following file: /etc/network/interfaces.d/eth0, remove static IP settings or DHCP settings:
for example:

remove DHCP and replace it with:

auto eth0
iface eth0 inet static
address 192.168.2.99
netmask 255.255.255.0

Restart and the problem is solved.

[Solved] Maven Startup Error: Malformed \uxxxx encoding

Problem Description:

The project started well in the morning, but not in the afternoon 😂 What is this situation… At first, the project could not be started because the HTTP resources would be filtered out after Maven version 3.8.1. Later, it was still impossible to change HTTP to HTTPS,

The best way is to modify the Maven version. I changed it to Maven version 3.6.3. After that, I can download the package. However, it didn’t take long before there was another problem. Malformed \uxxxx encoding.

Let’s start with this error report today: malformed \ uxxxx encoding (the problem encountered today has been solved for half an afternoon and the reason has finally been found…)

Solution Summary:

First of all, the solutions are nothing more than the following:

1, first check the project .properties, .yml, pom.xml, logback and other configurations, whether there is a path error in the use of

2, update the maven repository, re-download the jar package

3, delete the path-to-the-library or resolver-status.properties file

In either case, it is recommended to restart the editor. For idea, click the Invalidate Caches/ Restart button to clear the cache and restart the idea

After opening IDEA and updating the project to start.

1, suddenly found build failure reported a strange error: Malformed \uxxxx encoding.

2. The <project> tag in the pom.xml file is also marked in red with the error.

But but but the code in the pom is exactly the same as on master, others are fine, but not their own, some of the import classes in the file will also report an error Can’t find.

Reason: When updating the jar packages that the project depends on, the downloaded jar packages may be incomplete due to network problems.

Solution: Delete the downloaded jar package and download it again.

In fact, it is not necessary to delete and re-download the package in general, so I think there must be a way to find the problematic package. To do accurate deletion

The quick solution is:

# Use the -X parameter to type out the error file information
mvn pakage -X
# Check the log, then delete or change the name of the file with the error to something else
# This will allow you to re-download the wrong file

I solved this problem through method 3

(1) In the . /m2/ folder (modify as you see fit), find path-to-the-library and delete it (if this file is not present, you can simply ignore this step).
(2) In the . /m2/repository (modify according to your situation) folder, search globally for the file: resolver-status.properties, delete all the files found, and recompile.

How to Configure OpenFPGA Environment (Probable Errors & Their Solutions)

Openfpga environment configuration and problem-solving


Environment configuration process

git clone https://github.com/LNIS-Projects/OpenFPGA.git​

cd OpenFPGA/.github/workflows​
# Add ‘sudo’ before apt-get in script: install_depencies_build.sh​
source install_depencies_build.sh  # (install all depencies)​

# back to OpenFPGA
python3 –m pip install –r requirements.txt​
make all​

# During make, watch the error messages and see which package is missing, repeatly using  ‘sudo apt install XXX’ to install them like:​
Tcl.h:   sudo apt install tcl-dev​
readline:   sudo apt install readline-dev​

How to Solve the Errors:

Compilation error

SIGSTKSZ Error

  • Cause: Guess it is a C compilation tool chain version problem caused by different source change
  • Solution: Update the version of catch.hpp and replace

 

1. Download

wget -O ~/Downloads/catch.hpp https://github.com/catchorg/Catch2/releases/download/v2.13.9/catch.hpp

2. Replace the file

cd {OpenFPGA_File_location}/libs/EXTERNAL/libcatch/
mv catch.hpp catch.bak.hpp
mv ~/Downloads/catch.hpp ./

FATAL ERROR issues about TBB

  • Cause: system problem missing header file tbb_stddef.h
  • Solution:
wget -O ~/Downloads/tbb_stddef.h https://raw.githubusercontent.com/wjakob/tbb/9e219e24fe223b299783200f217e9d27790a87b0/include/tbb/tbb_stddef.h
sudo mv ~/Downloads/tbb_stddef.h /usr/include/tbb

Missing header file task_scheduler_init.h

wget -O ~/Downloads/task_scheduler_init.h https://raw.githubusercontent.com/wjakob/tbb/raw/master/include/tbb/task_scheduler_init.h
sudo mv ~/Downloads/task_scheduler_init.h /usr/include/tbb

Dependency not found

  • Uniform problem: Error or not running when running install_dependencies_build.sh or when pip install
  • Solution: rerun both steps and install separately if there is still a problem
Note
# Missing ffi.h
sudo apt install libffi-dev
# Missing tcl.h
sudo apt install tk tcl tk-dev tcl-dev
# Missing readline
sudo apt install readline-dev libreadline6-dev

run-task error

Check the log. The most observed problem is that envYAML package is not installed

pip3 install envyaml

ModuleNotFoundError ‘prettytable’

When running run_vtr_task.py, it prompts: ModuleNotFoundError: No module named ‘prettytable’
processing:

# update pip
python -m pip install --upgrade pip
# install PrettyTable package
pip install PrettyTable

Script unsatisfiable

  • ctags, qt5-default are not available candidates (no installation candidate)
  • Solution: In most usage scenarios, these two packages are not important, edit the install_dependencies_build.sh file and delete the lines ctags and qt5-default

Network environment problems

include:

  1. Connection refused Connection refused
  2. 443 SSL could not be established
  3. Clone failed Clone failed

Solution:

  1. Modify hosts
  2. Open accelerator/VPN
  3. Use personal hotspot for mobile traffic

Runtime problems

Permission Denied | Can not find directory…

Problem Analysis: The command is incorrectly run with the root user when git clone or install dependencies, resulting in the personal user not having any modification rights.
Solution: In the root directory of OpenFPGA

sudo chown -hR {user name}:{user group, usually same as user name} . /
# Change all file owners to individual users

In the yosys shell, when the show command views the circuit diagram, it prompts an error

Problem: lack of dot matrix graphic display tool
solution: try running sudo apt-get install xdot

XGBoost Common Errors and Their Solutions

The solutions to xgboost errors

Error 1: ‘Dict_ Items’ object has no attribute ‘copy’
there should be a problem with the form of a parameter. It must be in the list format. Solution: based on the source code

plst = params.items()

Add a sentence format conversion

plst = params.items()
plst = list(params.items())

Error 2: WARNING: C:/Users/Administrator/workspace/xgboost-win64_release_1.6.0/src/learner.cc:627: Parameter…
Solution: Add the following code

xgb.set_config(verbosity=0)

How to Solve SSM JSON Chinese Messy Code Issue

Solution:

Add the configuration <mvc:message-converters register-defaults=“true”> in mvc:annotation-driven of sprinmvc-servlet.xml.

The codes are as below:

Unified solution to json Chinese messy code problem<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        https://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/aop
        https://www.springframework.org/schema/aop/spring-aop.xsd
        http://www.springframework.org/schema/context
        https://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/mvc
        https://www.springframework.org/schema/mvc/spring-mvc.xsd">
    <!--springmvc 统一解决json中文乱码问题-->
    <mvc:annotation-driven>
        <mvc:message-converters register-defaults="true">
            <bean class="org.springframework.http.converter.StringHttpMessageConverter">
                <constructor-arg value="UTF-8"/>
            </bean>
            <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
                <property name="objectMapper">
                    <bean class="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean">
                        <property name="failOnEmptyBeans" value="false"/>
                    </bean>
                </property>
            </bean>
        </mvc:message-converters>
    </mvc:annotation-driven>

    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" id="InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/jsp/"/>
        <property name="suffix" value=".jsp"/>
    </bean>

</beans>

Python Post kafka Messages Error: [Error 10] MessageSizeTooLargeError

Error Message:

[Error 10] MessageSizeTooLargeError: The message is 1177421 bytes when serialized which is larger than the maximum request size you have configured with the max_request_size configuration

Solution: Add the max_request_size configuration when instantiating the KafkaProducer class, and modify the default size:

System Startup and Display: [drm:drm_edid_block_valid] *ERROR* EDID checksum is invalid

envirenment:

CentOS7

question:

On startup, the system scrolls the console with messages similar to the following:

[drm:drm_edid_block_valid] *ERROR* EDID checksum is invalid, remainder is 128
Raw EDID:
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
i915 0000:00:02.0: HDMI-A-2: Ignoring invalid EDID block 59.

 

Approach:

Edit the file /boot/grub/grub.conf: add nomodeset to the end of the line starting with “kernel”.

kernel /vmlinuz-2.6.32-279.22.1.el6.x86_64 ro root=/dev/mapper/vg_rhel6-rootfs rd_NO_LUKS crashkernel=auto rhgb quiet <strong>nomodeset</strong>

 

reason:

Video mode settings have been moved to the kernel. This means that programming of hardware specific clock rates and video card registers happens in the kernel, not in X Windows System startup. On some cards this doesn’t work properly. Adding the nomodeset parameter instructs the kernel to use the BIOS video mode during boot and to load the video driver when the X Windows System starts.

Diagnostic steps:

View /var/log/dmesg log information.

K8S Master Initialize Error: [ERROR CRI]: container runtime is not running: output: E0812

[root@master1 ~]# kubeadm init   --kubernetes-version 1.24.3   --apiserver-advertise-address=0.0.0.0   --service-cidr=10.96.0.0/16   --pod-network-cidr=10.250.0.0/16   --image-repository k8s.gcr.io 
[init] Using Kubernetes version: v1.24.3
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
        [ERROR CRI]: container runtime is not running: output: E0812 15:41:43.145278   29697 remote_runtime.go:925] "Status from runtime service failed" err="rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService"
time="2022-08-12T15:41:43+08:00" level=fatal msg="getting status of runtime: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService"
, error: exit status 1
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher
# Solution
[root@master1 ~]# rm -rf /etc/containerd/config.toml
[root@master1 ~]# systemctl restart containerd

[Solved] HALCON error #5190: Invalid window parameter

There are two types of window operations in Halcon:

1. dev_open_window opens the entity’s form and displays the image

2. open_window opens a virtual form, which is actually an image into the cache

  1. * See the official routine advanced_visualization_settings.hdev
  2. dev_close_window()
  3.  dev_open_window ( 0, 0, 512, 512, ‘black’, WindowHandle)
  4.  set_window_param (WindowHandle, ‘graphics_stack’, ‘true’) //default value: ‘false’
  5.  set_window_param(WindowHandle, ‘flush’, ‘false’) //default value: ‘true’

In my C++ project, I encountered this problem. When the SetWindowParam function is executed, an exception is always reported:

HALCON error #5190: Invalid window parameter

The solution is as follows:
The SetWindowParam function needs to rely on the dynamic library file hcanvas.dll, and copy the library from
C:\Program Files\MVTec\HALCON-xxx\bin\x64-win64
to your own project path.