Author Archives: Robins

ubuntu install package Error: subprocess installed post-installation script returned error exit status 10

foreword

When using the Ubuntu environment to sudo apt-get installinstall package, an error will be reported

XXX is the installation package

copy code
dpkg:error processing package XXX (--configure):
subprocess installed post-installation script returned error exit status 10

The reason for the error is actually a permission problem

Solution:

copy code
# If this error has already occurred, you need to delete these leftover packages that you just downloaded and download them again
sudo rm /var/lib/dpkg/info/XXX*

sudo dpkg --configure -D 777 XXX

# Repairing installer dependencies
sudo apt-get  -f install

crtdbg.h No such file or directory error [How to Solve]

Problem environment:
Microsoft Visual Studio Community 2022 (64-bit)
Windows SDK 10.0.19041.685

The problem is caused by an incorrect include directory set automatically by VS.
macro

And the wrong path shown in the image above is provided by the macro $(UCRTContentRoot).
The value of this macro is taken from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots\KitsRoot10the value of a registry key that may be set to the wrong value when installing some SDK-related packages:
reg

To solve this problem, we can delete the wrong registry key and find the SDK installer to fix it:
setup
repair
or directly modify the value of the registry key to the correct path (eg: C:\Program Files (x86)\Windows Kits \10).

[Solved] MYSQL Import Error: ERROR 1118 (42000): Row size too large (> 8126)

When doing database restore recently, I encountered the following problems

ERROR 1118 (42000) at line 79532: Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRnt row format, BLOB prefix of 768 bytes is stored inline.

 

 

Solution:

Modify the mysql configuration file my.cnf:

innodb_file_format=Barracuda 
innodb_file_per_table=1 

Then restart mysql and execute on the target table:
Alter table <table_name> engine=innodb ROW_FORMAT=DYNAMIC; 

 

Finally re-import.

 

If it still doesn’t work, consider adjusting the parameters:

innodb_log_file_size = 256M try to increase this configuration

[Solved] error while loading shared libraries: libopencv_highgui.so.3.4: cannot open shared object file…

opencv problem:

./test1: error while loading shared libraries: libopencv_highgui.so.3.4: cannot open shared object file: No such file or directory

This is the problem I have when executing test1this file

error while loading shared libraries: indicates that there is a problem with the shared library.

Two methods are described below.

the first method

Check the dynamic library (shared library) configuration file

sudo gedit /etc/ld.so.conf

Make sure you have the first line of the path
insert image description here
and then update it

sudo ldconfig

The second method

Let’s first look at the shared library of this file that is executed

ldd test1

insert image description here
We can see that there are several libraries that cannot be found

Then we use the locatecommand to locate these libraries

Install the locate command

sudo apt install mlocate

Locate the missing libraries in turn

locate libopencv_highgui.so.3.4

insert image description here
The path is found, then we add the path

Go to the dynamic library configuration folder

cd /etc/ld.so.conf.d

Create a new .conf file, name it whatever you want

You can also add it to the original file without creating a new one.

I create a new opencv.conf file here

sudo vim opencv.conf

It seems that there is no need to add so many paths here

insert image description here

Once the file is saved, it’s time to update the shared library link

sudo ldconfig

After the update, you can delete the newly created .conf file without affecting it.

[Solved] gym.error.NameNotFound: Environment PongNoFrameskip doesn’t exist.

Solution

The main reason for this error is that the gym installed is not complete enough.
When I first downloaded the gym library, I typed in

pip install gym

Later I learned that this download is the basic library

Error: gym.error.NameNotFound: Environment PongNoFrameskip doesn’t exist. Enter the following code

pip install ale-py
pip install gym[accept-rom-license]

[Solved] ASP Website Error: An error occurred on the server when processing the URL.

” An error occurred on the server when processing the URL. ”  occurs when accessing the webpage ,

The access phenomenon is: an error will be reported when the ID is greater than 32767, and there is no problem if the ID is less than 32767

 

 

Cases less than 32767:

 

Setting method one: 

Run CMD as administrator, locate the directory to %windir%\system32\inetsrv\, and execute

appcmd set config -section:asp -scriptErrorSentToBrowser: true

Meaning: Send an ASP internal error to the browser to expose problem location.

Visit again and report the error:

Microsoft VBScript Runtime Error Error ‘800a0006’ Overflow: ‘CInt’

Check the file Sitepage.asp and find that the function is used, and the string is converted to an integer asp: cint()–note that only the range of short integer values ​​must be between -32768 and 32767;

