Category Archives: Error

[Solved] RHEL 7.6 Use yum Error: Could not contact any CDS load balancers

Problem description

The following error was encountered when executing yum update after booting an EC2 instance from MarketPlace with RHEL 7.6’s AMI:

[ec2-user@ip-172-31-43-28 ~]$ sudo yum update
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos


Could not contact any CDS load balancers: https://rhui3.cn-northwest-1.aws.ce.redhat.com/pulp/content/.

Cause of the problem
According to the official RHEL lifecycle statement: Red Hat Enterprise Linux Life Cycle RHEL 7.6 Extended Update Support Add-on all ended on May 31, 2021, while the RedHat official website states: RHUI 3 Takes Over in AWS, Bringing New DNS Data

Since RHEL 7.6 still uses the rh-amazon-rhui-client with version 2 by default, checking the repo configuration files starting with /etc/yum.repo.d/redhat-rhui, you can see that they all start with the address: https://rhui2-cds01.REGION.aws.ce.redhat.com.

After upgrading to RHUI 3 in July 2020, the hostname and IP address were changed, which means that the original repo cannot be used anymore.

With the transition to RHUI 3, new host names and IP addresses are used. If you have firewall rules, proxy settings etc. that worked with the original RHUI 2 host names or their original IP addresses, you are likely affected, and will need to change these rules or settings to allow the new host names or IP addresses.

Solution:

      1. Start a new instance using the last major release of RHEL 7, I’m using RHEL-7.9_HVM-20211005-x86_64-0-Hourly2-GP2 – ami-0196d703168979cc6
      1. SSH to this instance, use the following command to download the latest version of the rh-amazon-rhui-client.noarch package
sudo yum install --downloadonly --downloaddir=/home/ec2-user/ rh-amazon-rhui-client.noarch

Disconnect the SSH connection, use the SCP command on the local computer to download the installation package locally, and then transfer it to the problematic 7.6 instance


scp -i .\xxx.pem ec2-user@[RHEL 7.9的IP]:/home/ec2-user/rh-amazon-rhui-client-3.0.45-1.el7.noarch.rpm ./Desktop/

scp -i .\xxx.pem .\Desktop\rh-amazon-rhui-client-3.0.45-1.el7.noarch.rpm ec2-user@[RHEL 7.6的IP]:/home/ec2-user/

Connect SSH to the 7.6 instance and execute the following command to update RH Amazon rhui client

# Uninstall the old client and beta versions that came with 7.6
sudo yum remove -y rh-amazon-rhui-client rh-amazon-rhui-client-beta
# Manually install the downloaded new version of the rpm package
sudo rpm -ivh --nodeps ~/rh-amazon-rhui-client-3.0.45-1.el7.noarch.rpm
# Resolve the package dependencies by reinstalling them again via yum
sudo yum reinstall -y rh-amazon-rhui-client
# Refresh the cache and repo information
sudo yum clean all
sudo yum repolist
sudo yum list

How to Solve the jump error after Spring Security Login

Controller layer

Appears when the login is complete

First, comment out the security dependency and restart the project

Then access the interface of the controller layer and the access is successful

Then open the security dependency and restart the project

Visit the page again and you can jump

The reason for this may be that the cache is not loaded

[Solved] Android Studio Compile Error: Execution failed for task ‘:APP_MIDI:lintVitalRelease‘.

1. Error reporting information

When compiling Android application, the following error is reported:

Execution failed for task ':app:lintVitalRelease'.
> Lint found fatal errors while assembling a release target.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

 

2. Solution

Method I

lint checks for errors, which are output in the build/reports/lint-results-release-fatal.xml file, and can be changed by changing the error message in the file to modify the syntax error;

Example of error message:

<?xml version="1.0" encoding="UTF-8"?>
<issues format="5" by="lint 4.1.0">

    <issue
        id="NotSibling"
        severity="Fatal"
        message="`@+id/button` is not a sibling in the same `RelativeLayout`"
        category="Correctness"
        priority="6"
        summary="Invalid Constraints"
        explanation="Layout constraints in a given `ConstraintLayout` or `RelativeLayout` should reference other views within the same relative layout (but not itself!)"
        errorLine1="        android:layout_below=&quot;@+id/button&quot;"
        errorLine2="        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="D:\Application\app\src\main\res\layout\activity_main.xml"
            line="836"
            column="9"/>
    </issue>

</issues>

Method II:

Configure in build.gradle to remove lint checks:

android{
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
}

[Solved] GBase 8a MPP Database Loading Error: Unsupported version

Problem:
field loading failed with error:

[ERROR 2018-07-03 14:32:21.612 c.z.u.c.p.l.DataLoadingService:122 pool-16-thread-1] (GBA-01EX-700) Gbase general error: Task 780837 failed,
193.168.199.14:5050Failed to query in gnode:DETAIL: (GBA-01EX-700) Gbase general error:
(gns_host: 193.168.199.15) Unsupported version (not an attribute), or file does not exist: ./pm/metadata/a_l_cell_mm_stat_n4.GED/C00045.ctl.S

 

Solution:
There are a large number of ctl.S files in the metadata section of this node. It is confirmed that ctl.S is a temporary file during the disk write operation, which will be cleaned up after the write operation is completed, and the residual ctl.S can be regarded as dirty data and needs to be deleted manually.
After deleting the ctl.S file, it loads normally.

[Solved] Elasticsearch 7.10 Startup Error: bootstrap checks failed

Error Messages:

ERROR: [1] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max number of threads [3795] for user [es] is too low, increase to at least [4096]
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

 

Problem Cause.
es higher versions of resource requirements, linux system default configuration can not meet its requirements, so it needs to be configured separately
Solution.
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
Modify the vi /etc/security/limits.conf file and add the configuration

* hard nofile 65535  # *can be es start user
* soft nofile 65535

[2]: max number of threads [3795] for user [es] is too low, increase to at least [4096]
Modify the vi /etc/security/limits.conf file and add the configuration

es - nproc 4096 # es is my start user

After the above two configuration items are changed, ES start the user and login again will take effect;

[3]: max virtual memory areas vm. max_map_count [65530] is too low, increase to at least [262144]

Modify /etc/sysctl.config file, add the following configuration

vi /etc/sysctl.conf 

vm.max_map_count=262144

Execute the order with immediate effect

/sbin/sysctl -p
vm.max_map_count = 262144

​

Start successful

[Solved] AOP Error: BeanPostProcessor before instantiation of bean failed

Error Messages:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘xxx’ defined in file [xxx]:BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0’: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException

 

Reason:
Did not import the aspectjweaver.jar package. I had imported the aspectj-1.9.5.jar package and still reported an error, after importing the aspectjweaver.jar it can execute the program normally.

[Solved] PCL Compile Error: undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>:: XXX

Environment:
Ubuntu 20.04, PCL 1.11.0
when compiling PCL with cmake, an error is reported:

/usr/bin/ld: CMakeFiles/MYSLAM.dir/src/voslam.cpp.o:(.data.rel.ro._ZTVN3pcl7PCLBaseINS_12PointXYZRGBAEEE[_ZTVN3pcl7PCLBaseINS_12PointXYZRGBAEEE]+0x20): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>::setInputCloud(std::shared_ptr<pcl::PointCloud<pcl::PointXYZRGBA> const> const&)'
/usr/bin/ld: CMakeFiles/MYSLAM.dir/src/voslam.cpp.o:(.data.rel.ro._ZTVN3pcl7PCLBaseINS_12PointXYZRGBAEEE[_ZTVN3pcl7PCLBaseINS_12PointXYZRGBAEEE]+0x28): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>::setIndices(std::shared_ptr<std::vector<int, std::allocator<int> > > const&)'
/usr/bin/ld: CMakeFiles/MYSLAM.dir/src/voslam.cpp.o:(.data.rel.ro._ZTVN3pcl7PCLBaseINS_12PointXYZRGBAEEE[_ZTVN3pcl7PCLBaseINS_12PointXYZRGBAEEE]+0x30): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>::setIndices(std::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/bin/ld: CMakeFiles/MYSLAM.dir/src/voslam.cpp.o:(.data.rel.ro._ZTVN3pcl7PCLBaseINS_12PointXYZRGBAEEE[_ZTVN3pcl7PCLBaseINS_12PointXYZRGBAEEE]+0x38): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>::setIndices(std::shared_ptr<pcl::PointIndices const> const&)'
/usr/bin/ld: CMakeFiles/MYSLAM.dir/src/voslam.cpp.o:(.data.rel.ro._ZTVN3pcl7PCLBaseINS_12PointXYZRGBAEEE[_ZTVN3pcl7PCLBaseINS_12PointXYZRGBAEEE]+0x40): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>::setIndices(unsigned long, unsigned long, unsigned long, unsigned long)'
/usr/bin/ld: CMakeFiles/MYSLAM.dir/src/voslam.cpp.o:(.data.rel.ro._ZTVN3pcl6FilterINS_12PointXYZRGBAEEE[_ZTVN3pcl6FilterINS_12PointXYZRGBAEEE]+0x20): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>::setInputCloud(std::shared_ptr<pcl::PointCloud<pcl::PointXYZRGBA> const> const&)'
/usr/bin/ld: CMakeFiles/MYSLAM.dir/src/voslam.cpp.o:(.data.rel.ro._ZTVN3pcl6FilterINS_12PointXYZRGBAEEE[_ZTVN3pcl6FilterINS_12PointXYZRGBAEEE]+0x28): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>::setIndices(std::shared_ptr<std::vector<int, std::allocator<int> > > const&)'
/usr/bin/ld: CMakeFiles/MYSLAM.dir/src/voslam.cpp.o:(.data.rel.ro._ZTVN3pcl6FilterINS_12PointXYZRGBAEEE[_ZTVN3pcl6FilterINS_12PointXYZRGBAEEE]+0x30): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>::setIndices(std::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/bin/ld: CMakeFiles/MYSLAM.dir/src/voslam.cpp.o:(.data.rel.ro._ZTVN3pcl6FilterINS_12PointXYZRGBAEEE[_ZTVN3pcl6FilterINS_12PointXYZRGBAEEE]+0x38): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>::setIndices(std::shared_ptr<pcl::PointIndices const> const&)'
/usr/bin/ld: CMakeFiles/MYSLAM.dir/src/voslam.cpp.o:(.data.rel.ro._ZTVN3pcl6FilterINS_12PointXYZRGBAEEE[_ZTVN3pcl6FilterINS_12PointXYZRGBAEEE]+0x40): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>::setIndices(unsigned long, unsigned long, unsigned long, unsigned long)'
/usr/bin/ld: CMakeFiles/MYSLAM.dir/src/voslam.cpp.o:(.data.rel.ro._ZTVN3pcl9VoxelGridINS_12PointXYZRGBAEEE[_ZTVN3pcl9VoxelGridINS_12PointXYZRGBAEEE]+0x20): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>::setInputCloud(std::shared_ptr<pcl::PointCloud<pcl::PointXYZRGBA> const> const&)'
/usr/bin/ld: CMakeFiles/MYSLAM.dir/src/voslam.cpp.o:(.data.rel.ro._ZTVN3pcl9VoxelGridINS_12PointXYZRGBAEEE[_ZTVN3pcl9VoxelGridINS_12PointXYZRGBAEEE]+0x28): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>::setIndices(std::shared_ptr<std::vector<int, std::allocator<int> > > const&)'
/usr/bin/ld: CMakeFiles/MYSLAM.dir/src/voslam.cpp.o:(.data.rel.ro._ZTVN3pcl9VoxelGridINS_12PointXYZRGBAEEE[_ZTVN3pcl9VoxelGridINS_12PointXYZRGBAEEE]+0x30): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>::setIndices(std::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/bin/ld: CMakeFiles/MYSLAM.dir/src/voslam.cpp.o:(.data.rel.ro._ZTVN3pcl9VoxelGridINS_12PointXYZRGBAEEE[_ZTVN3pcl9VoxelGridINS_12PointXYZRGBAEEE]+0x38): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>::setIndices(std::shared_ptr<pcl::PointIndices const> const&)'
/usr/bin/ld: CMakeFiles/MYSLAM.dir/src/voslam.cpp.o:(.data.rel.ro._ZTVN3pcl9VoxelGridINS_12PointXYZRGBAEEE[_ZTVN3pcl9VoxelGridINS_12PointXYZRGBAEEE]+0x40): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>::setIndices(unsigned long, unsigned long, unsigned long, unsigned long)'
/usr/bin/ld: CMakeFiles/MYSLAM.dir/src/voslam.cpp.o:(.data.rel.ro._ZTVN3pcl9VoxelGridINS_12PointXYZRGBAEEE[_ZTVN3pcl9VoxelGridINS_12PointXYZRGBAEEE]+0x48): undefined reference to `pcl::VoxelGrid<pcl::PointXYZRGBA>::applyFilter(pcl::PointCloud<pcl::PointXYZRGBA>&)'
/usr/bin/ld: CMakeFiles/MYSLAM.dir/src/pointcloudmapping.cpp.o: in function `PointCloudMapping::PointCloudMapping(double)':
pointcloudmapping.cpp:(.text+0x1ac): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>::PCLBase()'
/usr/bin/ld: CMakeFiles/MYSLAM.dir/src/pointcloudmapping.cpp.o: in function `PointCloudMapping::viewer()':
pointcloudmapping.cpp:(.text+0x1626): undefined reference to `pcl::visualization::CloudViewer::CloudViewer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: pointcloudmapping.cpp:(.text+0x1d39): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>::setInputCloud(std::shared_ptr<pcl::PointCloud<pcl::PointXYZRGBA> const> const&)'
/usr/bin/ld: pointcloudmapping.cpp:(.text+0x1d66): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>::initCompute()'
/usr/bin/ld: pointcloudmapping.cpp:(.text+0x1db5): undefined reference to `pcl::VoxelGrid<pcl::PointXYZRGBA>::applyFilter(pcl::PointCloud<pcl::PointXYZRGBA>&)'
/usr/bin/ld: pointcloudmapping.cpp:(.text+0x1dbd): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBA>::deinitCompute()'
/usr/bin/ld: pointcloudmapping.cpp:(.text+0x1ff7): undefined reference to `pcl::visualization::CloudViewer::showCloud(std::shared_ptr<pcl::PointCloud<pcl::PointXYZRGBA> const> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: pointcloudmapping.cpp:(.text+0x24dd): undefined reference to `pcl::VoxelGrid<pcl::PointXYZRGBA>::applyFilter(pcl::PointCloud<pcl::PointXYZRGBA>&)'
/usr/bin/ld: pointcloudmapping.cpp:(.text+0x263d): undefined reference to `pcl::visualization::CloudViewer::~CloudViewer()'
/usr/bin/ld: pointcloudmapping.cpp:(.text+0x2798): undefined reference to `pcl::visualization::CloudViewer::~CloudViewer()'
collect2: error: ld returned 1 exit status

Solution:
manually specify the header file and link library of PCL:

# find_package(PCL 1.11.0 EXACT REQUIRED) 
# add_definitions( ${PCL_DEFINITIONS} )

-------Modify---:
file(GLOB PCL_LIBRARIES /usr/local/lib/libpcl_*)
set(PCL_INCLUDE_DIRS /usr/local/include/pcl-1.11)

INCLUDE_DIRECTORIES(${PROJECT_NAME} ${PCL_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PCL_LIBRARIES})

How to Solve forEach cannot exit the loop Issue

The forEach loop in the array will report an error if you want to exit the whole loop using break, and return will not jump out of the loop. In other words, the forEach traversal cannot be terminated.

Solution:

Iterate through for to achieve

    let arr = ['1', '2', '3', '4', '5'];
     for(let i=0; i<arr.length; i++) {
       if(arr[i] == '3') break;
       console.log(arr[i]) // 1 2
     }

Implemented by try--catch throwing exceptions

    let arr = ['1', '2', '3', '4', '5'];
    try {
      arr.forEach((item, index) => {
        if (item === '3') {
          throw new Error('End')
        }
        console.log(item) // 1 2 
      })
    } catch (e) {
      if (e.message === 'End') throw e;
    }

Implemented via reduce iteration, with an interrupt flag set

    let arr = ['1', '2', '3', '4', '5'];
    arr.reduce(function (p, c) {
      if (c == '3') {
        this.break = true
      }
      if (this.break) {
        return
      }
      console.log(c) // 1 2
    }, '') 

[Solved] MATLAB Error: Wrong use of commLTETurboDecoder/step

Incorrect use of commlteturbodecoder/step solution

When learning Chapter 4 of “comprehensive and detailed explanation of LTE: MATLAB modeling, simulation and implementation”, run chap4_ex04_performanceBER.m. Matlab reports the following errors:

Wrong use of commLTETurboDecoder/step
Method 'stepImpl' is not defined for class 'commLTETurboDecoder', or the method has been removed from MATLAB's search path.

Error TurboDecoder_crc (line 10)
[y, flag, iters] = step(TurboCrc, u, intrlvrIndices);

Error chap4_ex05_rate (line 28)
    [y, ~, iters] = TurboDecoder_crc(-r2, Indices); % Turbo Deocder

Error chap4_ex05_performanceBER (line 13)
    ber_third(n)=chap4_ex05_rate(EbNo, maxNumErrs, maxNumBits, CodingRate);

unction commLTETurboDecoder used in “Understanding LTE with Matlab” is missing

Reason: Because the version of matlab is too high, the official matlab has abandoned the commLTETurboDecoder function after the 2016 version, so it will report an error when running this program.

Solution: Install communications system toolbox 6.1 in matlab2015b, and find the function under this path

/Applications/MATLAB_R2015b.app/toolbox/comm/commdemos/commLTETurboDecoder.m

After downloading and installing MATLAB_R2015b software, find the commLTETurboDecoder.m file under the corresponding path, place it under the current folder, and it will run normally.

In addition, this function also has a defect, the following error will be reported in the run: change snr to snr6 in the zVisualize_ex05.m file, as shown in the figure.

Wrong use of snr (line 87)
Insufficient number of input parameters.

Error zVisualize_ex05 (line 3)
semilogy(snr,ber6,'ob')

Error chap4_ex05_performanceBER (line 28)
zVisualize_ex05(snr, ber_third,  ber_half);

Solution: Change the snr in the zVisualize_ex05.m file to snr6, as shown in the figure.

Modify the above two places to operate normally and draw the image, as shown in the figure:

[Solved] R Language Error: Discrete value supplied to continuous scale

Error: discrete value supplied to continuous scale

#Simulation data

set.seed(123)
my_df1 <- data.frame(a=rnorm(100), b=runif(100), c=rep(1:10, 10))
my_df2 <- data.frame(a=rnorm(100), b=runif(100), c=factor(rep(LETTERS[1:5], 20)))

#Error: Discrete value supplied to continuous scale

ggplot() +
  geom_point(data=my_df1, aes(x=a, y=b, color=c)) +
  geom_polygon(data=my_df2, aes(x=a, y=b, color=c), alpha=0.5)

#Solution:

Use the fill parameter;

ggplot() +
  geom_point(data=my_df1, aes(x=a, y=b, color=c)) +
  geom_polygon(data=my_df2, aes(x=a, y=b, fill=c), alpha=0.5)

How to Solve Vue & Django Cross-domain Issue

1. Install the package to solve cross-domain related problems at the terminal

python -m pip install django-cors-headers

2. Add the following configuration to the setting.py file clock in the django project

‘corsheaders’,

comment csrf out and add  ‘corsheaders.middleware.CorsMiddleware’,

finally add these two lines of configuration