clng() is applied to long integers; that is, here when the ID is greater than 32767, the function cint() should be replaced by clng().

  After saving, it was found that the solution was successful.

[Solved] matlab Error: CUDA_ERROR_SYSTEM_NOT_READY

Error when using matlab:

>> gpuDevice
Error using gpuDevice
Failed to initialize graphics driver for computation. The CUDA error was: CUDA_ERROR_SYSTEM_NOT_READY

Check out the official NVIDIA documentation: https://docs.nvidia.com/gpudirect-storage/troubleshooting-guide/index.html

Install nvidia-fabricmanager:

# yum-config-manager --add-repo https: // developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo 
# yum install -y nvidia-fabric-manager- 515.65 . 01 - 1 
Note: 515. 65 .01 here is the version number of your graphics card driver, which can be viewed through nvidia-smi

Start the service:

# /usr/bin/nv-fabricmanager -c /usr/share/nvidia/nvswitch/fabricmanager.cfg

[Solved] Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: ‘event read from binlog did not pass crc check; the first event

mysql copy error from the library:

Last_IO_Errno: 1236
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'event read from binlog did not pass crc check; the first event '' at 4, the last event read from './mysql-bin.031260' at 506629253, the last byte read from './mysql-bin.031260' at 506637422.'

 

Check the log file on the main library:

mysqlbinlog --verify-binlog-checksum /data/mysqldb/mysql-bin.031260

 

Error:

ERROR: Error in Log_event::read_log_event(): 'Event crc check failed! Most likely there is event corruption.', data_len: 8169, event_type: 30
ERROR: Could not read entry at offset 506629253: Error in log format or read error.
WARNING: The range of printed events ends with a row event or a table map event that does not have the STMT_END_F flag set.
This might be because the last statement was not fully written to the log, or because you are using a --stop-position or --stop-datetime that refers to an event in the middle of a statement.
The event(s) from the partial statement have not been written to output.

 

It can be seen that there is a problem with the binlog on the main library, so this can only be rebuilt from the library. Rebuild master-slave replication.

If there is no error in the verification on the main library, you can disable verification on the slave library to solve the problem:

stop slave;

set global binlog_checksum=0;

start slave;

 

[Solved] Any Softwares Install Error in Ubuntu: /usr/bin/dpkg returned an error code

After reinstalling mysql, I get an error when installing any software

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
wget is already the newest version (1.21.2-2ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 43 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mysql-server-8.0 (8.0.30-0ubuntu0.22.04.1) ...
Renaming removed key_buffer and myisam-recover options (if present)
Specified filename /var/lib/mysql/ibdata1 does not exist.
mysqld will log errors to /var/log/mysql/error.log
2022-09-02T07:28:00.496933Z 0 [ERROR] [MY-010946] [Server] Failed to start mysqld daemon. Check mysqld error log.
Warning: Unable to start the server.
AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in profile /etc/apparmor.d/usr.sbin.mysqld at line 9: Could not open 'abstractions/mysql'
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xeu mysql.service" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Fri 2022-09-02 15:28:00 CST; 3ms ago
    Process: 15388 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)
        CPU: 6ms
dpkg: error processing package mysql-server-8.0 (--configure):
 installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-8.0; however:
  Package mysql-server-8.0 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 mysql-server-8.0
 mysql-server



E: Sub-process /usr/bin/dpkg returned an error code (1)

Solution:

ls -l /var/lib/dpkg/info | grep -i  mysql-server
-rw-r--r-- 1 root root     363 Jul 27 00:14 mysql-server-8.0.conffiles
-rwxr-xr-x 1 root root    1504 Jul 27 00:14 mysql-server-8.0.config
-rw-r--r-- 1 root root    1604 Aug 31 19:00 mysql-server-8.0.list
-rw-r--r-- 1 root root    1112 Jul 27 00:14 mysql-server-8.0.md5sums
-rwxr-xr-x 1 root root   17135 Jul 27 00:14 mysql-server-8.0.postinst
-rwxr-xr-x 1 root root    3873 Jul 27 00:14 mysql-server-8.0.postrm
-rwxr-xr-x 1 root root    5631 Jul 27 00:14 mysql-server-8.0.preinst
-rwxr-xr-x 1 root root     403 Jul 27 00:14 mysql-server-8.0.prerm
-rw-r--r-- 1 root root   21907 Jul 27 00:14 mysql-server-8.0.templates
-rw-r--r-- 1 root root    5232 Aug 31 19:00 mysql-server-core-8.0.list
-rw-r--r-- 1 root root    8318 Jul 27 00:14 mysql-server-core-8.0.md5sums
 mv /var/lib/dpkg/info/mysql-* /tmp
apt-get update

[Solved] JWT + SSO Error: Error creating bean with name ‘jwtTokenServices’

Error Messages:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jwtTokenServices' defined in org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerTokenServicesConfiguration$JwtTokenServicesConfiguration: Unsatisfied dependency expressed through method 'jwtTokenServices' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jwtTokenStore' defined in org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerTokenServicesConfiguration$JwtTokenServicesConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.oauth2.provider.token.TokenStore]: Factory method 'jwtTokenStore' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jwtTokenEnhancer' defined in org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerTokenServicesConfiguration$JwtTokenServicesConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter]: Factory method 'jwtTokenEnhancer' threw exception; nested exception is org.springframework.web.client.HttpClientErrorException: 401 null
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:467) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
    at com.familyxiao.sso.client.SsoClient2Application.main(SsoClient2Application.java:28) [classes/:na]

 

Solution (Two Cases and the corresponding solutions):

1. These two values below ​​are misconfigured:

security.oauth2.client.clientId= 
security.oauth2.client.clientSecret=

2. No token-value is configured in the client’s application.properties

[Solved] error: ‘CV_GRAY2BGR’ was not declared in this scope

This is the problem of running Gao Xiang’s slambook2 code, there are two methods to solve it.

error: ‘CV_GRAY2BGR’ was not declared in this scope

/home/diyu/slambook2/ch8/optical_flow.cpp: In function ‘int main(int, char**)’:
/home/diyu/slambook2/ch8/optical_flow.cpp:145:37: error: ‘CV_GRAY2BGR’ was not declared in this scope
145 | cv::cvtColor(img2, img2_single, CV_GRAY2BGR);
| ^~~~~~~~~~~
/home/diyu/slambook2/ch8/direct_method.cpp: In function ‘void DirectPoseEstimationSingleLayer(const cv::Mat&, const cv::Mat&, const VecVector2d&, std::vector<double, std::allocator >, Sophus::SE3d&)’:
/home/diyu/slambook2/ch8/direct_method.cpp:206:35: error: ‘CV_GRAY2BGR’ was not declared in this scope
206 | cv::cvtColor(img2, img2_show, CV_GRAY2BGR);
| ^~~~~~~~~~~
make[2]: *** [CMakeFiles/optical_flow.dir/build.make:63:CMakeFiles/optical_flow.dir/optical_flow.cpp.o] ERROR 1
make[1]: *** [CMakeFiles/Makefile2:105:CMakeFiles/optical_flow.dir/all] Error 2
make[1]: *** Waiting for unfinished task…
make[2]: *** [CMakeFiles /direct_method.dir/build.make:63: CMakeFiles/direct_method.dir/direct_method.cpp.o] error 1
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/direct_method.dir/all] error 2
make: *** [Makefile:84:all] Error 2

This experiment is because the code uses opencv2, and the cmkelists.txt file is opencv4

error: ‘CV_GRAY2BGR’ was not declared in this scope
which is the usage of opencv2, now opencv3 and 4 are COLOR_GARY2BGR

So there are two Method to Solve this error

  1. Change the usage of opencv2 in the code to the usage of opencv3 or 4. Change the CV_GRAY2BGR in the code to COLOR_GRAY2BGR, not sure if you just need to modify this.
  2. Change the opencv4 in the cmakelists file to opencv2.

Here choose the second method, modify it to opencv2

[AWS] Solve Error: An error occurred (AccessDenied) when calling the CreateMultipartUpload operation: Access Denied

When you deploy with SAM CLI using sam deploy, you might get the following error:

Error: Unable to upload artifact <YourComponent> referenced by ContentUri parameter of <YourComponent> resource. 
An error occurred (AccessDenied) when calling the CreateMultipartUpload operation: Access Denied.

 

Try to solve this error by doing the following check:

  • Check your aws configuration by running aws configure list, if not, run aws configure to modify it, make sure your IAM user have all the necessary permissions.
  • Build your app first by running sam build --use-container, and then run sam deploy --guided if this is your first time to deploy.

 

Now if you see the following error:

Error: Failed to create changeset for the stack: <YourStack>, ex: Waiter ChangeSetCreateComplete failed: Waiter encountered a terminal failure state: For expression "Status" we matched expected path: "FAILED" Status: FAILED. Reason: Requires capabilities : [CAPABILITY_NAMED_IAM]

 

Try to run sam deploy --capabilities CAPABILITY_NAMED_IAM